示例#1
0
        private AppScene GetSceneForTutorialOfPhase(FirstContactPhase phase)
        {
            switch (phase)
            {
            case FirstContactPhase.AnturaSpace_Customization:
            case FirstContactPhase.AnturaSpace_Exit:
            case FirstContactPhase.AnturaSpace_Photo:
            case FirstContactPhase.AnturaSpace_Shop:
            case FirstContactPhase.AnturaSpace_TouchAntura:
                return(AppScene.AnturaSpace);

            case FirstContactPhase.Map_GoToAnturaSpace:
            case FirstContactPhase.Map_CollectBones:
            case FirstContactPhase.Map_GoToBook:
            case FirstContactPhase.Map_GoToMinigames:
            case FirstContactPhase.Map_GoToProfile:
            case FirstContactPhase.Map_PlayFirstSession:
                return(AppScene.Map);

            case FirstContactPhase.Intro:
                return(AppScene.Intro);

            case FirstContactPhase.Reward_FirstBig:
                return(AppScene.Rewards);
            }
            return(AppScene.NONE);
        }
示例#2
0
 protected void AutoUnlockAndComplete(FirstContactPhase phase)
 {
     if (!FirstContactManager.I.HasCompletedPhase(phase))
     {
         FirstContactManager.I.CompletePhase(phase);
     }
 }
示例#3
0
 private void TransitionCompletePhaseOn(FirstContactPhase phase, bool condition)
 {
     if (IsPhaseUnlockedAndNotCompleted(phase) && condition)
     {
         CompletePhaseCheckSequence(phase);
     }
 }
示例#4
0
 public bool IsPhaseUnlockedAndNotCompleted(FirstContactPhase _phase)
 {
     if (SIMULATE_FIRST_CONTACT && SIMULATE_FIRST_CONTACT_PHASE == _phase)
     {
         return(true);
     }
     return(HasUnlockedPhase(_phase) && !HasCompletedPhase(_phase));
 }
示例#5
0
        protected bool IsPhaseToBeCompleted(FirstContactPhase phase)
        {
            return(FirstContactManager.I.IsPhaseUnlockedAndNotCompleted(phase));

            /*bool shouldBeUnlocked = !FirstContactManager.I.HasCompletedPhase(phase) && unlockingCondition;
             * if (shouldBeUnlocked) FirstContactManager.I.UnlockPhase(phase);
             * return shouldBeUnlocked;*/
        }
示例#6
0
        protected void UnlockPhaseIf(FirstContactPhase phase, bool unlockingCondition)
        {
            bool shouldBeUnlocked = !FirstContactManager.I.HasUnlockedPhase(phase) && unlockingCondition;

            if (shouldBeUnlocked)
            {
                FirstContactManager.I.UnlockPhase(phase);
            }
        }
示例#7
0
        public void UnlockPhase(FirstContactPhase _phase)
        {
            SetPhaseState(_phase, FirstContactPhaseState.Unlocked);
            AppManager.I.Player.Save(); // TODO: save only when needed

            if (VERBOSE)
            {
                Debug.Log("FirstContact - phase " + _phase + " unlocked!");
            }
        }
示例#8
0
        public void CompletePhase(FirstContactPhase _phase)
        {
            SetPhaseState(_phase, FirstContactPhaseState.Completed);
            AppManager.I.Player.Save(); // TODO: save only when needed
            AppManager.I.Services.Analytics.TrackCompletedFirstContactPhase(_phase);

            if (VERBOSE)
            {
                Debug.Log("FirstContact - phase " + _phase + " completed!");
            }
        }
示例#9
0
 private void FilterTransitionOn(FirstContactPhase phase, bool condition, ref AppScene toScene, AppScene newScene)
 {
     if (newScene == AppScene.NONE)
     {
         return;
     }
     if (IsPhaseUnlockedAndNotCompleted(phase) && condition)
     {
         toScene = newScene;
     }
 }
示例#10
0
        public void TrackCompletedFirstContactPhase(FirstContactPhase phase)
        {
            if (!AnalyticsEnabled)
            {
                return;
            }

            var parameters = new Dictionary <string, object>();

            parameters["phase"]      = (int)phase;
            parameters["phase_name"] = phase.ToString();
#if FB_SDK
            AppManager.I.FacebookManager.LogAppEvent(Facebook.Unity.AppEventName.CompletedTutorial, parameters: parameters);
#endif
        }
示例#11
0
        // TODO: scene and phase could be part of some FirstContactData struct
        public JourneyPosition GetUnlockingJourneyPosition(FirstContactPhase phase)
        {
            switch (phase)
            {
            case FirstContactPhase.AnturaSpace_Photo:
                return(new JourneyPosition(1, 2, 1));

            case FirstContactPhase.Map_GoToAnturaSpace:
            case FirstContactPhase.Map_GoToProfile:
                return(new JourneyPosition(1, 1, 1));       // This means from the start

            default:
                return(null);    // This means not auto-unlocked
            }
        }
示例#12
0
        public void CompletePhaseCheckSequence(FirstContactPhase phase)
        {
            if (phase == FirstContactPhase.NONE)
            {
                throw new Exception("Phase for completion not correctly set!");
            }

            if (phasesSequence.Contains(phase))
            {
                CompleteCurrentPhaseInSequence();
            }
            else
            {
                CompletePhase(phase);
            }
        }
