Exemple #1
0
        //List<ActionUnit>

        /// <summary>
        /// 初始化
        /// </summary>

        public void Init(ActionUnit owner)
        {
            Owner                = owner;
            _mInputStatesBase    = new InputStateBase[2];
            _mInputStatesBase[0] = InputStateBase.CreateStateByType(GameInputType.Move, KeyCode.None);
            _mInputStatesBase[1] = InputStateBase.CreateStateByType(GameInputType.Attack, KeyCode.J);
        }
Exemple #2
0
    void DrawState(InputStateBase[] statesBase)
    {
        for (int i = 0; i < statesBase.Length; i++)
        {
            EditorGUILayout.BeginHorizontal();

            //GUILayout.Label(string.Format("Type : {0} State : {1} PressedTime : {2:F2} ReleasedTime : {3:F2}", statesBase[i].InputType, statesBase[i].State, statesBase[i].PressedTime, statesBase[i].ReleasedTime));
            GUILayout.Label(string.Format("IsPress : {0} IsDown : {1} IsUp {2}", statesBase[i].IsPress,
                statesBase[i].IsDown, statesBase[i].IsUp));

            EditorGUILayout.EndHorizontal();
        }
    }
Exemple #3
0
        /// <summary>
        /// 获取一个InputKeyState实例
        /// </summary>
        /// <param name="type">类型</param>
        /// <param name="stateBase">返回</param>
        /// <returns></returns>

        public bool TryGetKeycodeState(GameInputType type, out InputStateBase stateBase)
        {
            stateBase = GetKeycodeState(type);
            return(stateBase != null);
        }
Exemple #4
0
 void Start()
 {
     _mInputStateBase = InputManager.Instance.InputStatesBase[1];
 }