Ejemplo n.º 1
0
 /// <summary>
 /// Stop listening for events from the player action map
 /// </summary>
 public void StopListeningForActions()
 {
     // Remove the listener for the currently required action
     for (int i = 0; i < playerInputs.Count; i++)
     {
         int deviceId = playerInputs[i].devices.FirstOrDefault().deviceId;
         ActionTriggeredEvent actionListenerEvent = new ActionTriggeredEvent(deviceId, requiredActions[currentAction].actionName, playerInputs[i].currentActionMap);
         actionListenerEvent.RemoveListener(CompleteAction);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Listen for events from the player action map
 /// </summary>
 public void ListenForActions()
 {
     // hide player checkmarks
     foreach (Animator animator in playerCheckmarkAnims)
     {
         animator.SetBool("isChecked", false);
         animator.gameObject.SetActive(false);
     }
     EnableOverlay();
     requiredActions[currentAction].actionImage.enabled = true;
     // Listen for the currently required action being triggered on each player's input
     for (int i = 0; i < playerInputs.Count; i++)
     {
         int deviceId = playerInputs[i].devices.FirstOrDefault().deviceId;
         ActionTriggeredEvent actionListenerEvent = new ActionTriggeredEvent(deviceId, requiredActions[currentAction].actionName, playerInputs[i].currentActionMap);
         actionListenerEvent.AddListener(CompleteAction);
     }
 }