public static void Init(NodeType nT, object sT, NodePin pin, Vector2 pos, int count = 2) { Instance = GetWindow <NodeCreatePopup>(true); Instance.maxSize = new Vector2(200, 100); Instance.minSize = Instance.maxSize; Instance.nodeType = nT; Instance.subType = sT; Instance.mouseLoc = pos; Instance.pinToAttach = pin; Instance.posInp = new List <string>(); Instance.nodeCount = count; SetNCP(); switch (nT) { case NodeType.Function: FunctionNode.FunctionType f = (FunctionNode.FunctionType)sT; Instance.titleContent = new GUIContent("Create " + (f).ToString() + " Node"); Instance.posInp = FunctionNode.validCombos[f]; break; case NodeType.Math: MathNode.OpType t = (MathNode.OpType)sT; Instance.titleContent = new GUIContent("Create " + (t).ToString() + " Node"); Instance.posInp = MathNode.validCombos[t]; Instance.nodeCount = 2; break; case NodeType.Control: //Instance.titleContent = new GUIContent("Create " + ((ControlNode.ControlType)sT).ToString() + " Node"); Instance.titleContent = new GUIContent("Create Cast Node"); Instance.posInp = new List <string>(ControlNode.castables.Keys); break; case NodeType.Fetch: Instance.titleContent = new GUIContent("Fetch Variable"); // input from list of variables in database break; } if (Instance.nodeCount < 0 || Instance.posInp.Count == 1) { Instance.CreateNode(); } }