首次提交
This commit is contained in:
36
Assets/Scripts/UI/Fishing/WeatherInfo.cs
Normal file
36
Assets/Scripts/UI/Fishing/WeatherInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
|
||||
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class WeatherInfo : GLabel
|
||||
{
|
||||
private int _count;
|
||||
|
||||
private void OnInited()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
base.OnUpdate();
|
||||
UpdateWeather();
|
||||
}
|
||||
|
||||
private void UpdateWeather(bool force = false)
|
||||
{
|
||||
_count++;
|
||||
if (force)
|
||||
{
|
||||
_count = 30;
|
||||
}
|
||||
|
||||
if (_count < 30) return;
|
||||
_count = 0;
|
||||
TextTime.text = GameTimer.gameTimeString;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user