Advanced: Manual Step Calls
Calling the steps using a script / button / event trigger.
Last updated
Calling the steps using a script / button / event trigger.
Last updated
Here, we work with the step-calling logic manually using public wrapper methods in the TutorialSceneReferences (TSR).
In the script from which you will call the step, create a reference to TSR. For example:
[SerializeField] private TutorialSceneReferences sceneReferences;
Use public method calls depending on the desired result:
ChangeStepVisualText(int stepIndex, string textValue, TextToChange textField)
It is used to pass custom text to the selected hint of the selected step. Required for localization. It is intended for a one-time runtime call.
sceneReferences.ChangeStepVisualText(2, "Your text", TextToChange.PointerText)
StartTutorialStep(int stepIndex)
Starts a specific tutorial step by its index and disables others
sceneReferences.StartTutorialStep(2);
AsyncStartTutorialStep(int stepIndex)
Starts a specific tutorial step by its index and doesnt disable others
sceneReferences.AsyncStartTutorialStep(2);
StartTutorialStepWithTargets(int stepIndex, List targetObjects, bool stopOtherSteps)
Starts a tutorial step with custom target GameObjects
sceneReferences.ForceCompleteStep(2, myGameObjectList, false);
ForceCompleteStep(int stepIndex)
Finishes the step by setting its status to "Done" regardless of the completion conditions
sceneReferences.ForceCompleteStep(2);
ForceCompleteTutorial()
Completes all tutorial steps on the scene without exception, marking as Done
sceneReferences.ForceCompleteTutorial();
ResetDisplayingTutorialSteps()
Resets all currently displaying tutorial steps
sceneReferences.ResetDisplayingTutorialSteps();
It is recommended to set the steps you call from the script to Start Step → Manually Call to ensure unified control over execution.
Confirm Button inside of any UI Graphic Prefab can also call public methods inside prefab UIGraphicAnimation script.
InitializeByConfirm()
It is triggered upon button click and sets BlockedByButton to false in the step. Then, the step continues until the player meets the main condition.
FinishStep()
Can also be triggered by a button to immediately complete the step upon click.