-
Notifications
You must be signed in to change notification settings - Fork 27
How to make Editor Create/Load only specific ScriptableGraphModel? #60
Copy link
Copy link
Open
Description
Currently I have:
//MapGraphModelInitializer.cs
using NewGraph;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
public class MapGraphModelInitializer
{
[InitializeOnLoadMethod]
private static void AddWindowType()
{
GraphWindow.AddWindowType(typeof(MapGraphModel), typeof(MapGraphInspectorController), MapGraphModel.GetGraphData);
}
[MenuItem(GraphSettings.menuItemBase + "MapGraph")]
private static void AddMenu()
{
GraphWindow.InitializeWindowBase(typeof(MapGraphModel));
Debug.Log(GraphWindow.currentWindowType);
}
}
public class MapGraphInspectorController : ScriptableInspectorControllerGeneric<MapGraphModel>
{
public MapGraphInspectorController(VisualElement parent)
: base(parent)
{
}
}//MapGraphModelEditor.cs
using NewGraph;
using UnityEditor;
[CustomEditor(typeof(MapGraphModel))]
public class MapGraphModelEditor : ScriptableGraphModelEditor
{
}//MapGraphModel.cs
using NewGraph;
public class MapGraphModel : ScriptableGraphModel
{
}But when I click Load in GraphWindow it shows all ScriptableModeGraph as options to load, instead of just my MapGraphModel
If I could ensure it to be saved as the right type would be easier to reference around the places without worrying about someone attach a graph from other context to this one.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
