2024-05-12 04:02:49 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using BlueWaterProject;
|
|
|
|
using Sirenix.OdinInspector;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
|
|
public class BossMapController : MonoBehaviour
|
|
|
|
{
|
|
|
|
/// 컴포넌트
|
|
|
|
[Title("컴포넌트")]
|
2024-05-12 08:41:13 +00:00
|
|
|
[SerializeField, Required] protected Transform playerSpawnTransform;
|
|
|
|
[SerializeField, Required] protected Transform bossSpawnTransform;
|
|
|
|
[SerializeField, Required] protected Transform bossInstantiateTransform;
|
|
|
|
[SerializeField, Required] protected GameObject bossPrefab;
|
2024-05-12 04:02:49 +00:00
|
|
|
[field: SerializeField] public Transform ParticleInstantiateLocation { get; private set; }
|
|
|
|
|
|
|
|
protected List<GameObject> bossInstanceList = new(10);
|
|
|
|
|
|
|
|
public virtual void InitBossMap()
|
|
|
|
{
|
|
|
|
AllDestroyObjects();
|
|
|
|
bossInstanceList = new List<GameObject>(10);
|
2024-05-12 08:41:13 +00:00
|
|
|
|
|
|
|
if (GameManager.Inst)
|
2024-05-12 04:02:49 +00:00
|
|
|
{
|
2024-05-12 08:41:13 +00:00
|
|
|
var player = GameManager.Inst.CurrentCombatPlayer;
|
|
|
|
if (player)
|
|
|
|
{
|
|
|
|
Destroy(player.gameObject);
|
|
|
|
}
|
|
|
|
|
|
|
|
GameManager.Inst.InstantiateCombatPlayer(playerSpawnTransform.position);
|
2024-05-12 04:02:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 보스 override로 추가
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void AllDestroyBoss()
|
|
|
|
{
|
|
|
|
foreach (var element in bossInstanceList)
|
|
|
|
{
|
|
|
|
Destroy(element);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void AllDestroyObjects()
|
|
|
|
{
|
|
|
|
foreach (var element in bossInstanceList)
|
|
|
|
{
|
|
|
|
Destroy(element);
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach (Transform element in ParticleInstantiateLocation)
|
|
|
|
{
|
|
|
|
Destroy(element.gameObject);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|