Andre McGrail
4 年前
当前提交
0be6da0e
共有 7 个文件被更改,包括 141 次插入 和 46 次删除
-
1Assets/Scripts/Editor/QualitySettingsExtenstion.cs
-
23Assets/Scripts/GameSystem/AppSettings.cs
-
112Assets/Scripts/GameSystem/DefaultVolume.cs
-
1Assets/Scripts/System/Benchmark.cs
-
3Assets/Scripts/System/PerfomanceStats.cs
-
36Assets/Scripts/Utility/Utility.cs
-
11Assets/Scripts/Utility/Utility.cs.meta
|
|||
#if UNITY_EDITOR
|
|||
using UnityEditor; |
|||
#endif
|
|||
using System; |
|||
using UnityEngine; |
|||
|
|||
namespace BoatAttack |
|||
{ |
|||
#if UNITY_EDITOR
|
|||
[InitializeOnLoad] |
|||
#endif
|
|||
public class Utility |
|||
{ |
|||
public static event Action<int, int> QualityLevelChange; |
|||
private static int lastQualityLevel = -1; |
|||
|
|||
#if UNITY_EDITOR
|
|||
static Utility() |
|||
{ |
|||
// setup the things
|
|||
Debug.Log("Setting up some utilities"); |
|||
EditorApplication.update += CheckQualityLevel; |
|||
} |
|||
#endif
|
|||
|
|||
public static void CheckQualityLevel() |
|||
{ |
|||
var curLevel = QualitySettings.GetQualityLevel(); |
|||
if (lastQualityLevel == curLevel) return; |
|||
|
|||
Debug.Log($"Quality level changed:{lastQualityLevel} to {curLevel}"); |
|||
QualityLevelChange?.Invoke(lastQualityLevel, curLevel); |
|||
lastQualityLevel = curLevel; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 6644d24e743e4944cb63bd5acc037a43 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue