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.
 
 
 
 
 
 

67 lines
1.7 KiB

using UnityEngine;
using UnityEngine.UI;
public class DevelopTheJungleDgView : View
{
[SerializeField] ExtendText dungeonLevelText;
[SerializeField] SeperatedBar waveProgressBar;
[SerializeField] ExtendText remainTimeText;
[SerializeField] Toggle autoProgressToggle;
DevelopTheJungleDg 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(DevelopTheJungleDg 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();
}
public void SetAutoProgress(bool onOff) => dungeon.Data.AutoProgress = onOff;
}