Class UIElement
Used for displaying a field or property in the settings menu
Inheritance
Implements
Namespace: WeaverCore.Settings.Elements
Assembly: WeaverCore.dll
Syntax
public abstract class UIElement : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler
Properties
| Edit this page View SourceFieldAccessor
The accessor used for retrieving the value of the field or property
Declaration
public IAccessor FieldAccessor { get; }
Property Value
Type | Description |
---|---|
IAccessor |
Order
The order in which the UI element is arranged on the settings menu
Declaration
public int Order { get; set; }
Property Value
Type | Description |
---|---|
int |
Panel
Declaration
public GlobalSettings Panel { get; }
Property Value
Type | Description |
---|---|
GlobalSettings |
Title
The title of the UI Element
Declaration
public string Title { get; set; }
Property Value
Type | Description |
---|---|
string |
TitleComponent
The title component of the UI Element
Declaration
public TextMeshProUGUI TitleComponent { get; set; }
Property Value
Type | Description |
---|---|
TextMeshProUGUI |
Visible
Whether the UIElement is visible
Declaration
public bool Visible { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceCanWorkWithAccessor(IAccessor)
Whether or not this UI Element can work with the specified accessor
Declaration
public abstract bool CanWorkWithAccessor(IAccessor accessor)
Parameters
Type | Name | Description |
---|---|---|
IAccessor | accessor | The accessor to check against |
Returns
Type | Description |
---|---|
bool |
MoveDown()
Moves the UI Element down by one
Declaration
public void MoveDown()
MoveToBottom()
Moves the UI Element to the bottom of the settings menu
Declaration
public void MoveToBottom()
MoveToTop()
Moves the UI Element to the top of the settings menu
Declaration
public void MoveToTop()
MoveUp()
Moves the UI Element up by one
Declaration
public void MoveUp()
OnAccessorChanged(IAccessor)
Called whenever the accessor gets changed
Declaration
protected virtual void OnAccessorChanged(IAccessor accessor)
Parameters
Type | Name | Description |
---|---|---|
IAccessor | accessor | The new accessor |
OnPointerEnter(PointerEventData)
Called when the mouse hovers over the ui element. Default behaviour is to call SetDescription(string) to update the description
Declaration
public virtual void OnPointerEnter(PointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
PointerEventData | eventData |
Refresh()
Refreshes the UI Element so it's displaying the most recent version of the field or property
Declaration
public void Refresh()
Events
| Edit this page View SourceDisplayValueUpdated
Declaration
public event Action<IAccessor> DisplayValueUpdated
Event Type
Type | Description |
---|---|
Action<IAccessor> |