Ejemplo n.º 1
0
    // Gets called when our transition is complete
    public void TransitionCompleted(EZTransition transition)
    {
        prevTransition = null;

        // Deactivate all child objects?
        if (deactivateAllOnDismiss)
        {
            // If this was a dismissal:
            if (transition == Transitions.list[2] ||
                transition == Transitions.list[3])
#if UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_4_9
            { gameObject.SetActive(false); }
#else
            { gameObject.SetActiveRecursively(false); }
#endif
        }

        if (tempTransCompleteDel != null)
        {
            tempTransCompleteDel(this, transition);
        }
        tempTransCompleteDel = null;

        if (changeDelegate != null)
        {
            changeDelegate(this);
        }

        if (blockInput[prevTransIndex] && UIManager.Exists())
        {
            UIManager.instance.UnlockInput();
        }
    }
Ejemplo n.º 2
0
    // Gets called when our transition is complete
    public void TransitionCompleted(EZTransition transition)
    {
        prevTransition = null;

        // Deactivate all child objects?
        if (deactivateAllOnDismiss)
        {
            // If this was a dismissal:
            if (transition == Transitions.list[2] ||
                transition == Transitions.list[3])
            {
                gameObject.SetActiveRecursively(false);
            }
        }

        if (tempTransCompleteDel != null)
        {
            tempTransCompleteDel(this, transition);
        }
        tempTransCompleteDel = null;

        if (blockInput[prevTransIndex] && UIManager.Exists())
        {
            UIManager.instance.UnlockInput();
        }
    }
Ejemplo n.º 3
0
 protected void Setup(BattleInitializationData data, TransitionCompleteDelegate onComplete)
 {
     this.battleData = data;
     this.onComplete = onComplete;
     Service.Get <BattleController>().InitializeCurrentBattle(data);
     Service.Get <EventManager>().SendEvent(EventId.BattleLoadStart, data);
 }
Ejemplo n.º 4
0
        private bool Setup(TransitionCompleteDelegate onComplete)
        {
            this.pendingCompletion = onComplete;
            HomeMapDataLoader homeMapDataLoader = Service.HomeMapDataLoader;
            GameStateMachine  gameStateMachine  = Service.GameStateMachine;
            bool flag = gameStateMachine.CurrentState is WarBoardState;

            this.transitionToHomeState = (!Service.WorldTransitioner.IsCurrentWorldHome() || flag);
            if (this.transitionToHomeState)
            {
                AbstractTransition transition;
                if (flag)
                {
                    transition = new WarboardToBaseTransition(this, homeMapDataLoader, this.pendingCompletion);
                }
                else
                {
                    transition = new WorldToWorldTransition(this, homeMapDataLoader, this.pendingCompletion, false, true);
                }
                Service.WorldTransitioner.StartTransition(transition);
                this.pendingCompletion = null;
            }
            else
            {
                gameStateMachine.SetState(this);
            }
            return(this.transitionToHomeState);
        }
Ejemplo n.º 5
0
 public void ContinueWipe(IState transitionToState, IMapDataLoader mapDataLoader, TransitionCompleteDelegate onTransitionComplete)
 {
     if (!this.softWipe)
     {
         Service.Get <StaRTSLogger>().Error("You must already be in a soft wipe to call for a wipe to continue.");
         return;
     }
     this.transitionToState    = transitionToState;
     this.mapDataLoader        = mapDataLoader;
     this.onTransitionComplete = onTransitionComplete;
     this.StartTransition();
 }
Ejemplo n.º 6
0
        public static bool GoToHomeState(TransitionCompleteDelegate onComplete, bool zoom)
        {
            Service.DeployerController.ExitAllDeployModes();
            Service.PvpManager.KillTimer();
            if (zoom)
            {
                PlanetView view = Service.WorldInitializer.View;
                view.ZoomOutImmediate();
                view.ZoomIn();
            }
            HomeState homeState = new HomeState();
            bool      result    = homeState.Setup(onComplete);

            Service.AssetManager.UnloadPreloadables();
            return(result);
        }
