Click or drag to resize

VisualSetNativeObject Method

Set the native C# scripting class instance for this visual

Namespace:  Demo3D.Visuals
Assembly:  Demo3D.Core (in Demo3D.Core.dll) Version: 15.0.2.11458
Syntax
C#
public void SetNativeObject(
	Object value,
	bool autoWire = true
)

Parameters

value
Type: SystemObject
The C# class instance
autoWire (Optional)
Type: SystemBoolean
If true, wire up all the [Auto] properties/events. Defaults to true.
Remarks
This should generally only be used inside the constructor for a C# scripting object. It will set the Visual.NativeObject property and (if autoWire is true) after that point the value of any [Auto] fields or properties on the Visual.NativeObject will have been correctly initialized
Examples
C#
[Auto] SimplePropertyValue<string> prop;

BoxScript(Visual sender) {
    sender.SetNativeObject(this);
    // You can now use "prop"
    print(prop.Value);
}
See Also