コード例 #1
0
        private static SetFloatValue _getOrCacheFSMSetFloatValue(string stateName, string fsmName, GameObject go, int index)
        {
            SetFloatValue 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 = (SetFloatValue)myState.Actions.FirstOrDefault(setFloat => setFloat is SetFloatValue);
                }

                return(outVal);
            }
            else
            {
                return(FsmUtil.GetAction <SetFloatValue>(myFsm, stateName, index));
            }
        }
コード例 #2
0
 public SetFloatValueData(float magnitudeFactor, SetFloatValue cachedFloatValue)
 {
     Factor = magnitudeFactor;
     this.cachedFloatValue = cachedFloatValue;
     CustomGameObject      = cachedFloatValue.Owner;
     FSMName      = cachedFloatValue.Fsm.Name;
     FSMStateName = cachedFloatValue.State.Name;
     ElementIndex = -1;
     defaultValue = 0;
 }
コード例 #3
0
            public SetFloatValueData(float magnitudeFactor, string fsmName, string fsmStateName, int elementIndex = -1,
                                     GameObject customGameObject = null)
            {
                CustomGameObject      = customGameObject;
                FSMName               = fsmName;
                FSMStateName          = fsmStateName;
                Factor                = magnitudeFactor;
                defaultValue          = 0;
                this.cachedFloatValue = null;

                this.ElementIndex = elementIndex;
            }