Ejemplo n.º 1
0
    /// <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;
     }
 }
Ejemplo n.º 3
0
 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;
         }
     }
 }
Ejemplo n.º 6
0
 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");
     }
 }
Ejemplo n.º 7
0
    /// <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);
            }
        }
    }
Ejemplo n.º 8
0
 public void SetControllerAdapter(int player, Controllables myControllable)
 {
     myCA.enabled = true;
 }