-
Thank you for great plugin NaughtyAttributes has EditorGUILayout.PropertyField replacement. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
That's a in plan feature (but not documented in milestone yet). However, even do, I'd prefer to implement one like Odin's At the moment it's not possible, yet. Before this feature is added, this is what I do daily on my work (only example of UI Toolkit, won't work for IMGUI): public class InRoundStatisticsPanel: ScriptableObject
{
public string[] files;
[Button]
public void ClickButton()
{
Debug.Log("clicked");
}
}
public class EditorInRoundStatisticsPanelEditorWindow: EditorWindow
{
[MenuItem("Tools/MyTools")]
public static void OpenWindow()
{
EditorWindow window = GetWindow(typeof(EditorInRoundStatisticsPanelEditorWindow), false, "MyTitle");
window.Show();
}
private InRoundStatisticsPanel _target;
public void CreateGUI()
{
VisualElement root = rootVisualElement;
_target ??= CreateInstance<InRoundStatisticsPanel>(); // or load data from some source
// do some data populate here...
UnityEditor.Editor editor = UnityEditor.Editor.CreateEditor(_target, typeof(SaintsEditor));
root.Add(new InspectorElement(editor));
}
private void OnDisable()
{
// TODO: save your changes of _target here, if you want
}
} |
Beta Was this translation helpful? Give feedback.
-
Hi, This feature has been added in 3.12.0 Now you can just do: using SaintsField.Editor;
public class Example: SaintsEditorWindow
{
[MenuItem("Tools/Example")]
public static void OpenWindow()
{
EditorWindow window = GetWindow<Example>(false, "Scriptable Editor");
window.Show();
}
// your logic here
public string[] files;
[Button]
public void ClickButton()
{
Debug.Log("clicked");
}
} And also two showcase, already documented in the README and saintsfield.comes.today ExamplePanel.mp4Unity_aTUNRhhBig.mp4 |
Beta Was this translation helpful? Give feedback.
That's a in plan feature (but not documented in milestone yet). However, even do, I'd prefer to implement one like Odin's
OdinWindow
, rather than a thing like NaughtyAttribute's solution.At the moment it's not possible, yet.
Before this feature is added, this is what I do daily on my work (only example of UI Toolkit, won't work for IMGUI):