You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.5 KiB
62 lines
1.5 KiB
using UnityEngine;
|
|
|
|
public class TrainDgView : View
|
|
{
|
|
[SerializeField] ExtendText dungeonLevelText;
|
|
[SerializeField] SeperatedBar waveProgressBar;
|
|
[SerializeField] ExtendText remainTimeText;
|
|
|
|
TrainDg dungeon;
|
|
|
|
private void Start()
|
|
{
|
|
viewState = ViewState.Hidden;
|
|
gameObject.SetActive(false);
|
|
}
|
|
|
|
public override void Show()
|
|
{
|
|
ResetPosition();
|
|
viewState = ViewState.Shown;
|
|
gameObject.SetActive(true);
|
|
}
|
|
|
|
public override void Hide()
|
|
{
|
|
gameObject.SetActive(false);
|
|
viewState = ViewState.Hidden;
|
|
}
|
|
|
|
private void LateUpdate()
|
|
{
|
|
waveProgressBar?.SetCurrentCount(dungeon.CurrentWave);
|
|
remainTimeText?.SetText(FormatString.TextTime((int)dungeon.ModRemainingTime));
|
|
}
|
|
|
|
public void SetDungeon(TrainDg dungeon)
|
|
{
|
|
this.dungeon = dungeon;
|
|
|
|
string levelFormat = LocalizationText.GetText("dg_diff");
|
|
dungeonLevelText?.SetText(FormatString.StringFormat(levelFormat, dungeon.Data.Level));
|
|
|
|
waveProgressBar?.Setup(dungeon.Data.WaveCount);
|
|
remainTimeText?.SetText(FormatString.TextTime((int)dungeon.ModRemainingTime));
|
|
}
|
|
|
|
public void OpenQuitDungeon()
|
|
{
|
|
GameUIMgr.SOpenPopup2Button(LocalizationText.GetText("msg_dungeonout"), QuitDungeon);
|
|
}
|
|
|
|
private void QuitDungeon()
|
|
{
|
|
if (BattleMgr.Instance.doNotInterupt)
|
|
{
|
|
GameUIMgr.SOpenToast(LocalizationText.GetText("donot_interupt"));
|
|
return;
|
|
}
|
|
|
|
dungeon.QuitDungeon();
|
|
}
|
|
}
|