78 lines
2.4 KiB
C#
78 lines
2.4 KiB
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class TestMapUIMgr : MonoBehaviourSingletonTemplate<TestMapUIMgr>
|
|
{
|
|
public GameObject[] gos; // 0 캐릭터 설정, 1 몬스터 설정
|
|
public TM_Skills m_TM_Skills;
|
|
public TM_ClassChange m_TM_ClassChange;
|
|
public TM_MonsterSet m_TM_MonsterSet;
|
|
public GameObject[] gos_other; // 0 펫 체크
|
|
|
|
List<MobActor> list_MobActor = new List<MobActor>();
|
|
Vector3 MobPos = new Vector3(15, 0, 20);
|
|
bool ShowPet = true;
|
|
|
|
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();
|
|
}
|
|
|
|
public void OnClick_Button(int button)
|
|
{
|
|
switch (button)
|
|
{
|
|
case 0: // 캐릭터 설정
|
|
m_TM_ClassChange.Set();
|
|
break;
|
|
case 1: // 몬스터 설정
|
|
m_TM_MonsterSet.Set();
|
|
break;
|
|
case 2: // 펫 on/off
|
|
ShowPet = !ShowPet;
|
|
Set_Pet();
|
|
break;
|
|
}
|
|
}
|
|
|
|
void Set_Pet()
|
|
{
|
|
gos_other[0].SetActive(ShowPet);
|
|
MyValue.MyPC.Get_MyPet().gameObject.SetActive(ShowPet);
|
|
}
|
|
|
|
public void MakeMob(MonsterTableData mobData)
|
|
{
|
|
if (list_MobActor.Count > 0)
|
|
{
|
|
ActorInfo.Ins.Destroy_Mob();
|
|
ActorInfo.Ins.All_DelTarget();
|
|
list_MobActor.Clear();
|
|
}
|
|
AddrResourceMgr.Ins.LoadObject<GameObject>(mobData.s_MonsterPrefab, handle =>
|
|
{
|
|
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);
|
|
|
|
ma.Set(true, null, null, m_TM_MonsterSet.Get_SpawnID(), false);
|
|
ma.Set(mobData,
|
|
DSUtil.RandomVector_Exception_y(MobPos.x - 3f, MobPos.x + 3f, 0f, MobPos.z - 3f, MobPos.z + 3f),
|
|
null, 0);
|
|
ma.On_Regen();
|
|
ma.MagicID = 0;
|
|
|
|
list_MobActor.Add(ma);
|
|
}
|
|
|
|
ToastUI.Ins.Set(174, "스폰 아이디 : " + m_TM_MonsterSet.Get_SpawnID());
|
|
m_TM_MonsterSet.OnClick_Back();
|
|
});
|
|
}
|
|
} |