davidbe
4 年前
当前提交
e73f2844
共有 30 个文件被更改,包括 3098 次插入 和 52 次删除
-
337Assets/scenes/demo_Island.unity
-
10Packages/manifest.json
-
12ProjectSettings/EditorBuildSettings.asset
-
2ProjectSettings/ProjectSettings.asset
-
8Assets/Adaptive Performance.meta
-
1001Assets/Adaptive Performance/AdaptivePerformanceControl.prefab
-
7Assets/Adaptive Performance/AdaptivePerformanceControl.prefab.meta
-
78Assets/Adaptive Performance/AdaptivePerformanceGeneralSettings.asset
-
8Assets/Adaptive Performance/AdaptivePerformanceGeneralSettings.asset.meta
-
43Assets/Adaptive Performance/AdaptivePerformanceSettings.cs
-
11Assets/Adaptive Performance/AdaptivePerformanceSettings.cs.meta
-
214Assets/Adaptive Performance/IndexerVisualisation.cs
-
11Assets/Adaptive Performance/IndexerVisualisation.cs.meta
-
8Assets/Adaptive Performance/Provider.meta
-
14Assets/Adaptive Performance/Provider/Samsung Android Provider Loader.asset
-
8Assets/Adaptive Performance/Provider/Samsung Android Provider Loader.asset.meta
-
14Assets/Adaptive Performance/Provider/Simulator Provider Loader.asset
-
8Assets/Adaptive Performance/Provider/Simulator Provider Loader.asset.meta
-
1001Assets/Adaptive Performance/ScalerRepresentation.prefab
-
7Assets/Adaptive Performance/ScalerRepresentation.prefab.meta
-
68Assets/Adaptive Performance/ScalerVisualisation.cs
-
11Assets/Adaptive Performance/ScalerVisualisation.cs.meta
-
8Assets/Adaptive Performance/Settings.meta
-
124Assets/Adaptive Performance/Settings/Samsung Android Provider Settings.asset
-
8Assets/Adaptive Performance/Settings/Samsung Android Provider Settings.asset.meta
-
121Assets/Adaptive Performance/Settings/Simulator Provider Settings.asset
-
8Assets/Adaptive Performance/Settings/Simulator Provider Settings.asset.meta
|
|||
fileFormatVersion: 2 |
|||
guid: 4d8b003d43c86d24881bf59e745dd988 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
Assets/Adaptive Performance/AdaptivePerformanceControl.prefab
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: b6feb9f89ea6d0c4e8593d8457d87e19 |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &-7138420414816539310 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 2 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 179fc3111e144bc4688dca4038b3265d, type: 3} |
|||
m_Name: Android Settings |
|||
m_EditorClassIdentifier: |
|||
m_LoaderManagerInstance: {fileID: -4633301848213375430} |
|||
m_InitManagerOnStart: 1 |
|||
--- !u!114 &-4633301848213375430 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 2 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 536372c49e1ca914d822849d36de938c, type: 3} |
|||
m_Name: Android Providers |
|||
m_EditorClassIdentifier: |
|||
m_AutomaticLoading: 0 |
|||
m_AutomaticRunning: 0 |
|||
m_Loaders: |
|||
- {fileID: 11400000, guid: 08737b640782b9f488b3a2148b89ba83, type: 2} |
|||
--- !u!114 &-3271325679297140068 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 2 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 536372c49e1ca914d822849d36de938c, type: 3} |
|||
m_Name: Standalone Providers |
|||
m_EditorClassIdentifier: |
|||
m_AutomaticLoading: 0 |
|||
m_AutomaticRunning: 0 |
|||
m_Loaders: |
|||
- {fileID: 11400000, guid: 06abf77028b8f20438d3f95bca3e24bf, type: 2} |
|||
--- !u!114 &11400000 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 2 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: cb0ece14d1f711a4fb9325ca819dee95, type: 3} |
|||
m_Name: AdaptivePerformanceGeneralSettings |
|||
m_EditorClassIdentifier: |
|||
Keys: 0700000001000000 |
|||
Values: |
|||
- {fileID: -7138420414816539310} |
|||
- {fileID: 6349174755898872584} |
|||
--- !u!114 &6349174755898872584 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 2 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 179fc3111e144bc4688dca4038b3265d, type: 3} |
|||
m_Name: Standalone Settings |
|||
m_EditorClassIdentifier: |
|||
m_LoaderManagerInstance: {fileID: -3271325679297140068} |
|||
m_InitManagerOnStart: 1 |
|
|||
fileFormatVersion: 2 |
|||
guid: 1c2179ef1208a9445a3ee7a025ea1b97 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine; |
|||
using UnityEngine.AdaptivePerformance; |
|||
|
|||
public class AdaptivePerformanceSettings : MonoBehaviour |
|||
{ |
|||
public bool AdaptiveBatching = false; |
|||
public bool AdaptiveFramerate = false; |
|||
public bool AdaptiveLOD = false; |
|||
public bool AdaptiveLut = false; |
|||
public bool AdaptiveMSAA = false; |
|||
public bool AdaptiveResolution = false; |
|||
public bool AdaptiveShadowCascades = false; |
|||
public bool AdaptiveShadowDistance = false; |
|||
public bool AdaptiveShadowmapResolution = false; |
|||
public bool AdaptiveShadowQuality = false; |
|||
public bool AdaptiveSorting = false; |
|||
public bool AdaptiveVRR = false; |
|||
|
|||
private void Awake() |
|||
{ |
|||
if (!AdaptivePerformanceGeneralSettings.Instance || !AdaptivePerformanceGeneralSettings.Instance.Manager || !AdaptivePerformanceGeneralSettings.Instance.Manager.isInitializationComplete) |
|||
return; |
|||
|
|||
IAdaptivePerformanceSettings settings = AdaptivePerformanceGeneralSettings.Instance.Manager.activeLoader.GetSettings(); |
|||
if (settings == null) |
|||
return; |
|||
|
|||
settings.scalerSettings.AdaptiveBatching.enabled = AdaptiveBatching; |
|||
settings.scalerSettings.AdaptiveFramerate.enabled = AdaptiveFramerate; |
|||
settings.scalerSettings.AdaptiveLOD.enabled = AdaptiveLOD; |
|||
settings.scalerSettings.AdaptiveLut.enabled = AdaptiveLut; |
|||
settings.scalerSettings.AdaptiveMSAA.enabled = AdaptiveMSAA; |
|||
settings.scalerSettings.AdaptiveResolution.enabled = AdaptiveResolution; |
|||
settings.scalerSettings.AdaptiveShadowCascades.enabled = AdaptiveShadowCascades; |
|||
settings.scalerSettings.AdaptiveShadowDistance.enabled = AdaptiveShadowDistance; |
|||
settings.scalerSettings.AdaptiveShadowmapResolution.enabled = AdaptiveShadowmapResolution; |
|||
settings.scalerSettings.AdaptiveShadowQuality.enabled = AdaptiveShadowQuality; |
|||
settings.scalerSettings.AdaptiveSorting.enabled = AdaptiveSorting; |
|||
var adaptiveVRR = GameObject.FindObjectOfType<AdaptiveVariableRefreshRate>(); |
|||
if (adaptiveVRR) |
|||
adaptiveVRR.Enabled = AdaptiveVRR; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: fb9efd85cb84346c38cb8266ad04db96 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine; |
|||
using UnityEngine.UI; |
|||
using UnityEngine.AdaptivePerformance; |
|||
using System.Collections.Generic; |
|||
|
|||
public class IndexerVisualisation : MonoBehaviour |
|||
{ |
|||
public Text Timer; |
|||
public Text Bottleneck; |
|||
public Text PerformanceAction; |
|||
public Text ThermalAction; |
|||
public Text GpuFrameTime; |
|||
public Text CpuFrameTime; |
|||
public Transform Content; |
|||
public ScalerVisualisation ScalerVisualisationPrefab; |
|||
public Camera m_MainCams; |
|||
public Camera m_APCam; |
|||
|
|||
List<ScalerVisualisation> m_ScalerVisualisations; |
|||
List<AdaptivePerformanceScaler> m_AppliedScalers; |
|||
List<AdaptivePerformanceScaler> m_UnappliedScalers; |
|||
List<AdaptivePerformanceScaler> m_DisabledScalers; |
|||
AdaptivePerformanceIndexer m_Indexer; |
|||
|
|||
private void Start() |
|||
{ |
|||
var ap = Holder.Instance; |
|||
if (ap == null || !ap.Active) |
|||
{ |
|||
Debug.Log("[AP Indexer Visualisation] Adaptive Performance not active"); |
|||
enabled = false; |
|||
return; |
|||
} |
|||
|
|||
m_Indexer = Holder.Instance.Indexer; |
|||
if (m_Indexer == null) |
|||
{ |
|||
Debug.Log("[AP Indexer Visualisation] No indexer available"); |
|||
enabled = false; |
|||
return; |
|||
} |
|||
|
|||
m_ScalerVisualisations = new List<ScalerVisualisation>(); |
|||
m_AppliedScalers = new List<AdaptivePerformanceScaler>(); |
|||
m_UnappliedScalers = new List<AdaptivePerformanceScaler>(); |
|||
m_DisabledScalers = new List<AdaptivePerformanceScaler>(); |
|||
} |
|||
|
|||
private void Update() |
|||
{ |
|||
if (!enabled) |
|||
return; |
|||
|
|||
Apply(); |
|||
} |
|||
|
|||
public void SwitchCamera() |
|||
{ |
|||
if(!m_APCam.enabled) |
|||
{ |
|||
m_MainCams.enabled = false; |
|||
m_APCam.enabled = true; |
|||
} |
|||
else |
|||
{ |
|||
m_MainCams.enabled = true; |
|||
m_APCam.enabled = false; |
|||
} |
|||
} |
|||
|
|||
public bool AdaptiveBatching = false; |
|||
public bool AdaptiveFramerate = false; |
|||
public bool AdaptiveLOD = false; |
|||
public bool AdaptiveLut = false; |
|||
public bool AdaptiveMSAA = false; |
|||
public bool AdaptiveResolution = false; |
|||
public bool AdaptiveShadowCascades = false; |
|||
public bool AdaptiveShadowDistance = false; |
|||
public bool AdaptiveShadowmapResolution = false; |
|||
public bool AdaptiveShadowQuality = false; |
|||
public bool AdaptiveSorting = false; |
|||
public bool AdaptiveVRR = false; |
|||
public int m_activeScalerIndex = 0; |
|||
|
|||
public void NextScaler() |
|||
{ |
|||
|
|||
if (!AdaptivePerformanceGeneralSettings.Instance || !AdaptivePerformanceGeneralSettings.Instance.Manager || !AdaptivePerformanceGeneralSettings.Instance.Manager.isInitializationComplete) |
|||
return; |
|||
|
|||
IAdaptivePerformanceSettings settings = AdaptivePerformanceGeneralSettings.Instance.Manager.activeLoader.GetSettings(); |
|||
if (settings == null) |
|||
return; |
|||
|
|||
AdaptiveBatching = false; |
|||
AdaptiveFramerate = false; |
|||
AdaptiveLOD = false; |
|||
AdaptiveLut = false; |
|||
AdaptiveMSAA = false; |
|||
AdaptiveResolution = false; |
|||
AdaptiveShadowCascades = false; |
|||
AdaptiveShadowDistance = false; |
|||
AdaptiveShadowmapResolution = false; |
|||
AdaptiveShadowQuality = false; |
|||
AdaptiveSorting = false; |
|||
AdaptiveVRR = false; |
|||
|
|||
switch(m_activeScalerIndex) |
|||
{ |
|||
case 0: AdaptiveBatching = true; break; |
|||
case 1: AdaptiveFramerate = true; break; |
|||
case 2: AdaptiveLOD = true; break; |
|||
case 3: AdaptiveLut = true; break; |
|||
case 4: AdaptiveMSAA = true; break; |
|||
case 5: AdaptiveResolution = true; break; |
|||
case 6: AdaptiveShadowCascades = true; break; |
|||
case 7: AdaptiveShadowDistance = true; break; |
|||
case 8: AdaptiveShadowmapResolution = true; break; |
|||
case 9: AdaptiveShadowQuality = true; break; |
|||
case 10: AdaptiveSorting = true; break; |
|||
case 11: AdaptiveVRR = true; break; |
|||
} |
|||
|
|||
m_activeScalerIndex++; |
|||
if (m_activeScalerIndex >= 12) |
|||
m_activeScalerIndex = 0; |
|||
|
|||
settings.scalerSettings.AdaptiveBatching.enabled = AdaptiveBatching; |
|||
settings.scalerSettings.AdaptiveFramerate.enabled = AdaptiveFramerate; |
|||
settings.scalerSettings.AdaptiveLOD.enabled = AdaptiveLOD; |
|||
settings.scalerSettings.AdaptiveLut.enabled = AdaptiveLut; |
|||
settings.scalerSettings.AdaptiveMSAA.enabled = AdaptiveMSAA; |
|||
settings.scalerSettings.AdaptiveResolution.enabled = AdaptiveResolution; |
|||
settings.scalerSettings.AdaptiveShadowCascades.enabled = AdaptiveShadowCascades; |
|||
settings.scalerSettings.AdaptiveShadowDistance.enabled = AdaptiveShadowDistance; |
|||
settings.scalerSettings.AdaptiveShadowmapResolution.enabled = AdaptiveShadowmapResolution; |
|||
settings.scalerSettings.AdaptiveShadowQuality.enabled = AdaptiveShadowQuality; |
|||
settings.scalerSettings.AdaptiveSorting.enabled = AdaptiveSorting; |
|||
var adaptiveVRR = GameObject.FindObjectOfType<AdaptiveVariableRefreshRate>(); |
|||
if (adaptiveVRR) |
|||
adaptiveVRR.Enabled = AdaptiveVRR; |
|||
} |
|||
|
|||
private void Apply() |
|||
{ |
|||
Debug.Assert(Timer); |
|||
Debug.Assert(Bottleneck); |
|||
Debug.Assert(PerformanceAction); |
|||
Debug.Assert(ThermalAction); |
|||
Debug.Assert(GpuFrameTime); |
|||
Debug.Assert(CpuFrameTime); |
|||
Debug.Assert(Content); |
|||
Debug.Assert(ScalerVisualisationPrefab); |
|||
|
|||
|
|||
Timer.text = $" Timer: <b>{Mathf.RoundToInt(m_Indexer.TimeUntilNextAction)}</b>"; |
|||
Bottleneck.text = |
|||
$" Bottleneck: <b>{Holder.Instance.PerformanceStatus.PerformanceMetrics.PerformanceBottleneck}</b>"; |
|||
|
|||
var perfAction = m_Indexer.PerformanceAction; |
|||
if (perfAction != StateAction.Decrease && perfAction != StateAction.FastDecrease) |
|||
PerformanceAction.text = $" Perf action: <color=lime>{perfAction}</color>"; |
|||
else |
|||
PerformanceAction.text = $" Perf action: <color=red>{perfAction}</color>"; |
|||
|
|||
var tempAction = m_Indexer.ThermalAction; |
|||
if (tempAction != StateAction.Decrease && tempAction != StateAction.FastDecrease) |
|||
ThermalAction.text = $" Thermal action: <color=lime>{tempAction}</color>"; |
|||
else |
|||
ThermalAction.text = $" Thermal action: <color=red>{tempAction}</color>"; |
|||
|
|||
GpuFrameTime.text = |
|||
$" GPU frame time: {Holder.Instance.PerformanceStatus.FrameTiming.AverageGpuFrameTime:0.####}s"; |
|||
CpuFrameTime.text = |
|||
$" CPU frame time: {Holder.Instance.PerformanceStatus.FrameTiming.AverageCpuFrameTime:0.####}s"; |
|||
|
|||
m_Indexer.GetAppliedScalers(ref m_AppliedScalers); |
|||
foreach (var scaler in m_AppliedScalers) |
|||
CreateScalerVisualisation(scaler); |
|||
|
|||
m_Indexer.GetUnappliedScalers(ref m_UnappliedScalers); |
|||
foreach (var scaler in m_UnappliedScalers) |
|||
CreateScalerVisualisation(scaler); |
|||
|
|||
m_Indexer.GetDisabledScalers(ref m_DisabledScalers); |
|||
foreach (var scaler in m_DisabledScalers) |
|||
CreateScalerVisualisation(scaler); |
|||
} |
|||
|
|||
private void CreateScalerVisualisation(AdaptivePerformanceScaler scaler) |
|||
{ |
|||
var scalerVisualisation = ContainsScaler(scaler); |
|||
if (scalerVisualisation == null) |
|||
{ |
|||
scalerVisualisation = Instantiate(ScalerVisualisationPrefab, Content); |
|||
scalerVisualisation.Scaler = scaler; |
|||
m_ScalerVisualisations.Add(scalerVisualisation); |
|||
} |
|||
if (scaler.Enabled) |
|||
scalerVisualisation.gameObject.SetActive(true); |
|||
else |
|||
scalerVisualisation.gameObject.SetActive(false); |
|||
} |
|||
|
|||
private ScalerVisualisation ContainsScaler(AdaptivePerformanceScaler scaler) |
|||
{ |
|||
foreach (var current in m_ScalerVisualisations) |
|||
{ |
|||
if (current.Scaler == scaler) |
|||
return current; |
|||
} |
|||
return null; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: e48b3111c14d1c740a76517aaa466733 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 998d7474c94c66743a6f8afbc9146fe6 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &11400000 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 2 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 12368ffd90e3c4ac4889486ab7b2aa78, type: 3} |
|||
m_Name: Samsung Android Provider Loader |
|||
m_EditorClassIdentifier: |
|
|||
fileFormatVersion: 2 |
|||
guid: 08737b640782b9f488b3a2148b89ba83 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &11400000 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 2 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 921854900f2214d7ab9b1e95d17dbb2b, type: 3} |
|||
m_Name: Simulator Provider Loader |
|||
m_EditorClassIdentifier: |
|
|||
fileFormatVersion: 2 |
|||
guid: 06abf77028b8f20438d3f95bca3e24bf |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
Assets/Adaptive Performance/ScalerRepresentation.prefab
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 1825aaaa8bf978d45b861791fec73bd3 |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine; |
|||
using UnityEngine.UI; |
|||
using UnityEngine.AdaptivePerformance; |
|||
|
|||
public class ScalerVisualisation : MonoBehaviour |
|||
{ |
|||
public Text Name; |
|||
public Text Value; |
|||
public Text Status; |
|||
public Slider Level; |
|||
public Toggle Override; |
|||
public Toggle EnabledToggle; |
|||
public AdaptivePerformanceScaler Scaler; |
|||
|
|||
public void SetOverride() |
|||
{ |
|||
if (Scaler == null) |
|||
return; |
|||
|
|||
Scaler.OverrideLevel = Override.isOn ? Scaler.CurrentLevel : -1; |
|||
Level.interactable = Override.isOn; |
|||
} |
|||
|
|||
public void SetEnabled() |
|||
{ |
|||
if (Scaler == null) |
|||
return; |
|||
|
|||
Scaler.Enabled = EnabledToggle.isOn; |
|||
} |
|||
|
|||
public void SetLevel(float value) |
|||
{ |
|||
if (Scaler == null) |
|||
return; |
|||
var level = (int)(value * Scaler.MaxLevel); |
|||
if (Scaler.OverrideLevel != -1) |
|||
Scaler.OverrideLevel = level; |
|||
Level.value = (float)level / Scaler.MaxLevel; |
|||
Value.text = $"{Level.value}"; |
|||
} |
|||
|
|||
private void Start() |
|||
{ |
|||
if (Scaler == null) |
|||
return; |
|||
|
|||
Name.text = Scaler.Name; |
|||
Override.isOn = Scaler.OverrideLevel != -1; |
|||
EnabledToggle.isOn = Scaler.Enabled; |
|||
Level.value = (float)Scaler.CurrentLevel / Scaler.MaxLevel; |
|||
} |
|||
|
|||
private void Update() |
|||
{ |
|||
if (Scaler == null) |
|||
return; |
|||
|
|||
Level.interactable = Scaler.OverrideLevel != -1; |
|||
if (Scaler.OverrideLevel == -1) |
|||
Level.value = (float)Scaler.CurrentLevel / Scaler.MaxLevel; |
|||
|
|||
if (Scaler.Enabled) |
|||
Status.text = $"<color=lime>Enabled</color>"; |
|||
else |
|||
Status.text = $"<color=red>Disabled</color>"; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 3f231eef4361fc7499e0d406194cb383 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: d04e70a7b46083c4480fdccfb31df745 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &11400000 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 2 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 02a364304553d4fe797810bd5c88f9d8, type: 3} |
|||
m_Name: Samsung Android Provider Settings |
|||
m_EditorClassIdentifier: |
|||
m_Logging: 1 |
|||
m_AutomaticPerformanceModeEnabled: 1 |
|||
m_StatsLoggingFrequencyInFrames: 50 |
|||
m_IndexerSettings: |
|||
m_Active: 1 |
|||
m_ThermalActionDelay: 10 |
|||
m_PerformanceActionDelay: 4 |
|||
m_ScalerSettings: |
|||
m_AdaptiveFramerate: |
|||
m_Name: Adaptive Framerate |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 2 |
|||
m_Target: 7 |
|||
m_MaxLevel: 45 |
|||
m_MinBound: 15 |
|||
m_MaxBound: 60 |
|||
m_AdaptiveResolution: |
|||
m_Name: Adaptive Resolution |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 0 |
|||
m_Target: 6 |
|||
m_MaxLevel: 9 |
|||
m_MinBound: 0.5 |
|||
m_MaxBound: 1 |
|||
m_AdaptiveBatching: |
|||
m_Name: Adaptive Batching |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 1 |
|||
m_Target: 1 |
|||
m_MaxLevel: 1 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|||
m_AdaptiveLOD: |
|||
m_Name: Adaptive LOD |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 2 |
|||
m_Target: 2 |
|||
m_MaxLevel: 3 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|||
m_AdaptiveLut: |
|||
m_Name: Adaptive Lut |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 1 |
|||
m_Target: 3 |
|||
m_MaxLevel: 1 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|||
m_AdaptiveMSAA: |
|||
m_Name: Adaptive MSAA |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 1 |
|||
m_Target: 6 |
|||
m_MaxLevel: 2 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|||
m_AdaptiveShadowCascades: |
|||
m_Name: Adaptive Shadow Cascade |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 1 |
|||
m_Target: 3 |
|||
m_MaxLevel: 2 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|||
m_AdaptiveShadowDistance: |
|||
m_Name: Adaptive Shadow Distance |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 0 |
|||
m_Target: 2 |
|||
m_MaxLevel: 3 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|||
m_AdaptiveShadowmapResolution: |
|||
m_Name: Adaptive Shadowmap Resolution |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 0 |
|||
m_Target: 2 |
|||
m_MaxLevel: 3 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|||
m_AdaptiveShadowQuality: |
|||
m_Name: Adaptive Shadow Quality |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 2 |
|||
m_Target: 3 |
|||
m_MaxLevel: 3 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|||
m_AdaptiveSorting: |
|||
m_Name: Adaptive Sorting |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 1 |
|||
m_Target: 1 |
|||
m_MaxLevel: 1 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|||
m_SamsungProviderLogging: 0 |
|||
m_HighSpeedVRR: 0 |
|||
m_AutomaticVRR: 1 |
|
|||
fileFormatVersion: 2 |
|||
guid: dc4d2e4f2e30a02479bc950a42d5466e |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &11400000 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 2 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: b592865877cb54284a5d1d88aec9cfbb, type: 3} |
|||
m_Name: Simulator Provider Settings |
|||
m_EditorClassIdentifier: |
|||
m_Logging: 1 |
|||
m_AutomaticPerformanceModeEnabled: 1 |
|||
m_StatsLoggingFrequencyInFrames: 50 |
|||
m_IndexerSettings: |
|||
m_Active: 1 |
|||
m_ThermalActionDelay: 10 |
|||
m_PerformanceActionDelay: 4 |
|||
m_ScalerSettings: |
|||
m_AdaptiveFramerate: |
|||
m_Name: Adaptive Framerate |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 2 |
|||
m_Target: 7 |
|||
m_MaxLevel: 45 |
|||
m_MinBound: 15 |
|||
m_MaxBound: 60 |
|||
m_AdaptiveResolution: |
|||
m_Name: Adaptive Resolution |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 0 |
|||
m_Target: 6 |
|||
m_MaxLevel: 9 |
|||
m_MinBound: 0.5 |
|||
m_MaxBound: 1 |
|||
m_AdaptiveBatching: |
|||
m_Name: Adaptive Batching |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 1 |
|||
m_Target: 1 |
|||
m_MaxLevel: 1 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|||
m_AdaptiveLOD: |
|||
m_Name: Adaptive LOD |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 2 |
|||
m_Target: 2 |
|||
m_MaxLevel: 3 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|||
m_AdaptiveLut: |
|||
m_Name: Adaptive Lut |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 1 |
|||
m_Target: 3 |
|||
m_MaxLevel: 1 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|||
m_AdaptiveMSAA: |
|||
m_Name: Adaptive MSAA |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 1 |
|||
m_Target: 6 |
|||
m_MaxLevel: 2 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|||
m_AdaptiveShadowCascades: |
|||
m_Name: Adaptive Shadow Cascade |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 1 |
|||
m_Target: 3 |
|||
m_MaxLevel: 2 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|||
m_AdaptiveShadowDistance: |
|||
m_Name: Adaptive Shadow Distance |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 0 |
|||
m_Target: 2 |
|||
m_MaxLevel: 3 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|||
m_AdaptiveShadowmapResolution: |
|||
m_Name: Adaptive Shadowmap Resolution |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 0 |
|||
m_Target: 2 |
|||
m_MaxLevel: 3 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|||
m_AdaptiveShadowQuality: |
|||
m_Name: Adaptive Shadow Quality |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 2 |
|||
m_Target: 3 |
|||
m_MaxLevel: 3 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|||
m_AdaptiveSorting: |
|||
m_Name: Adaptive Sorting |
|||
m_Enabled: 0 |
|||
m_Scale: -1 |
|||
m_VisualImpact: 1 |
|||
m_Target: 1 |
|||
m_MaxLevel: 1 |
|||
m_MinBound: -1 |
|||
m_MaxBound: -1 |
|
|||
fileFormatVersion: 2 |
|||
guid: 555f33cd0c2c87349b0a7607aaad30e0 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue