京城游戏人-Day13: 获取被点击的 Button 以及其上的文字内容
-
-
获取被点击的 button:
var button = UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject
获取 button 上的文字内容:
Debug.Log(button.GetComponentInChildren<Text>().text);
-
-
-
-
获取被点击的 button:
var button = UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject
获取 button 上的文字内容:
Debug.Log(button.GetComponentInChildren<Text>().text);
-
-