public static NodeInput Create(string InputName, IOtype type) { NodeInput input = NodeInput.CreateInstance (typeof (NodeInput)) as NodeInput; input.type = type; input.name = InputName; return input; }
public static NodeInput Create(string InputName, IOtype type) { NodeInput input = NodeInput.CreateInstance(typeof(NodeInput)) as NodeInput; input.type = type; input.name = InputName; return(input); }
/// <summary> /// Creates a new NodeInput in NodeBody of specified type /// </summary> public static NodeInput Create(Node NodeBody, string InputName, IOtype type) { NodeInput input = NodeInput.CreateInstance (typeof (NodeInput)) as NodeInput; input.body = NodeBody; input.type = type; input.name = InputName; NodeBody.Inputs.Add (input); if (NodeBody.isSaved) AssetDatabase.AddObjectToAsset(input, NodeBody); EditorUtility.SetDirty(input); return input; }
/// <summary> /// Creates a new NodeOutput in NodeBody of specified type /// </summary> public static NodeOutput Create(Node NodeBody, string OutputName, IOtype type) { NodeOutput output = NodeOutput.CreateInstance (typeof (NodeOutput)) as NodeOutput; output.body = NodeBody; output.type = type; output.name = OutputName; NodeBody.Outputs.Add (output); if (NodeBody.isSaved) AssetDatabase.AddObjectToAsset(output, NodeBody); EditorUtility.SetDirty(output); return output; }
/// <summary> /// Creates a new NodeInput in NodeBody of specified type /// </summary> public static NodeInput Create(Node NodeBody, string InputName, IOtype type) { NodeInput input = NodeInput.CreateInstance(typeof(NodeInput)) as NodeInput; input.body = NodeBody; input.type = type; input.name = InputName; NodeBody.Inputs.Add(input); if (NodeBody.isSaved) { AssetDatabase.AddObjectToAsset(input, NodeBody); } EditorUtility.SetDirty(input); return(input); }