Forums › 💬 NodeCanvas › ⚙️ Support › [BUG] Node became "detached" and doubling, when Unity Editor window lost focus › Reply To: [BUG] Node became "detached" and doubling, when Unity Editor window lost focus
Here’s a stack trace of what gets called when the node is duplicated (or rather pasted) on switching back to unity:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
DUPLICATED UnityEngine.Debug:Log(Object) NodeCanvas.DialogueTrees.MotivitiLocSay:OnValidate(Graph) (at Assets/NodeCanvas-I2Localization-master/unity-project/Assets/NodeCanvas Integrations/I2 Localization/Nodes/MotivitiLocSay.cs:146) NodeCanvas.Framework.Node:Duplicate(Graph) (at Assets/ParadoxNotion/NodeCanvas/Framework/Runtime/Graphs/Node.cs:241) NodeCanvas.Framework.Graph:CloneNodes(List1, Graph, Vector2) (at Assets/ParadoxNotion/NodeCanvas/Framework/Runtime/Graphs/Graph.cs:435) NodeCanvas.Editor.GraphEditor:TryPasteNodesInGraph(Graph, Node[], Vector2) (at Assets/ParadoxNotion/NodeCanvas/Framework/Design/Editor/Windows/GraphEditor_Events.cs:173) NodeCanvas.Editor.GraphEditor:HandlePostNodesGraphEvents(Graph, Vector2) (at Assets/ParadoxNotion/NodeCanvas/Framework/Design/Editor/Windows/GraphEditor_Events.cs:86) NodeCanvas.Editor.GraphEditor:OnGUI() (at Assets/ParadoxNotion/NodeCanvas/Framework/Design/Editor/Windows/GraphEditor.cs:528) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) Ending up here (in our custom code): public override void OnValidate(Graph assignedGraph) { System.Diagnostics.StackTrace stackTrace = new System.Diagnostics.StackTrace(); if (stackTrace.GetFrame(1).GetMethod().Name == "Duplicate") //gets the name of the method, that called OnValidate(). because, only Duplicate() must trigger next code { Debug.Log("DUPLICATED"); wasDuplicated = true; completeID = null; completeID = GetId(); UpdateEnglishText(); } base.OnValidate(assignedGraph); } |
