完善编辑器

This commit is contained in:
tangbin
2025-07-19 12:48:11 +08:00
parent 2df2efaa3e
commit b8b50ec90b
27 changed files with 360 additions and 124 deletions

View File

@@ -16,11 +16,12 @@ public class UINpcItem : UIBaseItem
public Button btnDel; //ɾ<><C9BE>
public List<string> paths;
public int itemIdx;
public int pathIdx;
// Start is called before the first frame update
void Awake()
{
public int pathIdx;
// Start is called before the first frame update
protected override void Awake()
{
base.Awake();
AddInputNameClickEvent(txtPos);
AddInputNameClickEvent(txtPath, true);
btnDel.onClick.AddListener(RemoveSelf);
@@ -65,17 +66,18 @@ public class UINpcItem : UIBaseItem
{
base.SetItemPos(pos);
txtPos.text = pos.ToString();
}
private void OnDestroy()
{
if (sceneArea == null) return;
DestroyImmediate(sceneArea.gameObject);
}
private void RemoveSelf()
{
DestroyImmediate(gameObject);
}
private void OnDestroy()
{
if (sceneArea == null) return;
DestroyImmediate(sceneArea.gameObject);
}
public bool CheckValid()
{
if (string.IsNullOrEmpty(txtID.text))