Example #1
0
    private void DodgeInput(KeyInputType inputType)
    {
        if (inputType != KeyInputType.Down)
        {
            return;
        }

        dodged = true;
        this.Invoke(ResetDodge, 0.05f);
    }
Example #2
0
 public void setKeyInputType(KeyInputType inputType)
 {
     this.inputType = inputType;
 }
Example #3
0
 public KeyModifierEntry(string name, KeyConfigPanel owner, KeyInputType inputType)
     : base(name, 0, 0)
 {
     this.owner = owner;
     this.inputType = inputType;
 }
Example #4
0
 /// <summary>
 /// 如果await的时候条件满足,会立即返回并同步执行后面的代码
 /// </summary>
 public KeyInput(KeyCode code, KeyInputType type)
 {
     _keycode = code;
     _type    = type;
 }
Example #5
0
 public KeyInputAwait(KeyCode keyCode, KeyInputType type)
 {
     _keycode = keyCode;
     _type    = type;
 }
Example #6
0
 /// <summary>
 /// Create new instance
 /// </summary>
 /// <param name="KeyInfo">Key info from input</param>
 /// <param name="InputType">Input action</param>
 public OperatorInputEventArg(ConsoleKeyInfo KeyInfo, KeyInputType InputType)
 {
     this.KeyInfo   = KeyInfo;
     this.InputType = InputType;
 }
Example #7
0
 /// <summary>
 /// Returns the current Key mapped to this KeyInputType
 /// </summary>
 public static Keys getKeyControl(KeyInputType inputType)
 {
     nullCheck();
     return keyTypes[(int)inputType];
 }
Example #8
0
 /// <summary>
 /// Change the key input needed to trigger a given game function; used for 
 /// customizing key controls
 /// </summary>
 /// <param name="inputType">The game function</param>
 /// <param name="key">The new key to press</param>
 public static void changeKeyControl(KeyInputType inputType, Keys key)
 {
     nullCheck();
     keyTypes[(int)inputType] = key;
 }
Example #9
0
 /// <summary>
 /// A check for whether the given key is already registered with a certain
 /// type of input. Called when customizing key controls
 /// </summary>
 /// <param name="key">The possible key to shift the input type to</param>
 /// <param name="exclude">Input type to exclude (i.e. the input being considered)</param>
 /// <returns>True if another input type uses the key, false otherwise</returns>
 public static bool keyControlExists(Keys key, KeyInputType exclude)
 {
     for (int i = 0; i < keyTypes.Length; i++)
     {
         if ((int)exclude == i) continue;
         if (keyTypes[i] == key) return true;
     }
     return false;
 }
Example #10
0
 private void ReloadInput(KeyInputType inputType)
 {
     currentFireMode.Reload();
 }
Example #11
0
 private void ShootInput(KeyInputType inputType)
 {
     currentFireMode.Shoot(currentWeapon, weaponBarrel, damageLayer, gameObject.layer, inputType, ammoUI);
 }
Example #12
0
    public void Shoot(WeaponSettings weaponSettings, Transform weaponBarrel, LayerMask damageLayer, LayerMask firedByLayer, KeyInputType inputType, AmmoUI ammoUI)
    {
        switch (inputType)
        {
        case KeyInputType.Down:
            OnInputDown(weaponSettings, weaponBarrel, damageLayer, firedByLayer, ammoUI);
            break;

        case KeyInputType.Held:
            OnInputHeld(weaponSettings, weaponBarrel, damageLayer, firedByLayer, ammoUI);
            break;

        case KeyInputType.Up:
            OnInputUp(weaponSettings);
            break;

        default:
            break;
        }
    }