CapersProject/Assets/02.Scripts/Map/MapManager.cs
Nam Tae Gun 51798c3346 #16 SandMole(모래 두더지) 보스 추가 중
+ AiMovement 클래스 재생성 및 초기화 방식 변경
+ AnimationController 클래스 초기화 방식 변경
+ MapManager, MapController 로직 수정
+ BaseBoss 프리팹 수정
+ SandMole 보스에 맞게 맵 추가
+ 임시 SandMole, GhostBarrel 이미지 추가
+ 기존 GroundGreen, GroundRed 스프라이트 정사각형으로 변경, 수정에 따라 BaseMapController Ground, Wall 수정
+ 코뿔소 맵 투명화 Props 추가

Closes #12
2024-06-14 01:46:37 +09:00

60 lines
2.0 KiB
C#

using System;
using UnityEngine;
namespace BlueWater.Maps
{
public class MapManager : Singleton<MapManager>
{
[field: SerializeField]
public FirstTutorialMapController FirstTutorialMapController { get; private set; }
[field: SerializeField]
public TitanSlimeMapController TitanSlimeMapController { get; private set; }
[field: SerializeField]
public BossMapController RhinocerosMapController { get; private set; }
[field: SerializeField]
public BossMapController SandMoleMapController { get; private set; }
private MapController _currentMapController;
public void InitializeMap()
{
MapController newMapController = null;
switch (DataManager.Instance.CurrentSaveStage)
{
case SaveStage.None:
break;
case SaveStage.FirstTutorial:
newMapController = FirstTutorialMapController;
break;
case SaveStage.SecondTutorial:
//MapController = FindAnyObjectByType<SecondTutorialMapController>();
break;
case SaveStage.TitanSlime:
newMapController = TitanSlimeMapController;
break;
case SaveStage.Rhinoceros:
newMapController = RhinocerosMapController;
break;
case SaveStage.SandMole:
newMapController = SandMoleMapController;
break;
default:
throw new ArgumentOutOfRangeException();
}
if (_currentMapController != null)
{
_currentMapController.AllDestroyObjects();
}
_currentMapController = newMapController;
if (_currentMapController != null)
{
_currentMapController.InitializeMap();
}
}
}
}