彻底换一下

This commit is contained in:
tangbin
2025-07-18 22:28:40 +08:00
parent 66ed22e5e5
commit 95aec74d37
2275 changed files with 3034 additions and 140925 deletions

View File

@@ -2,13 +2,15 @@ using HxGame.Data;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using static HxGame.Data.MonstersConfig;
using static MapManager;
public class UIMonsterItem : MonoBehaviour
public class UIMonsterItem : UIBaseItem
{
public delegate void ClickItemEvent(UIMonsterItem item);
public ClickItemEvent OnClick;
@@ -57,31 +59,36 @@ public class UIMonsterItem : MonoBehaviour
return;
}
monster.pos = UtilityClass.GetVector2Pos(arg0);
MapManager.Instance.CreateSpecialPoint(monster.pos.x, monster.pos.y, MapManager.EditCellType.MonsterArea);
MapManager.Instance.CreateSpecialPoint(monster.pos, this);
}
//public void SetItem(int idx, MonstersConfig.MonsterConfig m)
public void SetItem(MonstersConfig.MonsterConfig m)
{
//itemIdx = idx;
txtID.text = m.itemIdx.ToString();
txtMonsterID.text = m.id.ToString();
txtName.text = m.id.ToString();
txtPos.text = m.pos.ToString();
paths = m.paths;
monster = m;
txtID.gameObject.SetActive(m.itemIdx != -1);
if (m.groupId > 0)
return;
MapManager.Instance.SetMonsterPoint(m.itemIdx, monster.radius, monster.id, monster.num);
MapManager.Instance.CreateSpecialPoint(monster.pos.x, monster.pos.y, MapManager.EditCellType.MonsterArea);
MapManager.Instance.SetCurMonsterPathIdx(pathIdx);
MapManager.Instance.CreateSpecialPoint(monster.pos, this);
}
public void RefreshPos(Vector2Int newPos)
internal override void SetSelectPosItem()
{
monster.pos = newPos;
txtPos.text = newPos.ToString() ;
base.SetSelectPosItem();
btnClickSelf.Select();
UIWindow.Instance.uiMonstersPanel.OnClickItem(this);
}
public override void SetItemPos(Vector2Int pos)
{
base.SetItemPos(pos);
monster.pos = pos;
txtPos.text = pos.ToString();
btnClickSelf.Select();
}
public void RefreshItem()
{
@@ -91,7 +98,7 @@ public class UIMonsterItem : MonoBehaviour
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);
MapManager.Instance.CreateSpecialPoint(monster.pos, this);
}
public void SetGroup(int group)
@@ -145,14 +152,28 @@ public class UIMonsterItem : MonoBehaviour
{
UIWindow.Instance.uiMonstersPanel.curActiveInput = data.selectedObject.GetComponent<InputField>();
UIWindow.Instance.uiMonstersPanel.curActiveList = paths;
MapManager.Instance.SetCurMonsterPathIdx(pathIdx);
MapManager.Instance.SetEditCellType(MapManager.EditCellType.MonsterPath);
}
private void RemoveSelf()
{
DestroyImmediate(transform.parent.gameObject);
MapManager.Instance.RemoveMonsterPoint(monster.itemIdx);
UIWindow.Instance.uiMonstersPanel.monstersConfig.monsterConfigs.Remove(monster);
if (monster.itemIdx != -1)
{
UIWindow.Instance.uiMonstersPanel.RemoveAllGrop(monster);
}
}
public void DestoryGrop()
{
if (monster.itemIdx != -1) return;
UIWindow.Instance.uiMonstersPanel.monstersConfig.monsterConfigs.Remove(monster);
DestroyImmediate(transform.parent.gameObject);
}
private void OnDestroy()
{
if (sceneArea == null) return;
DestroyImmediate(sceneArea.gameObject);
}
public bool CheckValid()
@@ -242,8 +263,6 @@ public class UIMonsterItem : MonoBehaviour
{
if (OnCopyItem == null)
return;
//OnCopyItem(monster);
OnCopyItem(this);
}