UIButton.OnHover C# (CSharp) Method

OnHover() public method

public OnHover ( bool isOver ) : void
isOver bool
return void
	public override void OnHover (bool isOver) { if (isEnabled) base.OnHover(isOver); }
	public override void OnPress (bool isPressed) { if (isEnabled) base.OnPress(isPressed); }

Usage Example

    void DetectPosition(int number) // This makes the buttons on the main menu change color when the player hover over them
    {
        int one = 1, two = 2;

        if (number != previousPosition)
        {
            if (number == zero)
            {
                gallery.OnHover(false);
                play.OnHover(false);
                quit.OnHover(true);
            }
            else if (number == one)
            {
                quit.OnHover(false);
                play.OnHover(false);
                gallery.OnHover(true);
            }
            else if (number == two)
            {
                quit.OnHover(false);
                gallery.OnHover(false);
                play.OnHover(true);
            }

            //Plays hover SFX
            AudioController.Play("UI_ButtonHover");
        }
    }
All Usage Examples Of UIButton::OnHover