Project_WL/Assets/Script/Map/FieldBossData.cs

32 lines
1.1 KiB
C#
Raw Normal View History

2024-12-15 01:39:39 +00:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FieldBossData : MyCoroutine
{
public int n_MonsterID, n_SpawnerId;
MobActor m_FieldBoss;
private void Start()
{
// 필드 몬스터 생성
var fieldbossdata = table_monsterlist.Ins.Get_Data_orNull(n_MonsterID);
AddrResourceMgr.Ins.LoadObject<GameObject>(fieldbossdata.s_MonsterPrefab, handle =>
{
m_FieldBoss = DSUtil.Get_Clone<MobActor>(handle.Result, transform);
AddrResourceMgr.Ins.Set_AddressableReleaseSelf(m_FieldBoss.gameObject);
m_FieldBoss.Set(true, null, null, n_SpawnerId, false);
m_FieldBoss.Set(eRole.Boss, fieldbossdata, transform.position, AfterDie, -1);
m_FieldBoss.m_SubRole = eSubRol.None;
m_FieldBoss.MagicID = 0;
ActorInfo.Ins.Add_Actor(m_FieldBoss, eRole.Boss, n_SpawnerId, fieldbossdata.s_MonsterPrefab);
});
}
private void AfterDie(int obj)
{
Set_Coroutine(m_FieldBoss.On_Regen, 10f);
}
}