コード例 #1
0
        public void PushMotorState(CharacterMotor motor, ControllerStateID id)
        {
            if (controllerStateDictionary.ContainsKey(id) == false)
            {
                Debug.LogWarning("Warning, no definition for the state of id " + id + " exist within the current state dictionary");
                return;
            }

            motor.BindState(controllerStateDictionary[id]);
        }
コード例 #2
0
        private void AddControllerState(ControllerState state)
        {
            if (controllerStateDictionary == null)
            {
                controllerStateDictionary = new Dictionary <ControllerStateID, ControllerState>();
            }

            ControllerStateID id = state.GetControllerStateID();

            if (controllerStateDictionary.ContainsKey(id))
            {
                return;
            }
            else
            {
                controllerStateDictionary.Add(id, state);
            }
        }