/// <summary> /// Triggers on button released /// </summary> /// <param name="other"></param> void OnTriggerExit(Collider other) { if (other.CompareTag("PlayerFeet")) { // Remove them from the list if (m_objectedPressingTheButton.Contains(other.gameObject)) { m_objectedPressingTheButton.Remove(other.gameObject); } if (IsPressed) { // We will only trigger release when there are no other objects // pressing the button (or another of the same type) if (m_objectedPressingTheButton.Count > 0) { return; } AudioManager.Instance.PlaySoundAt(AudioClipName.ButtonOff, transform.position); IsPressed = false; Controllables.ForEach(c => { if (c != null) { c.OnButtonReleased(); } }); } } }
public void EndDialogue(int player, Controllables myControllable) { if (myAdapters[player] != null) { myAdapters[player].enabled = false; } }
public void EndDialogue(int player, Controllables myControllable) { if (myAdapters[player] != null) { myAdapters[player].enabled = false; //Debug.Log("player" + player + " dialogue adapter disabled"); } }
public void SetControls(int player, Controllables target) { //Debug.Log(player + " " + target); onSetControls(player, target); if (target != Controllables.dialogue) { currentPlayControlsRef[player] = target; } }
public void SetControllerAdapter(int player, Controllables myControllable) { if (myAdapters[player] != null) { if (myControllable == Controllables.dialogue) { myAdapters[player].enabled = true; } } }
public void SetControllerAdapter(int player, Controllables myControllable) { if (myAdapters[player] != null) { if (myControllable == Controllables.dialogue) { myAdapters[player].enabled = true; } //Debug.Log("player" + player + " dialogue adapter enabled"); } }
/// <summary> /// Triggers on button pressed /// </summary> /// <param name="other"></param> void OnTriggerEnter(Collider other) { if (other.CompareTag("PlayerFeet")) { // Trigger press if no other one has been pressed if (!IsPressed) { AudioManager.Instance.PlaySoundAt(AudioClipName.ButtonOn, transform.position); IsPressed = true; Controllables.ForEach(c => { if (c != null) { c.OnButtonPressed(); } }); } // Add the new object on the button if (!m_objectedPressingTheButton.Contains(other.gameObject)) { m_objectedPressingTheButton.Add(other.gameObject); } } }
public void SetControllerAdapter(int player, Controllables myControllable) { myCA.enabled = true; }