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"); }
/// <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 }
private void Start() { UnityEngine.InputSystem.InputAction recordAction = new UnityEngine.InputSystem.InputAction("onRecordPose", binding: $"<Keyboard>/{recordKey}"); recordAction.Enable(); recordAction.performed += ctx => RecordPose(); }
private void OnEnable() { toggleAction.Enable(); }