1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using UnityEngine;
- using UnityEngine.UI;
- using UnityEngine.Serialization;
- using System;
- using System.Text;
- using System.Collections;
- using System.Collections.Generic;
- using Random = UnityEngine.Random;
- public class ManaDebug : MonoBehaviour
- {
- #region 变量
- public static Text Lab
- {
- get
- {
- if (Lab_ == null)
- {
- Lab = ManaReso.Get<Text>("E_ScrrLab", false);
- }
- return Lab_;
- }
- set { Lab_ = value; }
- }
- private static Text Lab_;
- public int Counter;
- public float Timer;
- #endregion
- public void Update()
- {
- Timer += Time.deltaTime;
- Counter++;
- if (Timer >= 1)
- {
- Log("FrameRate " + Counter);
- Timer = 0;
- Counter = 0;
- }
- }
- public static void Log(string message)
- {
- if (Lab == null)
- {
- return;
- }
- Lab.text += '\n' + message;
- }
- }
|