public bool IsTutorialAvailable(TutorialDefinition tutorial) { bool flag = true; flag = !isTutorialComplete(tutorial.Id); if (flag && MonoSingleton <NativeAccessibilityManager> .Instance.AccessibilityLevel != 0) { flag = false; } if (flag && Disabled && tutorial.Id != 0) { flag = false; } if (flag && tutorial.IsMemberOnly) { flag = dataEntityCollection.IsLocalPlayerMember(); } if (flag && tutorial.MinimumPenguinAge > 0 && PlayerAgeInDays < tutorial.MinimumPenguinAge) { flag = false; } if (flag) { flag = isTutorialRequirementsComplete(tutorial); } return(flag); }
public bool TryStartTutorial(TutorialDefinition tutorial, string sceneNameToRunTutorial = null) { bool result = false; if (!(currentTutorial != null) && IsTutorialAvailable(tutorial)) { loadTutorial(tutorial, sceneNameToRunTutorial); result = true; } return(result); }
private Dictionary <int, TutorialDefinition> parseTutorialManifest(Manifest manifest) { Dictionary <int, TutorialDefinition> dictionary = new Dictionary <int, TutorialDefinition>(); for (int i = 0; i < manifest.Assets.Length; i++) { TutorialDefinition tutorialDefinition = manifest.Assets[i] as TutorialDefinition; dictionary.Add(tutorialDefinition.Id, tutorialDefinition); } return(dictionary); }
private void loadTutorial(TutorialDefinition tutorial, string sceneNameToRunTutorial) { if (tutorial.FsmContentKey != null && !string.IsNullOrEmpty(tutorial.FsmContentKey.Key) && Content.ContainsKey(tutorial.FsmContentKey.Key)) { currentTutorial = tutorial; Content.LoadAsync(delegate(string path, FsmTemplate fsm) { onLoadFSMComplete(fsm, sceneNameToRunTutorial); }, tutorial.FsmContentKey); } }
private bool isTutorialRequirementsComplete(TutorialDefinition tutorial) { bool result = true; for (int i = 0; i < tutorial.TutorialRequirements.Length; i++) { if (!isTutorialComplete(tutorial.TutorialRequirements[i].Id)) { result = false; break; } } return(result); }
public void EndTutorial() { if (currentTutorial != null) { if (!currentTutorial.IsNotAutoComplete) { SetTutorial(currentTutorial.Id, isComplete: true); } if (TutorialCompleteAction != null) { TutorialCompleteAction(currentTutorial); } currentTutorial = null; UnityEngine.Object.Destroy(getFSMContainer()); } }