1
0
mirror of https://github.com/Siccity/xNode.git synced 2026-03-26 22:49:02 +08:00
xNode/Samples~/StateMachine/Editor/StateGraphEditor.cs
Wang Cong 7b480b6242 changed: move folder Examples into Samples~
In Package Manager UI 2.0 (compatible with Unity 2019.1), you can include samples in a package.
    https://forum.unity.com/threads/samples-in-packages-manual-setup.623080/
2019-10-21 11:37:56 +08:00

21 lines
719 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using XNode.Examples.StateGraph;
using XNodeEditor;
namespace XNodeEditor.Examples {
[CustomNodeGraphEditor(typeof(StateGraph))]
public class StateGraphEditor : NodeGraphEditor {
/// <summary>
/// Overriding GetNodeMenuName lets you control if and how nodes are categorized.
/// In this example we are sorting out all node types that are not in the XNode.Examples namespace.
/// </summary>
public override string GetNodeMenuName(System.Type type) {
if (type.Namespace == "XNode.Examples.StateGraph") {
return base.GetNodeMenuName(type).Replace("X Node/Examples/State Graph/", "");
} else return null;
}
}
}