示例#1
0
        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);
        }
示例#2
0
        public bool TryStartTutorial(TutorialDefinition tutorial, string sceneNameToRunTutorial = null)
        {
            bool result = false;

            if (!(currentTutorial != null) && IsTutorialAvailable(tutorial))
            {
                loadTutorial(tutorial, sceneNameToRunTutorial);
                result = true;
            }
            return(result);
        }
示例#3
0
        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);
        }
示例#4
0
 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);
     }
 }
示例#5
0
        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);
        }
示例#6
0
 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());
     }
 }