|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// index is only used when we need to re-create a component in a specific spot (e.g. reset)
|
|
|
|
void CreateEditor(VolumeComponent settings, SerializedProperty property, int index = -1) |
|
|
|
void CreateEditor(VolumeComponent settings, SerializedProperty property, int index = -1, bool forceOpen = false) |
|
|
|
{ |
|
|
|
var settingsType = settings.GetType(); |
|
|
|
Type editorType; |
|
|
|
|
|
|
var editor = (VolumeComponentEditor)Activator.CreateInstance(editorType); |
|
|
|
editor.Init(settings, this); |
|
|
|
editor.baseProperty = property.Copy(); |
|
|
|
|
|
|
|
if (forceOpen) |
|
|
|
editor.baseProperty.isExpanded = true; |
|
|
|
|
|
|
|
if (index < 0) |
|
|
|
m_Editors.Add(editor); |
|
|
|
|
|
|
effectProp.objectReferenceValue = component; |
|
|
|
|
|
|
|
// Create & store the internal editor object for this effect
|
|
|
|
CreateEditor(component, effectProp); |
|
|
|
CreateEditor(component, effectProp, forceOpen: true); |
|
|
|
|
|
|
|
serializedObject.ApplyModifiedProperties(); |
|
|
|
} |
|
|
|