I'm looking at my dialogue, and one node looks like this:
My question is, is it possible to click really fast and skip these sequences/scripts, or are they guaranteed to execute until completion?
Here's my CollectCrops() function:
Code: Select all
namespace PixelCrushers.DialogueSystem.SequencerCommands
{
public class SequencerCommandCollectCrops : SequencerCommand
{
public void Start()
{
// Add your initialization code here. You can use the GetParameter***() and GetSubject()
// functions to get information from the command's parameters. You can also use the
// Sequencer property to access the SequencerCamera, CameraAngle, Speaker, Listener,
// SubtitleEndTime, and other properties on the sequencer. If IsAudioMuted() is true,
// the player has muted audio.
//
// If your sequencer command only does something immediately and then finishes,
// you can call Stop() here and remove the Update() method:
//
string cropName = DialogueLua.GetVariable("GrowingCropName").AsString;
string nameOfVariable = null;
switch (cropName)
{
case "sunflowers":
nameOfVariable = "sunflowers";
break;
case "catnip":
nameOfVariable = "catnip";
break;
case "wheat":
nameOfVariable = "wheat";
break;
case "coffee beans":
nameOfVariable = "coffeebeans";
break;
case "carrots":
nameOfVariable = "carrots";
break;
default:
throw new System.Exception("Unknown crop name: " + cropName);
}
var previousNumberOfCrop = DialogueLua.GetVariable(nameOfVariable).AsInt;
DialogueLua.SetVariable(nameOfVariable, previousNumberOfCrop + 1);
var previousCropsGrown = DialogueLua.GetVariable("cropsGrown").AsInt;
DialogueLua.SetVariable("cropsGrown", previousCropsGrown + 1);
DialogueLua.SetVariable("DayCropReady", -1);
DialogueLua.SetVariable("GrowingCropName", "");
Stop();
}
}
}