51 lines
2.5 KiB
C#
51 lines
2.5 KiB
C#
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class Ingame_Dungeon : MonoBehaviour
|
|
{
|
|
public Ingame_DungeonBase[] ingame_Dungeons; // 0 미믹, 1 미궁, 2 악몽, 3 웨이브
|
|
public TextMeshProUGUI[] texts_base; // 0 던전 정보, 1 2 남은 시간
|
|
public GameObject[] gos_time; // 0 전체 시간, 1 미믹 시간
|
|
|
|
public void Set(float time, int maxMobCount)
|
|
{
|
|
gameObject.SetActive(true);
|
|
Set_DungeonInfo();
|
|
Set_TextTime(time);
|
|
for (int i = 0; i < ingame_Dungeons.Length; i++)
|
|
ingame_Dungeons[i].gameObject.SetActive(false);
|
|
Get_DungeonBase().Set_DungeonInfo(maxMobCount);
|
|
DungeonInfo.Ins.Set_Time(MyValue.MyChoiceMapData.n_DungeonLv, time);
|
|
DungeonInfo.Ins.act_Time = Set_TextTime;
|
|
}
|
|
|
|
public Ingame_DungeonBase Get_DungeonBase() { return ingame_Dungeons[MyValue.MyChoiceMapData.Get_DungeonIndex()]; }
|
|
void Set_DungeonInfo()
|
|
{
|
|
var mapData = table_battlemapconfig.Ins.Get_Data(MyValue.MyChoiceMapData.n_MapID);
|
|
switch (MyValue.MyChoiceMapData.Get_DungeonMapData_orNull().e_DungeonType)
|
|
{
|
|
case eDungeon.d1_Mimic:
|
|
texts_base[0].text = $"{mapData.Get_Name()} <color=#86E2E7>Lv.{MyValue.MyChoiceMapData.n_DungeonLv}";
|
|
DSUtil.InActivateGameObjects(gos_time, 1);
|
|
break;
|
|
case eDungeon.d2_Maze:
|
|
texts_base[0].text = $"{mapData.Get_Name()} <color=#86E2E7>F{MyValue.MyChoiceMapData.n_DungeonLv}";
|
|
DSUtil.InActivateGameObjects(gos_time, 0);
|
|
break;
|
|
case eDungeon.d3_Nightmare:
|
|
texts_base[0].text = $"{mapData.Get_Name()} <color=#86E2E7>{MyValue.MyChoiceMapData.n_Difficult}";
|
|
DungeonInfo.Ins.Set_Nightmare(ingame_Dungeons[MyValue.MyChoiceMapData.Get_DungeonIndex()].Set_TotalDmg);
|
|
DSUtil.InActivateGameObjects(gos_time, 0);
|
|
break;
|
|
case eDungeon.d4_Wave:
|
|
texts_base[0].text = $"{mapData.Get_Name()} <color=#86E2E7>{MyValue.MyChoiceMapData.n_Difficult}";
|
|
var dgindex = MyValue.MyChoiceMapData.Get_DungeonIndex();
|
|
DungeonInfo.Ins.Set_Wave(ingame_Dungeons[dgindex].Set_TotalScore, ingame_Dungeons[dgindex].Set_TotalLife,
|
|
ingame_Dungeons[dgindex].Set_WaveGold);
|
|
DSUtil.InActivateGameObjects(gos_time, 0);
|
|
break;
|
|
}
|
|
}
|
|
void Set_TextTime(float time) { texts_base[1].text = texts_base[2].text = Mathf.Max(0f, time).ToString("F2"); }
|
|
} |