public override void OnInspectorGUI() { CallFunctionNode node = (CallFunctionNode)target; SerializedProperty prop = serializedObject.FindProperty("function"); EditorGUIUtility.LookLikeControls(); EditorGUILayout.PropertyField(prop); //<--- NullReferenceException: SerializedObject of SerializedProperty has been Disposed. if (GUI.changed) { serializedObject.ApplyModifiedProperties(); } }
public override void VisitCallFunctionNode(CallFunctionNode node) { node.Name.Visit(this); var functionName = expressions.Pop(); var callFunction = InvocationExpression(functionName); foreach (var parameter in node.Arguments) { parameter.Expression.Visit(this); var arg = GetNodeWithAnnotation(Argument(expressions.Pop()), parameter.Location) as ArgumentSyntax; callFunction = callFunction.AddArgumentListArguments(arg); } callFunction = GetNodeWithAnnotation(callFunction, node.Location) as InvocationExpressionSyntax; expressions.Push(callFunction); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DropList_Drop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.StringFormat)) { try { string data = e.Data.GetData(DataFormats.StringFormat) as string; if (data.StartsWith(FlowGraphDataControl.DragPrefixFunction) == true) { string id = data.Split('#')[1]; SequenceFunction func = GraphDataManager.Instance.GetFunctionByID(int.Parse(id)); CallFunctionNode seqNode = new CallFunctionNode(func); ViewModel.CreateNode(seqNode, e.GetPosition(networkControl), false); } else if (data.StartsWith(FlowGraphDataControl.DragPrefixNamedVar) == true) { string name = data.Split('#')[1]; NamedVariableNode seqNode = new NamedVariableNode(name); ViewModel.CreateNode(seqNode, e.GetPosition(networkControl), false); } else if (data.StartsWith(FlowGraphDataControl.DragPrefixScriptElement) == true) { string idStr = data.Split('#')[1]; int id = int.Parse(idStr); ScriptElement el = GraphDataManager.Instance.GetScriptByID(id); ScriptNode seqNode = new ScriptNode(el); ViewModel.CreateNode(seqNode, e.GetPosition(networkControl), false); } } catch (System.Exception ex) { LogManager.Instance.WriteException(ex); } } }
public virtual void VisitCallFunctionNode(CallFunctionNode node) { }