class
GUIGameObjectField
GUI object that displays a field in which a GameObject can be dragged and dropped.
The field accepts a GameObject of a specific type and displays an optional label.
Public
Methods
staticGetGuiTypeName
Returns type name of the GUI element used for finding GUI element styles.
SetValue
Represents game object currently referenced by the field, if any.
GetValue
staticCreate
Creates a new GUI element.
- contents
- Structure describing the contents of the GUI element to create.
- styleClass
- Style class that will be used for determining GUI element visuals from the current style sheet. If no class is provided, default style is determined based on GUI element type.
- options
- Additional options that control GUI element size and position. This will override options set in the style sheet.
Fields
OnValueChanged
Triggered whenever the referenced game object changes.
Internal
Constructors
GUIGameObjectField
Methods
UpdateLayoutForChildren
Calculates sizes and relative positions for all child elements.
Should be preceded with a call to UpdateOptimalLayoutSizes().
CalculateUnconstrainedOptimalSize
Calculates the optimal size for the GUI element, ignoring size constraints.
Private
Methods
~GUIGameObjectField
SetValue
Sets the game object referenced by the field.
- value
- Game object to reference.
- triggerEvent
- Determines should the onValueChanged() event be triggered if the new object is different from the previous one.
DataDropped
Triggered when a drag and drop operation finishes over this element.
OnDropButtonClicked
Triggered when the drop button that displays the game object label is clicked.
OnClearButtonClicked
Triggered when the clear button is clicked.