Exemplo n.º 1
0
        protected void TerminateConstruction()
        {
            TerminateConstructionInternal();
            UnityAction <BaseMenu> cb = TemporaryVariableManager.GetTemporaryVariable <UnityAction <BaseMenu> >(this, _onConstructionCompleteCBIndex);

            cb?.Invoke(this);
        }
Exemplo n.º 2
0
        protected void TerminateTransitionIn()
        {
            TerminateTransitionInInternal();
            UnityAction <BaseMenu> cb = TemporaryVariableManager.GetTemporaryVariable <UnityAction <BaseMenu> >(this, _onTransitionInCBIndex);

            cb?.Invoke(this);
        }
Exemplo n.º 3
0
        protected void TerminateTransitionOut()
        {
            TerminateTransitionOutInternal();
            UnityAction <BaseMenu> cb = TemporaryVariableManager.GetTemporaryVariable <UnityAction <BaseMenu> >(this, _onTransitionOutCBIndex);

            cb?.Invoke(this);
            _baseMenuFSM.SetState(BaseMenuStates.Disabled);
        }
Exemplo n.º 4
0
        protected override void InitializeSingleton()
        {
            base.InitializeSingleton();
            _appManagerFSM = new FSM <AppStates>();
            _appManagerFSM.Initialize(this, Constants._frameworkFsmInitPrefix, Constants._frameworkFsmUpdatePrefix, Constants._frameworkFsmTerminatePrefix);
            _appManagerFSM.SetState(AppStates.Foreground);

            _temporaryVariableMaintainence = TemporaryVariableManager.GetMaintainenceDelegate();
        }
Exemplo n.º 5
0
        protected void TerminateDestruction()
        {
            TerminateDestructionInternal();
            UnityAction <BaseMenu> cb = TemporaryVariableManager.GetTemporaryVariable <UnityAction <BaseMenu> >(this, _onDestructionCompleteCBIndex);

            cb?.Invoke(this);

            // I mean 0 offense when i say this, buuuuuuut....
            // ALLAHU AKBAR!
            GameObject.Destroy(this.gameObject);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Construction routine.
        /// </summary>
        //dont like the fact that this has to be public, unfortunately c# has no chill for friends :/ :p
        public void Construct(int configurationVariant = 0, UnityAction <BaseMenu> onComplete = null)
        {
            _baseMenuFSM = new FSM <BaseMenuStates>();
            _baseMenuFSM.Initialize(this, Constants._frameworkFsmInitPrefix, Constants._frameworkFsmUpdatePrefix, Constants._frameworkFsmTerminatePrefix);

            TemporaryVariableManager.SetTemporaryVariable <UnityAction <BaseMenu> >(this, _onConstructionCompleteCBIndex, onComplete, true);

            ConfigurationApplicator.Instance.ApplyConfiguration(this.GetType(), this.gameObject, configurationVariant);

            _baseMenuFSM.SetState(BaseMenuStates.Construction);
            _baseMenuFSM.UpdateStateMachine();
        }
Exemplo n.º 7
0
 /// <summary>
 /// sets menu state to transitioning out
 /// </summary>
 /// <param name="onComplete"></param>
 public virtual void TransitionOut(bool skipTransition = false, UnityAction <BaseMenu> onComplete = null)
 {
     TemporaryVariableManager.SetTemporaryVariable <UnityAction <BaseMenu> >(this, _onTransitionOutCBIndex, onComplete, true);
     if (skipTransition)
     {
         OnSkipTransition(BaseMenuStates.TransitionOut);
         onComplete?.Invoke(this);
         _baseMenuFSM.SetState(BaseMenuStates.Disabled);
         return;
     }
     _baseMenuFSM.SetState(BaseMenuStates.TransitionOut);
 }
Exemplo n.º 8
0
 public virtual void Destruct(UnityAction <BaseMenu> onComplete = null)
 {
     TemporaryVariableManager.SetTemporaryVariable <UnityAction <BaseMenu> >(this, _onDestructionCompleteCBIndex, onComplete, true);
     _baseMenuFSM.SetState(BaseMenuStates.Destruction);
 }