This commit is contained in:
tangbin
2025-06-22 15:21:25 +08:00
parent 89d395440a
commit 1cb6dc502f
22 changed files with 2241 additions and 7346 deletions

View File

@@ -6,6 +6,7 @@ using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using static MapManager;
public class UIMonsterItem : MonoBehaviour
{
@@ -44,6 +45,19 @@ public class UIMonsterItem : MonoBehaviour
btnClickSelf.onClick.AddListener(OnClickSelf);
btnCopy.onClick.AddListener(OnCopySelf);
btnHide.onClick.AddListener(OnHideSelf);
txtPos.onEndEdit.AddListener(OnEndEditPos);
}
private void OnEndEditPos(string arg0)
{
if (!UtilityClass.IsPosValidFormat(arg0))
{
UIWindow.Instance.ShowMessage("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7>ʽ x,y");
txtPos.text = $"{monster.pos.x},{monster.pos.y}";
return;
}
monster.pos = UtilityClass.GetVector2Pos(arg0);
MapManager.Instance.CreateSpecialPoint(monster.pos.x, monster.pos.y, MapManager.EditCellType.MonsterArea);
}
//public void SetItem(int idx, MonstersConfig.MonsterConfig m)
@@ -70,6 +84,10 @@ public class UIMonsterItem : MonoBehaviour
txtMonsterID.text = monster.id.ToString();
txtName.text = monster.id.ToString();
paths = monster.paths;
txtPos.text = monster.pos.ToString();
//ˢ<>³<EFBFBD><C2B3><EFBFBD><EFBFBD>еĶ<D0B5><C4B6><EFBFBD>
MapManager.Instance.SetMonsterPoint(monster.itemIdx, monster.radius, monster.id, monster.num);
MapManager.Instance.CreateSpecialPoint(monster.pos.x, monster.pos.y, EditCellType.MonsterArea);
}
public void SetGroup(int group)
@@ -118,6 +136,7 @@ public class UIMonsterItem : MonoBehaviour
MapManager.Instance.SetEditCellType(MapManager.EditCellType.MonsterArea);
}
private void OnPathInputFieldClicked(BaseEventData data)
{
UIWindow.Instance.uiMonstersPanel.curActiveInput = data.selectedObject.GetComponent<InputField>();