Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit 1a73af5

Browse files
committed
Code conventions
1 parent 1ed5892 commit 1a73af5

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

PostProcessing/Editor/EffectListEditor.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace UnityEditor.Rendering.PostProcessing
99
{
1010
public sealed class EffectListEditor
1111
{
12-
public PostProcessProfile Asset { get; private set; }
12+
public PostProcessProfile asset { get; private set; }
1313
Editor m_BaseEditor;
1414

1515
SerializedObject m_SerializedObject;
@@ -29,7 +29,7 @@ public void Init(PostProcessProfile asset, SerializedObject serializedObject)
2929
Assert.IsNotNull(asset);
3030
Assert.IsNotNull(serializedObject);
3131

32-
Asset = asset;
32+
this.asset = asset;
3333
m_SerializedObject = serializedObject;
3434
m_SettingsProperty = serializedObject.FindProperty("settings");
3535
Assert.IsNotNull(m_SettingsProperty);
@@ -53,16 +53,16 @@ public void Init(PostProcessProfile asset, SerializedObject serializedObject)
5353
}
5454

5555
// 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));
5858

5959
// Keep track of undo/redo to redraw the inspector when that happens
6060
Undo.undoRedoPerformed += OnUndoRedoPerformed;
6161
}
6262

6363
void OnUndoRedoPerformed()
6464
{
65-
Asset.isDirty = true;
65+
asset.isDirty = true;
6666

6767
// Dumb hack to make sure the serialized object is up to date on undo (else there'll be
6868
// a state mismatch when this class is used in a GameObject inspector).
@@ -104,8 +104,8 @@ void RefreshEditors()
104104
m_Editors.Clear();
105105

106106
// 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));
109109
}
110110

111111
public void Clear()
@@ -124,17 +124,17 @@ public void Clear()
124124

125125
public void OnGUI()
126126
{
127-
if (Asset == null)
127+
if (asset == null)
128128
return;
129129

130-
if (Asset.isDirty)
130+
if (asset.isDirty)
131131
{
132132
RefreshEditors();
133-
Asset.isDirty = false;
133+
asset.isDirty = false;
134134
}
135135

136136
bool isEditable = !VersionControl.Provider.isActive
137-
|| AssetDatabase.IsOpenForEdit(Asset, StatusQueryOptions.UseCachedIfPossible);
137+
|| AssetDatabase.IsOpenForEdit(asset, StatusQueryOptions.UseCachedIfPossible);
138138

139139
using (new EditorGUI.DisabledScope(!isEditable))
140140
{
@@ -183,7 +183,7 @@ public void OnGUI()
183183
{
184184
var type = kvp.Key;
185185
var title = EditorUtilities.GetContent(kvp.Value.menuItem);
186-
bool exists = Asset.HasSettings(type);
186+
bool exists = asset.HasSettings(type);
187187

188188
if (!exists)
189189
menu.AddItem(title, false, () => AddEffectOverride(type));
@@ -206,8 +206,8 @@ void AddEffectOverride(Type type)
206206
Undo.RegisterCreatedObjectUndo(effect, "Add Effect Override");
207207

208208
// 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);
211211

212212
// Grow the list first, then add - that's how serialized lists work in Unity
213213
m_SettingsProperty.arraySize++;
@@ -220,9 +220,9 @@ void AddEffectOverride(Type type)
220220
m_SerializedObject.ApplyModifiedProperties();
221221

222222
// 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))
224224
{
225-
EditorUtility.SetDirty(Asset);
225+
EditorUtility.SetDirty(asset);
226226
AssetDatabase.SaveAssets();
227227
}
228228
}
@@ -264,7 +264,7 @@ void RemoveEffectOverride(int id)
264264
Undo.DestroyObjectImmediate(effect);
265265

266266
// Force save / refresh
267-
EditorUtility.SetDirty(Asset);
267+
EditorUtility.SetDirty(asset);
268268
AssetDatabase.SaveAssets();
269269
}
270270

@@ -289,7 +289,7 @@ void ResetEffectOverride(Type type, int id)
289289
Undo.RegisterCreatedObjectUndo(newEffect, "Reset Effect Override");
290290

291291
// Store this new effect as a subasset so we can reference it safely afterwards
292-
AssetDatabase.AddObjectToAsset(newEffect, Asset);
292+
AssetDatabase.AddObjectToAsset(newEffect, asset);
293293

294294
// Put it in the reserved space
295295
property.objectReferenceValue = newEffect;
@@ -304,7 +304,7 @@ void ResetEffectOverride(Type type, int id)
304304
Undo.DestroyObjectImmediate(prevSettings);
305305

306306
// Force save / refresh
307-
EditorUtility.SetDirty(Asset);
307+
EditorUtility.SetDirty(asset);
308308
AssetDatabase.SaveAssets();
309309
}
310310

PostProcessing/Editor/PostProcessVolumeEditor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public override void OnInspectorGUI()
148148
}
149149
else
150150
{
151-
if (assetHasChanged || profileRef != m_EffectList.Asset) //Refresh when the user just dragged in a new asset, or when it was instantiated by code.
151+
if (assetHasChanged || profileRef != m_EffectList.asset) //Refresh when the user just dragged in a new asset, or when it was instantiated by code.
152152
RefreshEffectListEditor(profileRef);
153153

154154
if (!multiEdit)

0 commit comments

Comments
 (0)