Description
The Enabled
property of the AxisAttribute
class in the Sandbox.ModelEditor
namespace is a string that represents the internal name of a boolean key. This key determines whether the axis helper should be drawn. If the key is not set, the helper will always be drawn by default.
Usage
To use the Enabled
property, you can assign a string that corresponds to a boolean key. This key will control the visibility of the axis helper in the model editor. If the key evaluates to true
, the helper will be drawn; otherwise, it will not be drawn.
Example
// Example of using the Enabled property
public class MyModelEditorComponent : Component
{
[AxisAttribute(Enabled = "showAxisHelper")]
public void ConfigureAxis()
{
// Configuration logic for the axis
}
public void Update()
{
// Assume 'showAxisHelper' is a boolean key in your configuration
bool showAxisHelper = GetBooleanKey("showAxisHelper");
if (showAxisHelper)
{
// Logic to draw the axis helper
}
}
private bool GetBooleanKey(string key)
{
// Logic to retrieve the boolean value associated with the key
// This is a placeholder for actual implementation
return true; // Example return value
}
}