Example #1
0
 public InputAction(string name, InputItem.InputType type, float value, float lastValue)
 {
     Name      = name;
     Type      = type;
     Value     = value;
     LastValue = lastValue;
 }
Example #2
0
        private bool IsValidInput(int action, InputItem.InputType type)
        {
            if (!inputsDic.ContainsKey(action))
            {
                Debug.LogError($"There's no input action called '{action}' on '{gameObject.name}'.", gameObject);
                return(false);
            }

            if (inputsDic[action].Type != type)
            {
                Debug.LogError($"Input action '{action}' is a {inputsDic[action].Type} but should be a {type}.");
                return(false);
            }

            return(true);
        }
Example #3
0
        private bool IsValidInput(string action, InputItem.InputType type)
        {
            if (!inputsDic.ContainsKey(action))
            {
                Debug.LogError("There's no input action called '" + action + "' on '" + gameObject.name + "'.", gameObject);
                return(false);
            }

            if (inputsDic[action].Type != type)
            {
                Debug.LogError("Input action '" + action + "' is a " + inputsDic[action].Type + " but should be a " + type + ".");
                return(false);
            }

            return(true);
        }