2025-05-18 01:04:31 +08:00

73 lines
1.9 KiB
C#

// ***********************************************************************
// Assembly : Game
// Author : Kimch
// Created : 2021-05-18
// Description :
// Last Modified By :
// Last Modified On :
// ***********************************************************************
// <copyright file= "GameSceneLogic" company="Kunpo"></copyright>
// <summary></summary>
// ***********************************************************************
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace G
{
/// <summary>
/// 游戏场景逻辑
/// </summary>
public class GameSceneLogic : SceneLogic
{
#region Field
#endregion
#region Method
#endregion
#region Unity
// Use this for initialization
private void Awake()
{
Time.timeScale = 1f;
GlobalVar.IsBattling = true;
//Application.targetFrameRate = SettingProxy.Instance.lowEffect ? 30 : 60;
#if !UNITY_EDITOR && !UNITY_WEBGL
UnityEngine.Scripting.GarbageCollector.GCMode = UnityEngine.Scripting.GarbageCollector.Mode.Disabled;
#endif
}
private void OnDestroy()
{
GlobalVar.IsBattling = false;
#if !UNITY_EDITOR && !UNITY_WEBGL
UnityEngine.Scripting.GarbageCollector.GCMode = UnityEngine.Scripting.GarbageCollector.Mode.Enabled;
#endif
}
private float _lastUpdateTime;
private void Update()
{
if (Time.time - _lastUpdateTime > 100f)
{
_lastUpdateTime = Time.time;
if (GameLevel.Instance != null && GameLevel.Instance.curLevelItem != null)
{
#if !UNITY_WEBGL
KStatistics.Instance.ReportEvent_Fps("game_window", GameLevel.Instance.curChapterId, GameLevel.Instance.curLevelId, GameLevel.Instance.curStageIndex, KGMTools.Instance.fps, "", SystemInfo.processorType, SystemInfo.graphicsDeviceName, Screen.currentResolution.ToString(), SystemInfo.systemMemorySize, 0, 0);
#endif
}
}
}
#endregion
}
}