-
-
Notifications
You must be signed in to change notification settings - Fork 611
Graph Editors
Thor Brigsted edited this page May 23, 2018
·
18 revisions
[CustomNodeGraphEditor(typeof(MyGraph))]
public class MyGraphEditor : NodeGraphEditor {
}
- Add a unique EditorPrefs key to the attribute
[CustomNodeGraphEditor(typeof(MyGraph), "MyGraph.Settings")]
- Override GetDefaultPreferences(); to set default preferences
public override NodeEditorPreferences.Settings GetDefaultPreferences() {
return new NodeEditorPreferences.Settings() {
gridBgColor = Color.black,
gridLineColor = Color.white,
typeColors = new Dictionary<string, Color>() {
{ typeof(string).PrettyName(), Color.yellow },
{ typeof(MyType).PrettyName(), new Color(1,0.5f,0.6f) }
}
};
}