/// <summary> /// Initialize the window from a character. /// </summary> private void InitializeFromCharacter() { mNodes = new List <NodeGraphWindowBaseNode>(); mConnections = new List <NodeGraphWindowBaseConnection>(); mCachedDialogAsset = kEditingDialog; if (mCachedDialogAsset == null) { return; } var nodes = mCachedDialogAsset.GetNodes_Editor(); foreach (BaseNode n in nodes) { mNodes.Add(new NodeGraphWindowBaseNode(n, GenerateNodeStyle(n.GetType()), OnRemoveNode, OnTryAddConnection)); } var conns = mCachedDialogAsset.GetConnections_Editor(); foreach (BaseConnection c in conns) { mConnections.Add(new NodeGraphWindowBaseConnection(c, OnRemoveConnection)); } }
/// <summary> /// Create a new window for the provided character. /// </summary> public static void CreateNewWindow(IDialogSpeaker dialogCharacter) { kEditingDialog = dialogCharacter.dialogAsset; NodeGraphEditorWindow window = GetWindow <NodeGraphEditorWindow>(); window.titleContent = new GUIContent("Node Dialog Editor"); window.OnEnable(); }