/// <summary> /// Initializes a new instance of the <see cref="VariableNodeSocket"/> class. /// </summary> /// <param name="node">The node where the script node socket will be used.</param> /// <param name="nodeSocketData">The node socket data of the script node socket.</param> public VariableNodeSocket(Node node, NodeSocketData nodeSocketData) : base(node, nodeSocketData) { _value = VarFactory.Create(nodeSocketData.VariableType); _visible = nodeSocketData.Visible; _connections = new List <Variable>(); // set default value if (NodeSocketData.DefaultValue != null) { Value.SetValue(NodeSocketData.DefaultValue); } }
/// <summary> /// Initializes a new instance of the <see cref="NamedVariable"/> class. /// </summary> /// <param name="scriptingComponent"><see cref="Scripting.ScriptingComponent"/> where the named variable will be used.</param> /// <param name="variableType">Type of the variable.</param> public NamedVariable(ScriptingComponent scriptingComponent, VariableType variableType) { _scriptingComponent = scriptingComponent; _value = VarFactory.Create(variableType); }
/// <summary> /// Initializes a new instance of the <see cref="Variable"/> class. /// </summary> /// <param name="state">The state where the script variable will be used.</param> /// <param name="variableType">Type of the variable.</param> public Variable(State state, VariableType variableType) : base(state) { _value = VarFactory.Create(variableType); }