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; } }
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; } }
/* * public bool CheckInTransitionBetweenSameClips(Animator animator) * { * * } */ public void SendOnActionMessage(InputKeyType type) { if (OnAction != null) { OnAction(type); } }
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(); }
public InputKeyState(int keyGroup, int keyCode, InputKeyType keyType, bool disabled) { KeyGroup = keyGroup; KeyCode = keyCode; KeyType = keyType; IsDisabled = disabled; TimePressed = -1; Callbacks = new HashSet<InputKeyCallback>(); }
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; }
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; }
void RemoveDoubleTap(InputKeyType keyType) { if (DoubleTaps.Contains(keyType)) { DoubleTaps.Remove(keyType); } if (!UpKeys.Contains(keyType)) { UpKeys.Add(keyType); } }
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(); }
private void RemoveDoubleTap(InputKeyType keyType) { if (doubleTaps.Contains(keyType)) { doubleTaps.Remove(keyType); } if (!upKeys.Contains(keyType)) { upKeys.Add(keyType); } }
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(); }
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); }
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; } }
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); }