コード例 #1
0
        private static SetVelocity2d _getOrCacheFSMSetVelocity2D(string stateName, string fsmName, GameObject go, int index)
        {
            SetVelocity2d outVal = null;

            PlayMakerFSM myFsm = _getOrCacheFSM(fsmName, go);

            if (index < 0)
            {
                FsmState myState;
                if (myFsm != null)
                {
                    myState = myFsm.GetState(stateName);
                }
                else
                {
                    return(null);
                }
                if (myState != null)
                {
                    outVal = (SetVelocity2d)myState.Actions.FirstOrDefault(setVelo => setVelo is SetVelocity2d);
                }

                return(outVal);
            }
            else
            {
                return(FsmUtil.GetAction <SetVelocity2d>(myFsm, stateName, index));
            }
        }
コード例 #2
0
        private static Wait _getOrCacheFSMWait(string stateName, string fsmName, GameObject go, int index)
        {
            Wait outVal = null;

            PlayMakerFSM myFsm = _getOrCacheFSM(fsmName, go);

            if (index < 0)
            {
                FsmState myState;
                if (myFsm != null)
                {
                    myState = myFsm.GetState(stateName);
                }
                else
                {
                    return(null);
                }
                if (myState != null)
                {
                    outVal = (Wait)myState.Actions.FirstOrDefault(wait => wait is Wait);
                }

                return(outVal);
            }
            else
            {
                return(FsmUtil.GetAction <Wait>(myFsm, stateName, index));
            }
        }