예제 #1
0
        private IEnumerator DisableActionTemporarilyCoroutine(UnityEngine.InputSystem.InputAction action, float seconds)
        {
            action.Disable();
            Debug.Log("disabled fire");
            yield return(new WaitForSeconds(seconds));

            action.Enable();
            Debug.Log("enabled fire");
        }
예제 #2
0
        /// <param name="config">Input manager configuration asset.</param>
        /// <param name="binding">Binding to trigger input.</param>
        /// <param name="objectTriggers">Objects to trigger input.</param>
        public InputSampler(InputConfiguration config, InputBinding binding, IEnumerable <GameObject> objectTriggers)
        {
            Binding             = binding;
            this.config         = config;
            this.objectTriggers = objectTriggers != null ? new HashSet <GameObject>(objectTriggers) : new HashSet <GameObject>();

            #if ENABLE_INPUT_SYSTEM && INPUT_SYSTEM_AVAILABLE
            if (ObjectUtils.IsValid(config.InputActions))
            {
                inputAction = config.InputActions.FindActionMap("Naninovel")?.FindAction(binding.Name);
            }
            inputAction?.Enable();
            #endif
        }
예제 #3
0
 private void Start()
 {
     UnityEngine.InputSystem.InputAction recordAction = new UnityEngine.InputSystem.InputAction("onRecordPose", binding: $"<Keyboard>/{recordKey}");
     recordAction.Enable();
     recordAction.performed += ctx => RecordPose();
 }
예제 #4
0
 // Move this to a helper gameobject maybe?
 public void DisableActionTemporarily(UnityEngine.InputSystem.InputAction action, float seconds)
 {
     StartCoroutine(DisableActionTemporarilyCoroutine(action, seconds));
 }
예제 #5
0
 public static bool IsValid(this UnityEngine.InputSystem.InputAction action)
 {
     return(action != null && action.bindings.Count > 0);
 }