Description
The Indent
field in the Editor.VirtualWidget
class represents the indentation level of the widget. It is a public, non-static field of type System.Single
, which means it holds a floating-point value. This field is used to determine how much the widget is indented within its parent container or layout.
Usage
To use the Indent
field, you can directly access it from an instance of the VirtualWidget
class. You can set or get its value to adjust the indentation of the widget.
For example, if you want to increase the indentation of a widget, you can increment the Indent
field:
var widget = new VirtualWidget();
widget.Indent += 10.0f; // Increase indentation by 10 units
Example
// Example of using the Indent field
// Create a new instance of VirtualWidget
VirtualWidget widget = new VirtualWidget();
// Set the indentation level
widget.Indent = 15.0f;
// Access the current indentation level
float currentIndent = widget.Indent;
// Output the current indentation level
// Note: Avoid using Console.WriteLine in s&box
// Instead, use appropriate logging or debugging tools
// Debug.Log($"Current Indent: {currentIndent}");