mycj_demo/mycj/Assets/Game/Scripts/Application/02View/Level/FBUIBoard.cs
2024-12-02 09:37:47 +08:00

170 lines
3.8 KiB
C#
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Felix-BangFBUIBoard
//   へ     /|
//  /7    ∠_/
//  / │    
//  Z _,    /`ヽ
// │     ヽ   /  〉
//  Y     `  /  /
// イ● 、 ●  ⊂⊃〈  /
// ()  へ    | \〈
//  >ー 、_  ィ  │
//  / へ   / ノ<|
//  ヽ_ノ  (_  │//
//  7       |
//  ―r ̄ ̄`ー―_
// Describe关卡-公告栏
// Createtime2018/9/28
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FBFramework;
using UnityEngine.UI;
using System;
namespace FBApplication
{
public class FBUIBoard : FBView
{
#region
[SerializeField]
private Text txtScore;
[SerializeField]
private Text txtCurrent;
[SerializeField]
private Text txtTotal;
[SerializeField]
private GameObject goRoundInfo;
[SerializeField]
private GameObject goPause;
[SerializeField]
private Button btnSpeed1;
[SerializeField]
private Button btnSpeed2;
[SerializeField]
private Button btnPause;
[SerializeField]
private Button btnPlay;
[SerializeField]
private Button btnSystem;
private GameSpeed f_speed = GameSpeed.One;
private bool f_isPlaying = false;
private int f_gold = 0;
#endregion
#region
public override string Name
{
get { return FBConsts.V_Board; }
}
public int Glod
{
get { return f_gold; }
set
{
f_gold = value;
txtScore.text = value.ToString();
}
}
public GameSpeed Speed
{
get { return f_speed; }
set
{
f_speed = value;
btnSpeed1.gameObject.SetActive(f_speed == GameSpeed.One);
btnSpeed2.gameObject.SetActive(f_speed == GameSpeed.Two);
}
}
public bool IsPlaying
{
get { return f_isPlaying; }
set
{
f_isPlaying = value;
goRoundInfo.SetActive(value);
goPause.SetActive(!value);
}
}
#endregion
#region Unity回调
private void Awake()
{
Glod = 0;
IsPlaying = true;
Speed = GameSpeed.One;
}
private void Start()
{
btnSpeed1.onClick.AddListener(OnSpeed1Click);
btnSpeed2.onClick.AddListener(OnSpeed2Click);
btnPause.onClick.AddListener(OnPauseClick);
btnPlay.onClick.AddListener(OnPlayClick);
btnSystem.onClick.AddListener(OnSystemClick);
}
#endregion
#region
public override void RegisterEvents() { }
public override void HandleEvent(string eventName, object data = null)
{}
#endregion
#region
private void OnSpeed1Click()
{
Speed = GameSpeed.Two;
}
private void OnSpeed2Click()
{
Debug.Log("Two");
Speed = GameSpeed.One;
}
private void OnPauseClick()
{
IsPlaying = false;
}
private void OnPlayClick()
{
IsPlaying = false;
}
private void OnSystemClick()
{
}
private void UpdateRoundInfo(int currentRound,int total)
{
txtCurrent.text = currentRound.ToString("D2");
txtTotal.text = total.ToString("D2");
}
#endregion
#region
#endregion
}
}