A game about forced loneliness, made by TACStudios
1using System;
2
3namespace UnityEngine.Rendering
4{
5 public partial class ProbeVolume : MonoBehaviour
6 {
7 enum Version
8 {
9 Initial,
10 LocalMode,
11 InvertOverrideLevels,
12
13 Count
14 }
15
16 [SerializeField]
17 Version version = Version.Initial;
18
19 void Awake()
20 {
21 if (version == Version.Count)
22 return;
23
24 if (version == Version.LocalMode - 1)
25 {
26#pragma warning disable 618 // Type or member is obsolete
27 mode = globalVolume ? Mode.Scene : Mode.Local;
28#pragma warning restore 618
29
30 version++;
31 }
32 if (version == Version.InvertOverrideLevels - 1)
33 {
34 #if UNITY_EDITOR
35 ProbeVolumeBakingSet.SyncBakingSets();
36 var bakingSet = ProbeVolumeBakingSet.GetBakingSetForScene(gameObject.scene);
37 if (bakingSet != null)
38 {
39 int maxSubdiv = bakingSet != null ? bakingSet.simplificationLevels : 5;
40 int tmpLowest = lowestSubdivLevelOverride;
41 lowestSubdivLevelOverride = Mathf.Clamp(maxSubdiv - highestSubdivLevelOverride, 0, 5);
42 highestSubdivLevelOverride = Mathf.Clamp(maxSubdiv - tmpLowest, 0, 5);
43 }
44 #endif
45
46 version++;
47 }
48
49 #if UNITY_EDITOR
50 UnityEditor.EditorUtility.SetDirty(this);
51 #endif
52 }
53
54 /// <summary>
55 /// If is a global bolume
56 /// </summary>
57 [SerializeField, Obsolete("Use mode instead")]
58 public bool globalVolume = false;
59
60 }
61}