/*
 *Copyright(C) 2023 by Chief All rights reserved.
 *Unity版本：2023.2.5f1c1 
 *作者:Chief  
 *创建日期: 2024-01-19 
 *模块说明：通用工具部分
 *版本: 1.0
*/

using Sirenix.OdinInspector;
using System;
using UnityEngine;

namespace Aster
{
    /// <summary>
    /// 全局通用的运行器
    /// </summary>
    public class AsterRunner : LimitGlobalMonoSingleton<AsterRunner>
    {

        [NonSerialized, ShowInInspector, DisplayAsString, LabelText("游戏时间（RealTime）")]
        internal static float GameTime;

        [NonSerialized, ShowInInspector, DisplayAsString, LabelText("当前帧数")]
        internal static int GameFrameCount;

        [NonSerialized, ShowInInspector, DisplayAsString, LabelText("目标帧数")]
        internal static int TargetFrameRate=30;

        [NonSerialized, ShowInInspector, DisplayAsString, LabelText("当前帧率")]
        internal static float FPS;

        private void Update()
        {
            GameTime = Time.realtimeSinceStartup;
            GameFrameCount = Time.frameCount;
            TargetFrameRate = Mathf.Max(1, Application.targetFrameRate);
            FPS = 1 / Time.deltaTime;
        }

    }
}