38 lines
860 B
C#
38 lines
860 B
C#
using System;
|
|
using Sirenix.OdinInspector;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
namespace UnityTest.ZXL
|
|
{
|
|
public class ObjectLabel : Label
|
|
{
|
|
public ObjectLabelType labelType;
|
|
|
|
// private void Update()
|
|
// {
|
|
// var currentTransform = Camera.current.transform;
|
|
// transform.LookAt(currentTransform);
|
|
// }
|
|
|
|
#if UNITY_EDITOR
|
|
[SerializeField]
|
|
private bool isTrue;
|
|
[ShowIf("isTrue")]
|
|
[Button]
|
|
void Add()
|
|
{
|
|
var label = transform.Find("label");
|
|
var textMeshProUGUI = label.GetComponent<TextMeshProUGUI>();
|
|
// labelType = Enum.Parse<ObjectLabelType>(transform.name);
|
|
textMeshProUGUI.text = labelType.ToString();
|
|
}
|
|
#endif
|
|
}
|
|
|
|
public enum ObjectLabelType
|
|
{
|
|
None,
|
|
湿毛巾,
|
|
}
|
|
} |