mycj_demo/mycj/Assets/Game/Scripts/Application/02View/Level/FBUILost.cs

110 lines
2.4 KiB
C#
Raw Normal View History

2024-12-02 09:37:47 +08:00
// Felix-BangFBUILost
//   へ     /|
//  /7    ∠_/
//  / │    
//  Z _,    /`ヽ
// │     ヽ   /  〉
//  Y     `  /  /
// イ● 、 ●  ⊂⊃〈  /
// ()  へ    | \〈
//  >ー 、_  ィ  │
//  / へ   / ノ<|
//  ヽ_ノ  (_  │//
//  7       |
//  ―r ̄ ̄`ー―_
// Describe关卡-失败
// Createtime2018/10/09
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FBFramework;
using UnityEngine.UI;
using System;
namespace FBApplication
{
public class FBUILost : FBView
{
#region
[SerializeField]
private Text txtCurrent;
[SerializeField]
private Text txtTotal;
[SerializeField]
private Button btnRestart;
#endregion
#region
public override string Name
{
get
{
return FBConsts.V_Lost;
}
}
#endregion
#region Unity回调
private void Awake()
{
UpdatteRoundInfo(0,0);
}
private void Start()
{
btnRestart.onClick.AddListener(OnRestartClick);
}
#endregion
#region
public override void HandleEvent(string eventName, object data = null)
{
}
#endregion
#region
private void OnRestartClick()
{
FBGameModel gameModel = GetModel<FBGameModel>();
SendEvent(FBConsts.E_LevelStart, new FBStartLevelArgs() { ID = gameModel.PlayLevelIndex });
}
public void Show()
{
gameObject.SetActive(true);
FBRoundModel roundModel = GetModel<FBRoundModel>();
UpdatteRoundInfo(roundModel.RoundIndex+1,roundModel.RoundTotal);
}
private void Hide()
{
gameObject.SetActive(false);
}
private void UpdatteRoundInfo(int currentRound,int totalRound)
{
txtCurrent.text = currentRound.ToString("D2");
txtTotal.text = totalRound.ToString();
}
#endregion
#region
#endregion
}
}