Answers for "how to get the name of the button pressed in unity"

C#
2

how to get the name of the button pressed in unity

//this is Unity pared with C#

using UnityEngine.EventSystems;

public class Class : Monobehaviour
{
	//Call this function when the button is pressed
    public void ButtonClicked()
    {
    	string name = EventSystem.current.currentSelectedGameObject.name;
    }
}
Posted by: Guest on September-11-2020

Code answers related to "how to get the name of the button pressed in unity"

C# Answers by Framework

Browse Popular Code Answers by Language