コード例 #1
0
    private void ProcDoubleTap(InputKeyType keyType)
    {
        if (!dicDoubleTapTimings.ContainsKey(keyType))
        {
            dicDoubleTapTimings.Add(keyType, 0f);
        }

        if (dicDoubleTapTimings[keyType] == 0f ||
            upKeys.Contains(keyType))
        {
            if (Time.time < dicDoubleTapTimings[keyType])
            {
                if (!doubleTaps.Contains(keyType))
                {
                    doubleTaps.Add(keyType);
                }
            }

            if (upKeys.Contains(keyType))
            {
                upKeys.Remove(keyType);
            }

            dicDoubleTapTimings[keyType] = Time.time + 0.18f;
        }
    }
コード例 #2
0
        void ProcDoubleTap(InputKeyType keyType)
        {
            if (!DicDoubleTapTimings.ContainsKey(keyType))
            {
                DicDoubleTapTimings.Add(keyType, 0f);
            }

            if (DicDoubleTapTimings[keyType] == 0f ||
                UpKeys.Contains(keyType))
            {
                if (Time.time < DicDoubleTapTimings[keyType])
                {
                    if (!DoubleTaps.Contains(keyType))
                    {
                        DoubleTaps.Add(keyType);
                    }
                }

                if (UpKeys.Contains(keyType))
                {
                    UpKeys.Remove(keyType);
                }

                DicDoubleTapTimings[keyType] = Time.time + 0.18f;
            }
        }
コード例 #3
0
 /*
  * public bool CheckInTransitionBetweenSameClips(Animator animator)
  * {
  *
  * }
  */
 public void SendOnActionMessage(InputKeyType type)
 {
     if (OnAction != null)
     {
         OnAction(type);
     }
 }
コード例 #4
0
ファイル: InputManager.cs プロジェクト: NoeCalmness/CoreFrame
    public void Set(int _ID = -1, string _key = "", InputKeyType _type = InputKeyType.Down, TouchID _touchID = 0, int _touchIndex = 0, int _delay = 0, int _value = 0, string _name = "", string _desc = "")
    {
        ID            = _ID;
        key           = _key;
        type          = _type;
        touchID       = _touchID;
        touchIndex    = _touchIndex;
        delay         = _delay;
        value         = _value;
        name          = _name;
        desc          = _desc;
        bindDirection = 0;
        oneShot       = type < InputKeyType.Press;
        isInstant     = type != InputKeyType.Hold;

        m_lastDownTime      = 0;
        m_lastTouchDownTime = 0;

        m_customFired = false;
        m_fired       = false;
        m_touchFired  = false;

        m_mutexKeyIDs = null;
        m_mutexKeys.Clear();
    }
コード例 #5
0
ファイル: Input.cs プロジェクト: SnowQT/fyf-mapbuilder
 public InputKeyState(int keyGroup, int keyCode, InputKeyType keyType, bool disabled)
 {
     KeyGroup = keyGroup;
     KeyCode = keyCode;
     KeyType = keyType;
     IsDisabled = disabled;
     TimePressed = -1;
     Callbacks = new HashSet<InputKeyCallback>();
 }
コード例 #6
0
ファイル: Input.cs プロジェクト: SnowQT/fyf-mapbuilder
        public InputKeyState RegisterKey(int keyGroup, int keyCode, InputKeyType type)
        {
            if (!FindKeyState(keyGroup, keyCode, out InputKeyState state))
            {
                state = new InputKeyState(keyGroup, keyCode, type, false);
            }

            keyStates.Add(state);
            return state;
        }
コード例 #7
0
ファイル: Input.cs プロジェクト: SnowQT/fyf-mapbuilder
        public InputKeyState RegisterKey(int keyGroup, int keyCode, InputKeyType type, InputKeyCallback callback)
        {
            InputKeyState state = RegisterKey(keyGroup, keyCode, type);

            if (callback != null)
            {
                state.AddCallback(callback);
            }

            return state;
        }
コード例 #8
0
        void RemoveDoubleTap(InputKeyType keyType)
        {
            if (DoubleTaps.Contains(keyType))
            {
                DoubleTaps.Remove(keyType);
            }

            if (!UpKeys.Contains(keyType))
            {
                UpKeys.Add(keyType);
            }
        }
コード例 #9
0
 public void Init(CharacterControl c, InputKeyType key, float maxD, float minD, float maxSC, float SCG, float SCD)
 {
     control           = c;
     SmashKey          = key;
     MaxDuration       = maxD;
     MinDuration       = minD;
     MaxSmashCount     = maxSC;
     SmashCountGain    = SCG;
     SmashCountDecay   = SCD;
     CurrentSmashCount = 0f;
     Smashing();
 }
コード例 #10
0
    private void RemoveDoubleTap(InputKeyType keyType)
    {
        if (doubleTaps.Contains(keyType))
        {
            doubleTaps.Remove(keyType);
        }

        if (!upKeys.Contains(keyType))
        {
            upKeys.Add(keyType);
        }
    }
コード例 #11
0
        void SetCustomKey(InputKeyType inputKey, KeyCode key)
        {
            Debug.Log("key changed: " + inputKey.ToString() + " -> " + key.ToString());

            if (!DicKeys.ContainsKey(inputKey))
            {
                DicKeys.Add(inputKey, key);
            }
            else
            {
                DicKeys[inputKey] = key;
            }

            SaveKeys();
        }
コード例 #12
0
        bool KeyIsChanged(InputKeyType inputKey)
        {
            if (Input.anyKey)
            {
                foreach (KeyCode k in PossibleKeys)
                {
                    if (Input.GetKeyDown(KeyCode.Mouse0))
                    {
                        continue;
                    }

                    if (Input.GetKeyDown(k))
                    {
                        SetCustomKey(inputKey, k);
                        return(true);
                    }
                }
            }

            return(false);
        }
コード例 #13
0
        public void OnTargetAction(InputKeyType type)
        {
            switch (type)
            {
            case InputKeyType.KEY_MELEE_ATTACK:
                LastTargetAttackTime = Time.time;
                break;

            case InputKeyType.KEY_EXECUTE_ATTACK:
                LastTargetExecuteTime = Time.time;
                break;

            case InputKeyType.KEY_DODGE:
                LastTargetDodgeTime = Time.time;
                break;

            case InputKeyType.KEY_GUARD:
                LastTargetGuardTime = Time.time;
                break;
            }
        }
コード例 #14
0
ファイル: InputManager.cs プロジェクト: NoeCalmness/CoreFrame
 public InputKey(int _ID = -1, string _key = "", InputKeyType _type = InputKeyType.Down, TouchID _touchID = 0, int _touchIndex = 0, int _delay = 0, int _value = 0, string _name = "", string _desc = "")
 {
     Set(_ID, _key, _type, _touchID, _touchIndex, _delay, _value, _name, _desc);
 }