コード例 #1
0
    // Leaves button
    void OnTriggerExit(Collider other)
    {
        // Find what its touching
        IInteractibleButton collidedButton = other.GetComponent <IInteractibleButton>();

        // If its a button
        if (collidedButton != null)
        {
            // Set the color to be un-highlighted
            collidedButton.HighLight(false);
            // Remove the button from the list
            collidedButtons.Remove(collidedButton);
        }

        // Emote button list
        EmoteSelectionButton emoteButton = other.GetComponent <EmoteSelectionButton>();

        // If its a button
        if (emoteButton != null)
        {
            // Highlight it
            emoteButton.HighLight(false);
            // Add the button to the list
            emoteButtons.Remove(emoteButton);
        }
    }
コード例 #2
0
    //// Enters button
    void OnTriggerStay(Collider other)
    {
        // Find what its touching
        IInteractibleButton collidedButton = other.GetComponent <IInteractibleButton>();

        // If its a button
        if (collidedButton != null)
        {
            // Highlight it
            collidedButton.HighLight(true);
            // Add the button to the list
            if (collidedButtons.Contains(collidedButton) == false)
            {
                collidedButtons.Add(collidedButton);
            }
        }


        // Emote button list
        EmoteSelectionButton emoteButton = other.GetComponent <EmoteSelectionButton>();

        // If its a button
        if (emoteButton != null)
        {
            // Highlight it
            emoteButton.HighLight(true);
            // Add the button to the list
            if (emoteButtons.Contains(emoteButton) == false)
            {
                emoteButtons.Add(emoteButton);
            }
        }
    }