Description
The Create
method is a static method of the Editor.ControlWidget
class. It is used to create a new instance of a ControlWidget
for a given SerializedProperty
. This method is essential for generating UI controls in the editor that allow users to interact with and modify serialized properties of game objects or components.
Usage
To use the Create
method, you need to pass a SerializedProperty
object as a parameter. This property represents the data you want to edit using the control widget. The method returns an instance of Editor.ControlWidget
, which can then be used to manipulate the property in the editor.
Example
// Example of using the Create method
Sandbox.SerializedProperty myProperty = ...; // Assume this is initialized properly
Editor.ControlWidget widget = Editor.ControlWidget.Create(myProperty);
// Now you can use the widget to interact with the property in the editor