public static void CreateComponent() { var obj = Selection.activeObject; var path = AssetDatabase.GetAssetPath(obj.GetInstanceID()); WindowComponentLibraryChooser.Show((element) => { element.CopyTo(path); }); }
public override void OnPreviewSettings() { base.OnPreviewSettings(); var comp = this.selectedComponent; if (comp != null && comp.tag != LayoutTag.None) { EditorGUIUtility.labelWidth = 100f; comp.component = EditorGUILayout.ObjectField(comp.description.ToLower().UppercaseWords(), comp.component, typeof(WindowComponent), false) as WindowComponent; if (GUILayout.Button("...") == true) { WindowComponentLibraryChooser.Show((element) => { comp.component = element.mainComponent; EditorUtility.SetDirty(comp.component); }); } EditorGUIUtility.LookLikeControls(); } }