@@ -9,7 +9,7 @@ namespace UnityEditor.Rendering.PostProcessing
9
9
{
10
10
public sealed class EffectListEditor
11
11
{
12
- public PostProcessProfile Asset { get ; private set ; }
12
+ public PostProcessProfile asset { get ; private set ; }
13
13
Editor m_BaseEditor ;
14
14
15
15
SerializedObject m_SerializedObject ;
@@ -29,7 +29,7 @@ public void Init(PostProcessProfile asset, SerializedObject serializedObject)
29
29
Assert . IsNotNull ( asset ) ;
30
30
Assert . IsNotNull ( serializedObject ) ;
31
31
32
- Asset = asset ;
32
+ this . asset = asset ;
33
33
m_SerializedObject = serializedObject ;
34
34
m_SettingsProperty = serializedObject . FindProperty ( "settings" ) ;
35
35
Assert . IsNotNull ( m_SettingsProperty ) ;
@@ -53,16 +53,16 @@ public void Init(PostProcessProfile asset, SerializedObject serializedObject)
53
53
}
54
54
55
55
// Create editors for existing settings
56
- for ( int i = 0 ; i < Asset . settings . Count ; i ++ )
57
- CreateEditor ( Asset . settings [ i ] , m_SettingsProperty . GetArrayElementAtIndex ( i ) ) ;
56
+ for ( int i = 0 ; i < this . asset . settings . Count ; i ++ )
57
+ CreateEditor ( this . asset . settings [ i ] , m_SettingsProperty . GetArrayElementAtIndex ( i ) ) ;
58
58
59
59
// Keep track of undo/redo to redraw the inspector when that happens
60
60
Undo . undoRedoPerformed += OnUndoRedoPerformed ;
61
61
}
62
62
63
63
void OnUndoRedoPerformed ( )
64
64
{
65
- Asset . isDirty = true ;
65
+ asset . isDirty = true ;
66
66
67
67
// Dumb hack to make sure the serialized object is up to date on undo (else there'll be
68
68
// a state mismatch when this class is used in a GameObject inspector).
@@ -104,8 +104,8 @@ void RefreshEditors()
104
104
m_Editors . Clear ( ) ;
105
105
106
106
// Recreate editors for existing settings, if any
107
- for ( int i = 0 ; i < Asset . settings . Count ; i ++ )
108
- CreateEditor ( Asset . settings [ i ] , m_SettingsProperty . GetArrayElementAtIndex ( i ) ) ;
107
+ for ( int i = 0 ; i < asset . settings . Count ; i ++ )
108
+ CreateEditor ( asset . settings [ i ] , m_SettingsProperty . GetArrayElementAtIndex ( i ) ) ;
109
109
}
110
110
111
111
public void Clear ( )
@@ -124,17 +124,17 @@ public void Clear()
124
124
125
125
public void OnGUI ( )
126
126
{
127
- if ( Asset == null )
127
+ if ( asset == null )
128
128
return ;
129
129
130
- if ( Asset . isDirty )
130
+ if ( asset . isDirty )
131
131
{
132
132
RefreshEditors ( ) ;
133
- Asset . isDirty = false ;
133
+ asset . isDirty = false ;
134
134
}
135
135
136
136
bool isEditable = ! VersionControl . Provider . isActive
137
- || AssetDatabase . IsOpenForEdit ( Asset , StatusQueryOptions . UseCachedIfPossible ) ;
137
+ || AssetDatabase . IsOpenForEdit ( asset , StatusQueryOptions . UseCachedIfPossible ) ;
138
138
139
139
using ( new EditorGUI . DisabledScope ( ! isEditable ) )
140
140
{
@@ -183,7 +183,7 @@ public void OnGUI()
183
183
{
184
184
var type = kvp . Key ;
185
185
var title = EditorUtilities . GetContent ( kvp . Value . menuItem ) ;
186
- bool exists = Asset . HasSettings ( type ) ;
186
+ bool exists = asset . HasSettings ( type ) ;
187
187
188
188
if ( ! exists )
189
189
menu . AddItem ( title , false , ( ) => AddEffectOverride ( type ) ) ;
@@ -206,8 +206,8 @@ void AddEffectOverride(Type type)
206
206
Undo . RegisterCreatedObjectUndo ( effect , "Add Effect Override" ) ;
207
207
208
208
// Store this new effect as a subasset so we can reference it safely afterwards. Only when its not an instantiated profile
209
- if ( EditorUtility . IsPersistent ( Asset ) )
210
- AssetDatabase . AddObjectToAsset ( effect , Asset ) ;
209
+ if ( EditorUtility . IsPersistent ( asset ) )
210
+ AssetDatabase . AddObjectToAsset ( effect , asset ) ;
211
211
212
212
// Grow the list first, then add - that's how serialized lists work in Unity
213
213
m_SettingsProperty . arraySize ++ ;
@@ -220,9 +220,9 @@ void AddEffectOverride(Type type)
220
220
m_SerializedObject . ApplyModifiedProperties ( ) ;
221
221
222
222
// Force save / refresh. Important to do this last because SaveAssets can cause effect to become null!
223
- if ( EditorUtility . IsPersistent ( Asset ) )
223
+ if ( EditorUtility . IsPersistent ( asset ) )
224
224
{
225
- EditorUtility . SetDirty ( Asset ) ;
225
+ EditorUtility . SetDirty ( asset ) ;
226
226
AssetDatabase . SaveAssets ( ) ;
227
227
}
228
228
}
@@ -264,7 +264,7 @@ void RemoveEffectOverride(int id)
264
264
Undo . DestroyObjectImmediate ( effect ) ;
265
265
266
266
// Force save / refresh
267
- EditorUtility . SetDirty ( Asset ) ;
267
+ EditorUtility . SetDirty ( asset ) ;
268
268
AssetDatabase . SaveAssets ( ) ;
269
269
}
270
270
@@ -289,7 +289,7 @@ void ResetEffectOverride(Type type, int id)
289
289
Undo . RegisterCreatedObjectUndo ( newEffect , "Reset Effect Override" ) ;
290
290
291
291
// Store this new effect as a subasset so we can reference it safely afterwards
292
- AssetDatabase . AddObjectToAsset ( newEffect , Asset ) ;
292
+ AssetDatabase . AddObjectToAsset ( newEffect , asset ) ;
293
293
294
294
// Put it in the reserved space
295
295
property . objectReferenceValue = newEffect ;
@@ -304,7 +304,7 @@ void ResetEffectOverride(Type type, int id)
304
304
Undo . DestroyObjectImmediate ( prevSettings ) ;
305
305
306
306
// Force save / refresh
307
- EditorUtility . SetDirty ( Asset ) ;
307
+ EditorUtility . SetDirty ( asset ) ;
308
308
AssetDatabase . SaveAssets ( ) ;
309
309
}
310
310
0 commit comments