private void InputAction_canceled(InputAction.CallbackContext obj)
        {
            // could be faster if it didn't have to search a dictionary?
            UnityInputSystemAction action = ActionDictionary[obj.action];

            action.SetValue(obj.action.ReadValueAsObject());

            action.FireCancelEvent();
        }
        private void Inputaction_performed(InputAction.CallbackContext obj)
        {
            // could be faster if it didn't have to search a dictionary?
            UnityInputSystemAction action = ActionDictionary[obj.action];

            action.SetValue(obj.action.ReadValueAsObject());

            // Fire Event on UnityAction
            action.FirePerformedEvent();
        }
示例#3
0
        public void FireStartedEvent()
        {
            //create copy of action so it can't change while handling event
            var action = new UnityInputSystemAction(this.name);

            action.Started = true;
            action.SetValue(value);

            foreach (var del in sortedDelegates)
            {
                if (del.Started == true)
                {
                    del.Invoke(action);
                }
            }
        }