|
|
|
|
|
|
public Volume volBaseComponent; |
|
|
|
public Volume volQualityComponent; |
|
|
|
public AssetReference[] qualityVolumes; |
|
|
|
private static bool _loading; |
|
|
|
|
|
|
|
private void Awake() |
|
|
|
{ |
|
|
|
|
|
|
{ |
|
|
|
Instance = this; |
|
|
|
gameObject.name = "[DefaultVolume]"; |
|
|
|
Debug.Log($"Default Volume is {gameObject.GetInstanceID()}"); |
|
|
|
if (UniversalRenderPipeline.asset.debugLevel != PipelineDebugLevel.Disabled) |
|
|
|
Debug.Log($"Default Volume is {gameObject.GetInstanceID()}"); |
|
|
|
Utility.QualityLevelChange += UpdateVolume; |
|
|
|
UpdateVolume(0, Utility.GetTrueQualityLevel()); // First time set
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
private IEnumerator LoadAndApplyQualityVolume(int index) |
|
|
|
{ |
|
|
|
while (_loading) { yield return null; } |
|
|
|
_loading = true; |
|
|
|
if (!vol.OperationHandle.IsValid() || vol.OperationHandle.Status != AsyncOperationStatus.Succeeded) |
|
|
|
if (!vol.OperationHandle.IsValid() || !vol.OperationHandle.IsDone) |
|
|
|
_loading = false; |
|
|
|
|
|
|
|
if (UniversalRenderPipeline.asset.debugLevel == PipelineDebugLevel.Disabled) yield break; |
|
|
|
if (volBaseComponent.sharedProfile && volQualityComponent.sharedProfile) |
|
|
|
|
|
|
#endif
|
|
|
|
static void LoadMe() |
|
|
|
{ |
|
|
|
Debug.Log("runtime loading"); |
|
|
|
var vols = Resources.FindObjectsOfTypeAll(typeof(DefaultVolume)) as DefaultVolume[]; |
|
|
|
if (vols == null) return; |
|
|
|
|
|
|
|