(client) feat:添加角色定义,为匿名定义建立索引,修复一些数据定义中的错误 (#39)
Co-authored-by: zzdxxz <2079238449@qq.com> Co-committed-by: zzdxxz <2079238449@qq.com>
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
3
Client/Assets/Scripts/Prefab/ButtonPrefab.cs.meta
Normal file
3
Client/Assets/Scripts/Prefab/ButtonPrefab.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 229699c7a1dc4caa84d46e6cfba6a8d8
|
||||
timeCreated: 1752918181
|
17
Client/Assets/Scripts/Prefab/TextPrefab.cs
Normal file
17
Client/Assets/Scripts/Prefab/TextPrefab.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Prefab
|
||||
{
|
||||
public class TextPrefab : MonoBehaviour
|
||||
{
|
||||
public TMP_Text text;
|
||||
|
||||
public string Label
|
||||
{
|
||||
get{return text.text;}
|
||||
set{text.text = value;}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/Prefab/TextPrefab.cs.meta
Normal file
3
Client/Assets/Scripts/Prefab/TextPrefab.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 13c16a6a94284487838eb5c60f53ed0d
|
||||
timeCreated: 1752918417
|
Reference in New Issue
Block a user