Ejemplo n.º 7
0
        public void OnEnter()
        {
            HudConfig config = new HudConfig(new string[]
            {
                "Currency",
                "Droids",
                "Crystals",
                "PlayerInfo",
                "Shield",
                "ButtonBattle",
                "ButtonWar",
                "ButtonLog",
                "ButtonLeaderboard",
                "ButtonSettings",
                "ButtonClans",
                "ButtonStore",
                "Newspaper",
                "SquadScreen",
                "SpecialPromo"
            });

            Service.UXController.HUD.ConfigureControls(config);
            if (!this.transitionToHomeState)
            {
                if (Service.WorldTransitioner.IsCurrentWorldHome() && this.ForceReloadMap)
                {
                    Service.ProjectileViewManager.UnloadProjectileAssetsAndPools();
                    Service.SpecialAttackController.UnloadPreloads();
                    Service.WorldInitializer.ProcessMapData(Service.CurrentPlayer.Map);
                    Service.EventManager.SendEvent(EventId.HomeStateTransitionComplete, null);
                }
                else
                {
                    Service.EventManager.SendEvent(EventId.WorldInTransitionComplete, null);
                }
                if (this.pendingCompletion != null)
                {
                    this.pendingCompletion();
                    this.pendingCompletion = null;
                }
            }
            Service.BuildingController.EnterSelectMode();
            Service.DeployerController.ExitAllDeployModes();
            Service.BILoggingController.SchedulePerformanceLogging(true);
            Service.InventoryCrateRewardController.ScheduleGivingNextDailyCrate();
        }
Ejemplo n.º 8
0
 protected AbstractTransition(IState transitionToState, IMapDataLoader mapDataLoader, TransitionCompleteDelegate onTransitionComplete, bool skipTransitions, bool zoomOut, WipeTransition startWipeTransition, WipeTransition endWipeTransition)
 {
     this.transitioning        = false;
     this.softWipe             = false;
     this.softWipeComplete     = false;
     this.softWipeWorldLoad    = false;
     this.softWipeAutoFinish   = false;
     this.wipeDirection        = 0f;
     this.transitionToState    = transitionToState;
     this.mapDataLoader        = mapDataLoader;
     this.onTransitionComplete = onTransitionComplete;
     this.skipTransitions      = skipTransitions;
     this.zoomOut             = zoomOut;
     this.startWipeTransition = startWipeTransition;
     this.endWipeTransition   = endWipeTransition;
     if (!this.softWipe && transitionToState != null)
     {
         this.ChooseRandomWipeDirection();
     }
 }
Ejemplo n.º 9
0
 protected virtual void OnTransitionInComplete(object cookie)
 {
     this.transitioning = false;
     if (this.onTransitionComplete != null)
     {
         this.onTransitionComplete();
         this.onTransitionComplete = null;
     }
     if (!this.skipTransitions)
     {
         Service.Get <EventManager>().SendEvent(EventId.WorldInTransitionComplete, null);
     }
     this.CleanupTransitionVisuals();
     if (this.alertMessage != null)
     {
         AlertScreen.ShowModal(false, null, this.alertMessage, null, null);
         this.alertMessage = null;
     }
     Service.Get <Engine>().ForceGarbageCollection(null);
 }
Ejemplo n.º 10
0
	// Gets called when our transition is complete
	public void TransitionCompleted(EZTransition transition)
	{
		prevTransition = null;

		// Deactivate all child objects?
		if (deactivateAllOnDismiss)
		{
			// If this was a dismissal:
			if (transition == Transitions.list[2] ||
			   transition == Transitions.list[3])
#if UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_4_9
				gameObject.SetActive(false);
#else
				gameObject.SetActiveRecursively(false);
#endif
		}

		if (tempTransCompleteDel != null)
			tempTransCompleteDel(this, transition);
		tempTransCompleteDel = null;

		if (changeDelegate != null)
			changeDelegate(this);

		if (blockInput[prevTransIndex] && UIManager.Exists())
			UIManager.instance.UnlockInput();
	}
