Project_WL/Assets/Script/UI/TestMap/TestMapUIMgr.cs

77 lines
2.4 KiB
C#
Raw Normal View History

2025-05-05 04:07:34 +00:00
using System.Collections.Generic;
2025-04-02 01:16:20 +00:00
using UnityEngine;
public class TestMapUIMgr : MonoBehaviourSingletonTemplate<TestMapUIMgr>
{
public GameObject[] gos; // 0 캐릭터 설정, 1 몬스터 설정
2025-04-02 23:29:27 +00:00
public TM_Skills m_TM_Skills;
2025-04-02 04:15:38 +00:00
public TM_ClassChange m_TM_ClassChange;
public TM_MonsterSet m_TM_MonsterSet;
public GameObject[] gos_other; // 0 펫 체크
2025-04-02 01:16:20 +00:00
2025-05-05 04:07:34 +00:00
List<MobActor> list_MobActor = new List<MobActor>();
2025-04-03 23:12:48 +00:00
Vector3 MobPos = new Vector3(15, 0, 20);
bool ShowPet = true;
2025-04-03 23:12:48 +00:00
2025-04-02 01:16:20 +00:00
private void Start() { Set_TestBtns(false); }
public void Set_TestBtns(bool active)
{
for (int i = 0; i < gos.Length; i++)
gos[i].SetActive(active);
if (active) Set_Pet();
2025-04-02 01:16:20 +00:00
}
public void OnClick_Button(int button)
{
switch (button)
{
case 0: // 캐릭터 설정
2025-04-02 04:15:38 +00:00
m_TM_ClassChange.Set();
2025-04-02 01:16:20 +00:00
break;
case 1: // 몬스터 설정
m_TM_MonsterSet.Set();
2025-04-02 01:16:20 +00:00
break;
case 2: // 펫 on/off
ShowPet = !ShowPet;
Set_Pet();
break;
2025-04-02 01:16:20 +00:00
}
}
2025-04-03 23:12:48 +00:00
void Set_Pet()
{
gos_other[0].SetActive(ShowPet);
MyValue.MyPC.Get_MyPet().gameObject.SetActive(ShowPet);
}
2025-04-03 23:12:48 +00:00
public void MakeMob(MonsterTableData mobData)
{
2025-05-05 04:07:34 +00:00
if (list_MobActor.Count > 0)
2025-04-03 23:12:48 +00:00
{
ActorInfo.Ins.Destroy_Mob();
ActorInfo.Ins.All_DelTarget();
2025-05-05 04:07:34 +00:00
list_MobActor.Clear();
2025-04-03 23:12:48 +00:00
}
AddrResourceMgr.Ins.LoadObject<GameObject>(mobData.s_MonsterPrefab, handle =>
{
2025-05-05 04:07:34 +00:00
for (int i = 0; i < m_TM_MonsterSet.Get_MobCount(); i++)
{
var ma = DSUtil.Get_Clone<MobActor>(handle.Result);
AddrResourceMgr.Ins.Set_AddressableReleaseSelf(ma.gameObject);
ActorInfo.Ins.Add_Actor(ma, eRole.Mob, m_TM_MonsterSet.Get_SpawnID(), mobData.s_MonsterPrefab);
2025-04-03 23:12:48 +00:00
2025-05-05 04:07:34 +00:00
ma.Set(true, null, null, m_TM_MonsterSet.Get_SpawnID(), false);
ma.Set(mobData,
DSUtil.RandomVector_Exception_y(MobPos.x - 1f, MobPos.x + 1f, 0f, MobPos.z - 1f, MobPos.z + 1f),
null, 0);
ma.MagicID = 0;
list_MobActor.Add(ma);
}
2025-04-03 23:12:48 +00:00
ToastUI.Ins.Set(174, "스폰 아이디 : " + m_TM_MonsterSet.Get_SpawnID());
m_TM_MonsterSet.OnClick_Back();
});
}
2025-04-02 01:16:20 +00:00
}