string GetInvalidText(GraphArgument argument, Parameter parameter) { if (parameter == null) { return("Not found parameter : \"" + argument.parameterName + "\""); } if (parameter.type != argument.parameterType) { return("The parameter type has been changed : \"" + argument.parameterName + "\""); } if ((parameter.type == Parameter.Type.Component || parameter.type == Parameter.Type.Enum) && parameter.referenceType != argument.type) { return("The reference type of the parameter has been changed : \"" + argument.parameterName + "\""); } if (parameter.type == Parameter.Type.Variable) { InputSlotTypable inputSlot = argument.isPublicSet ? _InputSlots[argument.parameterIndex] : null; OutputSlotTypable outputSlot = argument.isPublicGet ? _OutputSlots[argument.outputSlotIndex] : null; if (inputSlot != null && parameter.valueType != inputSlot.dataType || outputSlot != null && parameter.valueType != outputSlot.dataType) { return("The type of Variable has been changed : \"" + argument.parameterName + "\""); } } return(null); }
public void UpdateOutput(NodeGraph nodeGraph) { ParameterContainerInternal parameterContainer = nodeGraph.parameterContainer; if (parameterContainer == null) { return; } for (int i = 0, count = _Arguments.Count; i < count; ++i) { GraphArgument argument = _Arguments[i]; if (!argument.isPublicGet) { continue; } Parameter parameter = argument.parameterID != 0? parameterContainer.GetParam(argument.parameterID) : parameterContainer.GetParam(argument.parameterName); string invalidText = GetInvalidText(argument, parameter); if (!string.IsNullOrEmpty(invalidText)) { Debug.LogWarning(invalidText, nodeGraph); continue; } if (!parameter.isPublicGet) { Debug.LogWarning("Get of parameter is not public. : \"" + parameter.name + "\"", nodeGraph); continue; } OutputSlotTypable outputSlot = _OutputSlots[argument.outputSlotIndex]; if (outputSlot.dataType != parameter.valueType) { Debug.LogWarning("The type of the parameter has been changed : \"" + argument.parameterName + "\""); continue; } outputSlot.SetValue(parameter.value); } }