(client) feat:添加预制件脚本,规范化Dev菜单加载
This commit is contained in:
26
Client/Assets/Scripts/Prefab/ButtonPrefab.cs
Normal file
26
Client/Assets/Scripts/Prefab/ButtonPrefab.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Prefab
|
||||
{
|
||||
public class ButtonPrefab:MonoBehaviour
|
||||
{
|
||||
public Button button;
|
||||
public TMP_Text text;
|
||||
|
||||
public string Label
|
||||
{
|
||||
get{return text.text;}
|
||||
set{text.text = value;}
|
||||
}
|
||||
|
||||
public void AddListener(UnityAction callback)
|
||||
{
|
||||
button.onClick.AddListener(callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user