2024-06-03 18:26:03 +00:00
|
|
|
|
using System.Collections;
|
2024-06-13 16:46:37 +00:00
|
|
|
|
using BlueWater.Audios;
|
|
|
|
|
using BlueWater.Enemies;
|
|
|
|
|
using BlueWater.Enemies.Bosses;
|
2024-06-03 18:26:03 +00:00
|
|
|
|
using BlueWater.Uis;
|
|
|
|
|
using Sirenix.OdinInspector;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace BlueWater.Maps
|
|
|
|
|
{
|
2024-06-13 16:46:37 +00:00
|
|
|
|
public class BossMapController : MapController
|
2024-06-03 18:26:03 +00:00
|
|
|
|
{
|
|
|
|
|
[SerializeField, Required]
|
|
|
|
|
protected Transform BossSpawnTransform;
|
|
|
|
|
|
2024-06-13 16:46:37 +00:00
|
|
|
|
[SerializeField]
|
|
|
|
|
protected BossType BossType;
|
|
|
|
|
|
2024-06-03 18:26:03 +00:00
|
|
|
|
public override void InitializeMap()
|
|
|
|
|
{
|
|
|
|
|
AllDestroyObjects();
|
|
|
|
|
|
|
|
|
|
if (GameManager.Instance)
|
|
|
|
|
{
|
|
|
|
|
var player = GameManager.Instance.CurrentCombatPlayer;
|
|
|
|
|
if (player)
|
|
|
|
|
{
|
|
|
|
|
Destroy(player.gameObject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GameManager.Instance.InstantiateCombatPlayer(PlayerSpawnTransform.position);
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-13 16:46:37 +00:00
|
|
|
|
DataManager.Instance.CurrentSaveStage = SaveStage;
|
|
|
|
|
if (!string.IsNullOrEmpty(BGMName))
|
|
|
|
|
{
|
|
|
|
|
AudioManager.Instance.PlayBgm(BGMName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InitializeBoss();
|
2024-06-03 18:26:03 +00:00
|
|
|
|
// 보스 override로 추가
|
|
|
|
|
}
|
2024-06-13 16:46:37 +00:00
|
|
|
|
|
|
|
|
|
protected virtual void InitializeBoss()
|
|
|
|
|
{
|
|
|
|
|
EnemyManager.Instance.InstantiateBoss(BossType, BossSpawnTransform.position, EnemyInstantiateLocation);
|
|
|
|
|
}
|
2024-06-03 18:26:03 +00:00
|
|
|
|
|
|
|
|
|
public override void MapClear()
|
|
|
|
|
{
|
|
|
|
|
StartCoroutine(nameof(MapClearCoroutine));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected virtual IEnumerator MapClearCoroutine()
|
|
|
|
|
{
|
|
|
|
|
VisualFeedbackManager.Instance.SetBaseTimeScale(0.1f);
|
|
|
|
|
CombatUiManager.Instance.FadeInOut();
|
|
|
|
|
|
|
|
|
|
var elapsedTime = 0f;
|
|
|
|
|
while (elapsedTime <= 3f)
|
|
|
|
|
{
|
|
|
|
|
elapsedTime += Time.unscaledDeltaTime;
|
|
|
|
|
yield return null;
|
|
|
|
|
}
|
|
|
|
|
AllDestroyEnemy();
|
|
|
|
|
VisualFeedbackManager.Instance.SetBaseTimeScale(1f);
|
|
|
|
|
|
|
|
|
|
elapsedTime = 0f;
|
|
|
|
|
while (elapsedTime <= 2f)
|
|
|
|
|
{
|
|
|
|
|
elapsedTime += Time.unscaledDeltaTime;
|
|
|
|
|
yield return null;
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-07 17:31:08 +00:00
|
|
|
|
CombatUiManager.Instance.ClearPopupUi.Open(CombatUiManager.Instance.PopupUiList);
|
2024-06-03 18:26:03 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|