using System.Collections.Generic; using UnityEngine; public class TestMapUIMgr : MonoBehaviourSingletonTemplate { 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 list_MobActor = new List(); Vector3 MobPos = new Vector3(45, 0, 45); 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); // #763 — 펫이 없을 수 있다(펫 미보유 계정 · WLGameplaySettings.spawnPlayerPet = false) var pet = MyValue.MyPC.Get_MyPet(); if (!DSUtil.CheckNull(pet)) pet.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(mobData.s_MonsterPrefab, handle => { for (int i = 0; i < m_TM_MonsterSet.Get_MobCount(); i++) { var ma = DSUtil.Get_Clone(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(); }); } }