添加
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
/*
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
|
||||
@@ -51,6 +52,50 @@ public class UIMonsterPanel : MonoBehaviour
|
||||
btnClose.onClick.AddListener(OnClickClose);
|
||||
btnAddGroup.onClick.AddListener(OnAddGroup);
|
||||
btnDeleteGroup.onClick.AddListener(OnDeleteGroup);
|
||||
txtMonsterID.onEndEdit.AddListener(OnEditorMonsterId);
|
||||
txtName.onEndEdit.AddListener(OnEditorMonsterName);
|
||||
txtRadius.onEndEdit.AddListener(OnEditorMonsterRadius);
|
||||
txtCount.onEndEdit.AddListener(OnEditorMonsterCount);
|
||||
}
|
||||
|
||||
private void OnEditorMonsterCount(string arg0)
|
||||
{
|
||||
if (!int.TryParse(arg0, out var intValue))
|
||||
{
|
||||
UIWindow.Instance.ShowMessage("<22><>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>ȷ");
|
||||
return;
|
||||
}
|
||||
_curMonsterItem.monster.id = intValue;
|
||||
_curMonsterItem.RefreshItem();
|
||||
}
|
||||
|
||||
private void OnEditorMonsterRadius(string arg0)
|
||||
{
|
||||
if (!int.TryParse(arg0, out var intValue))
|
||||
{
|
||||
UIWindow.Instance.ShowMessage("<22><>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>ȷ");
|
||||
return;
|
||||
}
|
||||
_curMonsterItem.monster.radius = intValue;
|
||||
_curMonsterItem.RefreshItem();
|
||||
}
|
||||
|
||||
private void OnEditorMonsterName(string arg0)
|
||||
{
|
||||
if (_curMonsterItem == null) return;
|
||||
_curMonsterItem.RefreshItem();
|
||||
}
|
||||
|
||||
private void OnEditorMonsterId(string arg0)
|
||||
{
|
||||
if (_curMonsterItem == null) return;
|
||||
if (!int.TryParse(arg0, out var intValue))
|
||||
{
|
||||
UIWindow.Instance.ShowMessage("<22><>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>ȷ");
|
||||
return;
|
||||
}
|
||||
_curMonsterItem.monster.id = intValue;
|
||||
_curMonsterItem.RefreshItem();
|
||||
}
|
||||
|
||||
private void OnClickClose()
|
||||
@@ -159,6 +204,10 @@ public class UIMonsterPanel : MonoBehaviour
|
||||
|
||||
MonstersConfig.MonsterConfig monster = new MonstersConfig.MonsterConfig();
|
||||
monster.itemIdx = ++itemIdx;
|
||||
monster.radius = 1;
|
||||
monster.id = 0;
|
||||
monster.num = 0;
|
||||
monster.pos = MapManager.Instance.map.selector.getMapGrid(Camera.main.transform.position);
|
||||
item.SetItem(monster);
|
||||
item.OnClick = OnClickItem;
|
||||
item.OnCopyItem = OnCopyItem;
|
||||
|
||||
Reference in New Issue
Block a user