// checks to see if this is the current step public bool IsCurrentStep() { // if a list has been added, check to see if this is the current step. if (checklist != null) { return(this == checklist.GetCurrentStep()); } return(false); }
// called when the state is changed. // for the step observer, it is called when the step is completed. public override void OnStateChange() { // Checklist cl = step.GetChecklist(); Checklist cl = step.checklist; // if the current step is set to the observer, then the step is complete. if (subject.GetStateNumber() == stepEndState && cl.GetCurrentStep() == step) { // the step has been completed. cl.CompleteStep(); } }
// Update is called once per frame void Update() { if (tutorialList.activeList) { // step has changed if (currStep < tutorialList.GetCurrentStepNumber() && !tutorialList.IsCompleteList()) { currStep++; stepText.text = "Step " + tutorialList.GetCurrentStepNumber() + " - " + tutorialList.GetCurrentStep().title + ":\n" + tutorialList.GetCurrentStep().description; } // if all steps have been completed. else if (tutorialList.IsCompleteList()) { string str = "All Steps Completed!"; if (stepText.text != str) { stepText.text = str; } } } }