浏览代码

Force open just-added components

/namespace
Thomas 7 年前
当前提交
22b07e66
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 7
      ScriptableRenderPipeline/Core/Editor/Volume/VolumeEditor.cs

7
ScriptableRenderPipeline/Core/Editor/Volume/VolumeEditor.cs


}
// 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();
}

正在加载...
取消
保存