public void StopTutorial() { LogManager.Log("End Tutorial"); if (_currentScript != null) { _currentScript.Stop(); } _currentScript = null; _callback = null; }
public void End() { _currentScript = null; if (_callback != null) { var callback = _callback; _callback = null; callback(); } }
public bool StartTutorial(string name, Action callback = null) { if (_currentScript != null) { LogManager.LogWarning("Warning! There's already a tutorial running."); return(false); } var asset = ResourceLoadUtils.Load <TextAsset>(Path.Combine(TutorialScriptPath, name), true); if (asset != null) { _callback = callback; LogManager.Log("Start Tutorial: " + name); _currentScript = TutorialScript.LoadFromJson(asset.text); _currentScript.Execute(this); return(true); } return(false); }