示例#13
0
        public GameObject GetGameObjectByContactPhase(FirstContactPhase phase)
        {
            switch (phase)
            {
            case FirstContactPhase.Map_GoToProfile:
                return(profileBookButton);

            case FirstContactPhase.Map_GoToBook:
                return(learningBookButton);

            case FirstContactPhase.Map_GoToMinigames:
                return(minigamesBookButton);

            case FirstContactPhase.Map_GoToAnturaSpace:
                return(anturaSpaceButton);
            }
            return(null);
        }
示例#14
0
        protected void UnlockPhaseIfReachedJourneyPosition(FirstContactPhase phase)
        {
            var journeyPosition = FirstContactManager.I.GetUnlockingJourneyPosition(phase);

            if (journeyPosition == null)
            {
                return;
            }
            if (journeyPosition.Equals(JourneyPosition.InitialJourneyPosition))
            {
                AutoUnlockAndComplete(phase);
            }
            bool shouldBeUnlocked = !FirstContactManager.I.HasUnlockedPhase(phase) && HasReachedJourneyPosition(journeyPosition);

            if (shouldBeUnlocked)
            {
                FirstContactManager.I.UnlockPhase(phase);
            }
        }
示例#15
0
        private bool CheckNewUnlockPhaseAt(FirstContactPhase phase, LocalizationDataId localizationDataId)
        {
            UnlockPhaseIfReachedJourneyPosition(phase);

            bool isPhaseToBeCompleted = IsPhaseToBeCompleted(phase);

            if (isPhaseToBeCompleted)
            {
                KeeperManager.I.PlayDialogue(localizationDataId, true, true, () =>
                {
                    _stageMapsManager.SetUIActivationByContactPhase(phase, true);
                    StartCoroutine(TutorialHintClickCO(_stageMapsManager.GetGameObjectByContactPhase(phase).transform, _stageMapsManager.UICamera));
                });
                return(true);
            }
            else if (IsPhaseUnlocked(phase))
            {
                _stageMapsManager.SetUIActivationByContactPhase(phase, true);
            }
            return(false);
        }
示例#16
0
        public void SetUIActivationByContactPhase(FirstContactPhase phase, bool choice)
        {
            switch (phase)
            {
            case FirstContactPhase.Map_GoToProfile:
                SetProfileBookUIActivation(choice);
                break;

            case FirstContactPhase.Map_GoToBook:
                SetLearningBookUIActivation(choice);
                break;

            case FirstContactPhase.Map_GoToMinigames:
                SetMinigamesBookUIActivation(choice);
                break;

            case FirstContactPhase.Map_GoToAnturaSpace:
                SetAnturaSpaceUIActivation(choice);
                break;
            }
        }
示例#17
0
        protected override void SetPhaseUIShown(FirstContactPhase phase, bool choice)
        {
            switch (phase)
            {
            case FirstContactPhase.AnturaSpace_Shop:
                UI.ShowShopButton(choice);
                if (choice)
                {
                    ShopDecorationsManager.SetContextClosed();
                }
                else
                {
                    ShopDecorationsManager.SetContextHidden();
                }
                break;

            case FirstContactPhase.AnturaSpace_Customization:
                m_oCustomizationButton.gameObject.SetActive(choice);
                break;

            case FirstContactPhase.AnturaSpace_Photo:
                m_oPhotoButton.gameObject.SetActive(choice);
                break;

            case FirstContactPhase.AnturaSpace_Exit:
                if (choice)
                {
                    _mScene.ShowBackButton();
                }
                else
                {
                    _mScene.HideBackButton();
                }
                break;
            }
        }
示例#18
0
        public void ForceToPhaseInSequence(FirstContactPhase forcedPhase)
        {
            ResetSequence();

            foreach (var phase in phasesSequence)
            {
                if (phase != forcedPhase)
                {
                    CompletePhase(phase);
                }
                else
                {
                    UnlockPhase(forcedPhase);
                    break;
                }
            }

            AppManager.I.Player.Save();

            if (VERBOSE)
            {
                Debug.Log("FirstContact - FORCING phase " + forcedPhase);
            }
        }
示例#19
0
 protected virtual void SetPhaseUIShown(FirstContactPhase phase, bool choice)
 {
 }
示例#20
0
 private FirstContactPhaseState GetPhaseState(FirstContactPhase _phase)
 {
     return(state.phaseStates[(int)_phase]);
 }
示例#21
0
 private void SetPhaseState(FirstContactPhase _phase, FirstContactPhaseState _state)
 {
     state.phaseStates[(int)_phase] = _state;
 }
示例#22
0
 protected bool IsPhaseUnlocked(FirstContactPhase phase)
 {
     return(FirstContactManager.I.HasUnlockedPhase(phase));
 }
示例#23
0
 public bool HasCompletedPhase(FirstContactPhase _phase)
 {
     return(GetPhaseState(_phase) == FirstContactPhaseState.Completed);
 }
示例#24
0
 protected bool IsPhaseCompleted(FirstContactPhase phase)
 {
     return(FirstContactManager.I.HasCompletedPhase(phase));
 }
示例#25
0
 public bool IsPhaseUnlockedAndNotCompleted(FirstContactPhase _phase)
 {
     return(HasUnlockedPhase(_phase) && !HasCompletedPhase(_phase));
 }
示例#26
0
 protected override void SetPhaseUIShown(FirstContactPhase phase, bool choice)
 {
     _stageMapsManager.SetUIActivationByContactPhase(phase, choice);
 }