55 lines
1.5 KiB
C#
55 lines
1.5 KiB
C#
using System.Collections.Generic;
|
|
using BlueWaterProject;
|
|
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
public class BossMapController : MonoBehaviour
|
|
{
|
|
/// 컴포넌트
|
|
[Title("컴포넌트")]
|
|
[SerializeField] protected Transform playerSpawnTransform;
|
|
[SerializeField] protected Transform bossSpawnTransform;
|
|
[SerializeField] protected Transform bossInstantiateTransform;
|
|
[SerializeField] protected GameObject bossPrefab;
|
|
[field: SerializeField] public Transform ParticleInstantiateLocation { get; private set; }
|
|
|
|
protected List<GameObject> bossInstanceList = new(10);
|
|
|
|
public virtual void InitBossMap()
|
|
{
|
|
DataManager.Inst.CurrentSaveStage = SaveStage.SLIME;
|
|
AllDestroyObjects();
|
|
bossInstanceList = new List<GameObject>(10);
|
|
|
|
var player = GameObject.FindWithTag("CombatPlayer");
|
|
if (player && playerSpawnTransform)
|
|
{
|
|
player.transform.position = playerSpawnTransform.position;
|
|
}
|
|
|
|
// 보스 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);
|
|
}
|
|
}
|
|
} |