2024-01-30 19:22:27 +08:00
|
|
|
using System;
|
2024-01-29 19:07:52 +08:00
|
|
|
using Cysharp.Threading.Tasks;
|
2024-02-01 19:06:51 +08:00
|
|
|
using Game.Plugins.App;
|
2024-01-29 19:07:52 +08:00
|
|
|
using Script.battle;
|
2024-01-26 19:15:07 +08:00
|
|
|
using UnityEngine;
|
2024-01-30 19:22:27 +08:00
|
|
|
using UnityEngine.UI;
|
2024-01-26 19:15:07 +08:00
|
|
|
|
|
|
|
namespace Script
|
|
|
|
{
|
|
|
|
public class UIMain : MonoBehaviour
|
|
|
|
{
|
2024-01-30 19:22:27 +08:00
|
|
|
public Text frameLabel;
|
2024-02-20 18:39:12 +08:00
|
|
|
float f = 1.23456789f;
|
2024-01-29 19:07:52 +08:00
|
|
|
|
2024-01-30 19:22:27 +08:00
|
|
|
private void Awake()
|
|
|
|
{
|
2024-01-31 06:12:18 +08:00
|
|
|
for (int i = 1000 - 1; i >= 0; i--)
|
2024-01-30 19:22:27 +08:00
|
|
|
{
|
|
|
|
// 进行一些基本的浮点数运算
|
|
|
|
f = f + f;
|
|
|
|
f = f - (f / 2);
|
|
|
|
f = f * (f / 2);
|
|
|
|
f = f / (f / 2);
|
|
|
|
f = (float)Math.Sqrt(f);
|
|
|
|
f = Math.Abs(f);
|
|
|
|
f = (float)Math.Log(f);
|
|
|
|
f = (float)Math.Log10(f);
|
|
|
|
f = (float)Math.Exp(f);
|
|
|
|
}
|
2024-02-20 18:39:12 +08:00
|
|
|
DontDestroyOnLoad(this.gameObject);
|
|
|
|
}
|
|
|
|
|
|
|
|
//重置
|
|
|
|
public void OnClickReset()
|
|
|
|
{
|
|
|
|
GBattleModeManager.Instance.Open(GBattleMode.Default).Forget();
|
|
|
|
}
|
|
|
|
|
|
|
|
private void Update()
|
|
|
|
{
|
|
|
|
this.frameLabel.text = $"{Application.identifier} 浮点数计算: {f} 服务器帧数: {App.Sync.NServerFrame} 本地运行帧 {App.Sync.NLocalFrame} 本地已执行帧 {App.Sync.NLocalRunFrame} 是否正在请求{App.Sync.IsRequestServerData} \nFPS:{1f/Time.deltaTime} \nthis.DyTime():{App.Sync.DyTime()} \n一帧执行时间:{App.Sync.frameTime} \n是否追帧:{App.Sync.IsLoop}";
|
2024-01-30 19:22:27 +08:00
|
|
|
}
|
2024-01-26 19:15:07 +08:00
|
|
|
}
|
|
|
|
}
|