예제 #1
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)
        {
            ArtimechEditor theStateMachineEditor = (ArtimechEditor)state.m_UnityObject;

            if (theStateMachineEditor.ToConditionalStateNode != null)
            {
                return(m_ChangeStateName);
            }
            return(null);
        }
        /// <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)
        {
            artBaseOkCancel okCancel = (artBaseOkCancel)state;

            if (okCancel.OkBool)
            {
                return(m_ChangeStateName);
            }
            return(null);
        }
        /// <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;

            artBaseOkCancel chooseState = (artBaseOkCancel)state;
            if (chooseState.CancelBool)
                strOut = m_ChangeStateName;

            return strOut;
        }
예제 #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)
        {
            artAddConditionalState conditionalState = (artAddConditionalState)state;

            if (conditionalState.LeftClickBool)
            {
                return(m_ChangeStateName);
            }

            return(null);
        }
예제 #5
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)
        {
            artBaseDisplayOkCanel dState = (artBaseDisplayOkCanel)state;

            if (dState.CancelBool || dState.OkBool)
            {
                return(m_ChangeStateName);
            }

            return(null);
        }
        /// <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)
        {
            artDisplayStates dState = (artDisplayStates)state;

            if (dState.SaveDataBool)
            {
                return(m_ChangeStateName);
            }

            return(null);
        }
        /// <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 (SimMgr.Inst.GameLose)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
예제 #8
0
        public void Update(baseState state, utlMatrix34 mtx, artConfigurationData configData)
        {
            m_State = state;

            MoveBool = false;

            // input
            Event ev = Event.current;

            //stateEditorUtils.MousePos = ev.mousePosition;

            //if the mouse button is down.
            if (ev.type == EventType.MouseDown && ev.button == 0)
            {
                LeftMouseButton = true;
                if (m_MainBodyHover)
                {
                    MoveBool = true;
                    Selected = true;
                }

                if (m_ResizeBodyHover)
                {
                    this.Resize = true;
                }
                if (this.m_TitleHover)
                {
                    RenameBool = true;
                }
            }

            if (ev.type == EventType.MouseUp)
            {
                LeftMouseButton = false;
                Selected        = false;
                Resize          = false;
                //RenameBool = false;
            }

            //GUI.Window(m_Id, mtx.Transform(WinRect), DrawNodeWindow, m_WindowStateAlias);


            Vector3 startPos = GetStartPosForConditional();

            for (int i = 0; i < this.ConditionLineList.Count; i++)
            {
                Vector3 endPos = GetEndPosForConditional(ConditionLineList[i]);

                Color shadowCol = new Color(0, 0, 1, 0.06f);
                //artGUIUtils.DrawArrowTranformed(mtx, startPos, endPos, WinRect, ConditionLineList[i].WinRect, 1, Color.black, 1, shadowCol, Color.white);
                artGUIUtils.DrawArrowTranformed(mtx, startPos, endPos, WinRect, ConditionLineList[i].WinRect, configData.ArrowLineWidth, configData.ArrowLineColor, configData.ArrowFillColor);
            }
            DrawNodeWindow(this.m_Id, configData);
        }
예제 #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 (utlDataAndFile.FindAFileInADirectoryRecursively(Application.dataPath, "StateMachine.txt") != null)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
        /// <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;
            ArtimechEditor theStateMachineEditor = (ArtimechEditor)state.m_UnityObject;

            if (theStateMachineEditor.SelectedObj != theStateMachineEditor.WasSelectedObj)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
예제 #11
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;
            ArtimechEditor theStateMachineEditor = (ArtimechEditor)state.m_UnityObject;

            if (theStateMachineEditor.GetResizeNode() != null)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
        /// <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;
            aMechDie theScript = state.m_GameObject.GetComponent <aMechDie>();

            if (theScript.DeathBool)
            {
                strOut = m_ChangeStateName;
            }


            return(strOut);
        }
예제 #13
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;

            simMgrUpdate theState = (simMgrUpdate)state;

            if (theState.StateTime > theState.SpawnTimeLimit)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
예제 #14
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);
        }
예제 #15
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;

            dieMoveOnSurface theScript = (dieMoveOnSurface)state;

            if (theScript.GoalReached)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
        /// <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);
        }
        /// <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;

            aMechInputController controller = state.m_GameObject.GetComponent <aMechInputController>();

            if (controller.TouchScreen())
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
예제 #18
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;

            dieProbeWorld theScript = (dieProbeWorld)state;

            if (!theScript.ProbeGood)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
        /// <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;

            artChooseStateMachineName chooseState = (artChooseStateMachineName)state;

            if (chooseState.CancelBool)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
        /// <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;

            if (aMechInputController.Inst.TouchScreen() && gamebase.StateTime > 0.5f)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
        /// <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;

            artLoadStates script = (artLoadStates)state;

            if (script.GoodLoad)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
예제 #22
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;

            //check to see if the selected object has changed.
            ArtimechEditor editor = (ArtimechEditor)state.m_UnityObject;

            if (editor.SelectedObj == null)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
예제 #23
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);
        }
예제 #24
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 UNITY_EDITOR
            editorDisplayWindowsState theState = (editorDisplayWindowsState)state;

            if (theState.CopyStateMachine)
            {
                strOut = m_ChangeStateName;
            }
#endif
            return(strOut);
        }
예제 #25
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;

            ArtimechEditor theStateMachineEditor = (ArtimechEditor)state.m_UnityObject;

            GameObject gmObject = (GameObject)theStateMachineEditor.SelectedObj;

            if (gmObject.GetComponent <iMachineBase>() == null)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
예제 #26
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);
        }
        /// <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;
            ArtimechEditor theStateMachineEditor = (ArtimechEditor)state.m_UnityObject;

            for (int i = 0; i < theStateMachineEditor.VisualStateNodes.Count; i++)
            {
                if (theStateMachineEditor.VisualStateNodes[i].MoveBool)
                {
                    strOut = m_ChangeStateName;
                    return(strOut);
                }
            }

            return(strOut);
        }
예제 #28
0
        // Update is called once per frame
        public 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, this, false);

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

            m_CurrentState.Update();
        }
예제 #29
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;
        }
        /// <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;

            aMechDie theScript = state.m_GameObject.GetComponent <aMechDie>();

            if (theScript.gameObject.GetComponent <Rigidbody>().velocity.sqrMagnitude < theScript.FallVelocityThreshold)
            {
                m_FallTime += gameMgr.GetSeconds();
            }

            if (theScript.gameObject.GetComponent <Rigidbody>().velocity.sqrMagnitude < theScript.FallVelocityThreshold && m_FallTime > theScript.FallTimeLimit)
            {
                strOut = m_ChangeStateName;
            }

            //utlDebugPrint.Inst.print(theScript.gameObject.GetComponent<Rigidbody>().velocity.sqrMagnitude.ToString());

            return(strOut);
        }