/// <summary>
        /// Test conditionals are placed here.
        /// </summary>
        /// <param name="state"></param>
        /// <returns>true or false depending if transition conditions are met.</returns>
        public override string UpdateConditionalTest(baseState state)
        {
            string strOut = null;

            editorRefactorState theState = (editorRefactorState)state;

            if (theState.ActionCancelled || theState.ActionConfirmed)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Test conditionals are placed here.
        /// </summary>
        /// <param name="state"></param>
        /// <returns>true or false depending if transition conditions are met.</returns>
        public override string UpdateConditionalTest(baseState state)
        {
            string strOut = null;

            editorDisplayWindowsState theState = (editorDisplayWindowsState)state;

            if (theState.Save)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Test conditionals are placed here.
        /// </summary>
        /// <param name="state"></param>
        /// <returns>true or false depending if transition conditions are met.</returns>
        public override string UpdateConditionalTest(baseState state)
        {
            string strOut = null;

            stateGameBase gamebase = (stateGameBase)state;
            aMechCube     script   = gamebase.StateGameObject.GetComponent <aMechCube>();

            if (gamebase.StateTime > script.m_UpTime)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Test conditionals are placed here.
        /// </summary>
        /// <param name="state"></param>
        /// <returns>true or false depending if transition conditions are met.</returns>
        public override string UpdateConditionalTest(baseState state)
        {
            string strOut = null;

#if ARTIMECH_THIS_SHOULD_NEVER_BE_TRUE_BUT_IS_AN_EXAMPLE_OF_A_CONDITION_BEING_TRUE
            This is an example of setting a contition to true if the gameobject
            falls below a certain height ingame.
            if (state.m_GameObject.transform.position.y <= 1000)
            {
                strOut = m_ChangeStateName;
            }
#endif


            return(strOut);
        }
Ejemplo n.º 5
0
        // Update is called once per frame
        protected void Update()
        {
            if (m_CurrentState == null)
            {
                Debug.LogWarning(gameObject.name + " stateMachineBase doesn't have an m_CurrentState.");
                return;
            }

            baseState state = m_StateChanger.UpdateChangeStates(m_StateList, m_CurrentState, gameObject, m_DisplayStates);

            if (state != null)
            {
                m_CurrentState = state;
            }

            m_CurrentState.Update();
            m_CurrentStateName = m_CurrentState.m_StateName;
        }
Ejemplo n.º 6
0
 void InitStates()
 {
     // all the states for the state editor
     m_CurrentState = AddState(new editorStartState(null), "Start");
     AddState(new editorRestoreState(null), "Restore");
     AddState(new editorLoadState(null), "Load");
     AddState(new editorWaitState(null), "Wait");
     AddState(new editorDisplayWindowsState(null), "Display Windows");
     AddState(new editorCreateState(null), "Create");
     AddState(new editorAddConditionalState(null), "Add Conditional");
     AddState(new editorAddPostCondtionalState(null), "Post Add Condition");
     AddState(new editorDeleteState(null), "Delete");
     AddState(new editorResizeState(null), "Resize");
     AddState(new editorRenameState(null), "Rename");
     AddState(new editorMoveState(null), "Move");
     AddState(new editorMoveBackground(null), "MoveBackground");
     AddState(new editorRefactorState(null), "Refactor");
     AddState(new editorSaveState(null), "Save");
 }
Ejemplo n.º 7
0
        // Update is called once per frame
        protected void Update()
        {
            //m_DisplayStates = true;
            if (m_CurrentState == null)
            {
                //Debug.LogWarning(this.name + " stateEditorBase doesn't have an m_CurrentState.");
                //return;
                InitStates();
            }

            baseState state = m_StateChanger.UpdateChangeStates(m_StateList, m_CurrentState, null, m_DisplayStates);

            if (state != null)
            {
                m_CurrentState = state;
            }

            m_CurrentState.Update();
            m_CurrentStateName = m_CurrentState.m_StateName;
        }
        /// <summary>
        /// Test conditionals are placed here.
        /// </summary>
        /// <param name="state"></param>
        /// <returns>true or false depending if transition conditions are met.</returns>
        public override string UpdateConditionalTest(baseState state)
        {
            string strOut = null;

#if ARTIMECH_THIS_SHOULD_NEVER_BE_TRUE_BUT_IS_AN_EXAMPLE_OF_A_CONDITION_BEING_TRUE
            This is an example of setting a contition to true if the gameobject
            falls below a certain height ingame.
            if (state.m_GameObject.transform.position.y <= 1000)
            {
                strOut = m_ChangeStateName;
            }
#endif
            if (utlDataAndFile.FindAFileInADirectoryRecursively(Application.dataPath, "StateMachine.txt") != null)
            {
                strOut = m_ChangeStateName;
            }


            return(strOut);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Test conditionals are placed here.
        /// </summary>
        /// <param name="state"></param>
        /// <returns>true or false depending if transition conditions are met.</returns>
        public override string UpdateConditionalTest(baseState state)
        {
            string strOut = null;

#if ARTIMECH_THIS_SHOULD_NEVER_BE_TRUE_BUT_IS_AN_EXAMPLE_OF_A_CONDITION_BEING_TRUE
            This is an example of setting a contition to true if the gameobject
            falls below a certain height ingame.
            if (state.m_GameObject.transform.position.y <= 1000)
            {
                strOut = m_ChangeStateName;
            }
#endif
            //if my state list is empty and a game object is populated then go to a load state
            //and see if the gameobject has a statemachine attached to it.
            if (stateEditorUtils.GameObject != stateEditorUtils.WasGameObject && stateEditorUtils.GameObject != null)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Test conditionals are placed here.
        /// </summary>
        /// <param name="state"></param>
        /// <returns>true or false depending if transition conditions are met.</returns>
        public override string UpdateConditionalTest(baseState state)
        {
            string strOut = null;

#if ARTIMECH_THIS_SHOULD_NEVER_BE_TRUE_BUT_IS_AN_EXAMPLE_OF_A_CONDITION_BEING_TRUE
            This is an example of setting a contition to true if the gameobject
            falls below a certain height ingame.
            if (state.m_GameObject.transform.position.y <= 1000)
            {
                strOut = m_ChangeStateName;
            }
#endif
            //            if (stateEditorUtils.StateList.Count == 0 || stateEditorUtils.GameObject == null)
            //                strOut = m_ChangeStateName;

            editorAddConditionalState addConditionalState = (editorAddConditionalState)state;
            if (addConditionalState.RightClickBool)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
Ejemplo n.º 11
0
 public override void Enter(baseState state)
 {
 }
Ejemplo n.º 12
0
 public override void Enter(baseState state)
 {
     Subscribe();
 }
Ejemplo n.º 13
0
 public void ForceChangeState(string stateName)
 {
     m_CurrentState = m_StateChanger.ForceChangeState(m_StateList, m_CurrentState, stateName, null, m_DisplayStates);
 }
Ejemplo n.º 14
0
 public baseState AddState(baseState state, string statename)
 {
     state.m_StateName = statename;
     m_StateList.Add(state);
     return(state);
 }
Ejemplo n.º 15
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="gameObj"></param>
 /// <returns>true or false depending if transition conditions are met.</returns>
 public string UpdateConditionalTest(baseState state)
 {
     return(m_ChangeStateName);
 }
Ejemplo n.º 16
0
 public override void Exit(baseState state)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 17
0
 public override void Exit(baseState state)
 {
     Unsubscribe();
 }
Ejemplo n.º 18
0
 public override void Exit(baseState state)
 {
 }
Ejemplo n.º 19
0
 public void Update(baseState state)
 {
     CurrentState = state;
     GUI.Window(m_Id, WinRect, DrawNodeWindow, m_WindowStateAlias);
 }
Ejemplo n.º 20
0
 public void Update(baseState state)
 {
     m_CurrentState = state;
     GUI.Window(m_Id, WinRect, DrawNodeWindow, m_Title);
 }