Ejemplo n.º 11
0
 public WarbaseToWarboardTransition(IState transitionToState, IMapDataLoader mapDataLoader, TransitionCompleteDelegate onTransitionComplete, bool skipTransitions, bool zoomOut) : base(transitionToState, mapDataLoader, onTransitionComplete, skipTransitions, zoomOut, WipeTransition.FromStoryToLoadingScreen, WipeTransition.FromLoadingScreenToWarboard)
 {
 }
Ejemplo n.º 12
0
	// Gets called when our transition is complete
	public void TransitionCompleted(EZTransition transition)
	{
		prevTransition = null;

		// Deactivate all child objects?
		if(deactivateAllOnDismiss)
		{
			// If this was a dismissal:
			if (transition == Transitions.list[2] ||
			   transition == Transitions.list[3])
				gameObject.SetActiveRecursively(false);
		}

		if (tempTransCompleteDel != null)
			tempTransCompleteDel(this, transition);
		tempTransCompleteDel = null;

		if (blockInput[prevTransIndex] && UIManager.Exists())
			UIManager.instance.UnlockInput();
	}
Ejemplo n.º 13
0
 public BaseToWarboardTransition(IState transitionToState, IMapDataLoader mapDataLoader, TransitionCompleteDelegate onTransitionComplete) : base(transitionToState, mapDataLoader, onTransitionComplete, false, false, WipeTransition.FromBaseToWarboard, WipeTransition.FromBaseToWarboard)
 {
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Temporarily adds a delegate to be called when the next
 /// transition completes.  This will be unset after it is called.
 /// </summary>
 /// <param name="del">Delegate to be called.</param>
 public void AddTempTransitionDelegate(TransitionCompleteDelegate del)
 {
     tempTransCompleteDel += del;
 }
Ejemplo n.º 15
0
 public GalaxyMapToBaseTransition(IState transitionToState, IMapDataLoader mapDataLoader, TransitionCompleteDelegate onTransitionComplete, bool skipTransitions, bool zoomOut) : base(transitionToState, mapDataLoader, onTransitionComplete, skipTransitions, zoomOut, WipeTransition.FromGalaxyToLoadingScreen, WipeTransition.FromLoadingScreenToBase)
 {
 }
Ejemplo n.º 16
0
 public void SetOnTransitionComplete(TransitionCompleteDelegate onTransitionComplete)
 {
     this.onTransitionComplete = onTransitionComplete;
 }
Ejemplo n.º 17
0
	/// <summary>
	/// Temporarily adds a delegate to be called when the next
	/// transition completes.  This will be unset after it is called.
	/// </summary>
	/// <param name="del">Delegate to be called.</param>
	public void AddTempTransitionDelegate(TransitionCompleteDelegate del)
	{
		tempTransCompleteDel += del;
	}
Ejemplo n.º 18
0
        public static void GoToBattleStartState(BattleInitializationData data, TransitionCompleteDelegate onComplete)
        {
            BattleStartState state = new BattleStartState();

            BattleStartState.GoToBattleStartState(state, data, onComplete);
        }
Ejemplo n.º 19
0
 public static void GoToBattleStartState(BattleStartState state, BattleInitializationData data, TransitionCompleteDelegate onComplete)
 {
     state.Setup(data, onComplete);
     state.SetupTransition();
 }
Ejemplo n.º 20
0
 public void ContinueWipe(IState transitionToState, IMapDataLoader mapDataLoader, TransitionCompleteDelegate onTransitionComplete)
 {
     if (!this.IsCurrentTransitionSet())
     {
         return;
     }
     this.currentTransition.ContinueWipe(transitionToState, mapDataLoader, onTransitionComplete);
 }
Ejemplo n.º 21
0
	/// <summary>
	/// Temporarily sets up a delegate to be called when the next
	/// transition completes.  This will be unset after it is called.
	/// </summary>
	/// <param name="del">Delegate to be called.</param>
	public void SetTempTransitionDelegate(TransitionCompleteDelegate del)
	{
		tempTransCompleteDel = del;
	}