第一次提交

This commit is contained in:
tangbin
2025-06-14 13:46:24 +08:00
commit 1f3323e115
3765 changed files with 3447853 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UISafeAreasPanel : MonoBehaviour
{
[HideInInspector]
public InputField curActiveInput;
public Transform itemParent;
public Button btnAdd;
// Start is called before the first frame update
void Start()
{
btnAdd.onClick.AddListener(AddItem);
}
void AddItem()
{
Object obj = Resources.Load("Prefabs/safeAreaItem");
if (obj == null)
{
UIWindow.Instance.ShowMessage("safeAreaItem.prefabʧ<62><CAA7>");
return;
}
GameObject go = Instantiate(obj) as GameObject; ;
go.transform.SetParent(itemParent, false);
UISafeAreaItem item = go.GetComponent<UISafeAreaItem>();
item.itemIdx = itemParent.childCount;
}
public void AddItem(Vector2Int pos, int radius)
{
Object obj = Resources.Load("Prefabs/safeAreaItem");
if (obj == null)
{
UIWindow.Instance.ShowMessage("safeAreaItem.prefabʧ<62><CAA7>");
return;
}
GameObject go = Instantiate(obj) as GameObject; ;
go.transform.SetParent(itemParent, false);
UISafeAreaItem item = go.GetComponent<UISafeAreaItem>();
item.itemIdx = itemParent.childCount;
//MapManager.Instance.SetCurSafeCenterPoint(item.itemIdx, radius);
item.txtPos.text = $"{pos.x},{pos.y}";
item.txtRadius.text = radius.ToString();
//MapManager.Instance.CreateSpecialPoint(pos.x, pos.y, MapManager.EditCellType.SafeArea);
}
}