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); }
protected void AutoUnlockAndComplete(FirstContactPhase phase) { if (!FirstContactManager.I.HasCompletedPhase(phase)) { FirstContactManager.I.CompletePhase(phase); } }
private void TransitionCompletePhaseOn(FirstContactPhase phase, bool condition) { if (IsPhaseUnlockedAndNotCompleted(phase) && condition) { CompletePhaseCheckSequence(phase); } }
public bool IsPhaseUnlockedAndNotCompleted(FirstContactPhase _phase) { if (SIMULATE_FIRST_CONTACT && SIMULATE_FIRST_CONTACT_PHASE == _phase) { return(true); } return(HasUnlockedPhase(_phase) && !HasCompletedPhase(_phase)); }
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;*/ }
protected void UnlockPhaseIf(FirstContactPhase phase, bool unlockingCondition) { bool shouldBeUnlocked = !FirstContactManager.I.HasUnlockedPhase(phase) && unlockingCondition; if (shouldBeUnlocked) { FirstContactManager.I.UnlockPhase(phase); } }
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!"); } }
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!"); } }
private void FilterTransitionOn(FirstContactPhase phase, bool condition, ref AppScene toScene, AppScene newScene) { if (newScene == AppScene.NONE) { return; } if (IsPhaseUnlockedAndNotCompleted(phase) && condition) { toScene = newScene; } }
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 }
// 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 } }
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); } }
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); }
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); } }
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); }
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; } }
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; } }
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); } }
protected virtual void SetPhaseUIShown(FirstContactPhase phase, bool choice) { }
private FirstContactPhaseState GetPhaseState(FirstContactPhase _phase) { return(state.phaseStates[(int)_phase]); }
private void SetPhaseState(FirstContactPhase _phase, FirstContactPhaseState _state) { state.phaseStates[(int)_phase] = _state; }
protected bool IsPhaseUnlocked(FirstContactPhase phase) { return(FirstContactManager.I.HasUnlockedPhase(phase)); }
public bool HasCompletedPhase(FirstContactPhase _phase) { return(GetPhaseState(_phase) == FirstContactPhaseState.Completed); }
protected bool IsPhaseCompleted(FirstContactPhase phase) { return(FirstContactManager.I.HasCompletedPhase(phase)); }
public bool IsPhaseUnlockedAndNotCompleted(FirstContactPhase _phase) { return(HasUnlockedPhase(_phase) && !HasCompletedPhase(_phase)); }
protected override void SetPhaseUIShown(FirstContactPhase phase, bool choice) { _stageMapsManager.SetUIActivationByContactPhase(phase, choice); }