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: 19.01.00
Syntax
C#
public void SetNativeObject(
	Object value,
	bool autoWire = true
)

Parameters

value  Object
The C# class instance
autoWire  Boolean  (Optional)
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
Example
C#
[Auto] SimplePropertyValue<string> prop;

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