3.8. C# UI.Components

3.8.1. UiCollapsible.cs

class UI.Components.UiCollapsible : public MonoBehaviour

UI Component header that hides items when clicked/toggled.

Public Functions

void AddItem (GameObject item, bool setAsLastSibling = true)

Add an item to the group, visibility is immediately set

Parameters
  • setAsLastSibling: Add the item to the end of the group. Set this to false to have an item collapse/hide with this group but leave it in the place/sibling that it is.

void ToggleVisibility ()

Called from UI to change the visibility of the group’s items

void SetVisibility (bool value)

Change the visibility of the group’s items.

void Remove (GameObject item)

Remove an item from the collapsible. Will not delete the item.

void RemoveLast ()

Remove the last item from the group.

Public Members

TMP_Text title
RectTransform checkmarkIcon

Private Functions

void OnEnable ()

Private Members

readonly List<GameObject_items = new List<GameObject>()
bool _visible = true
int _lastSiblingIndex

3.8.2. UiIconAction.cs

class UI.Components.UiIconAction : public MonoBehaviour

UI Component with two buttons, one icon sized.

Public Members

Button iconBtn
Button actionBtn

3.8.3. UiToggleAction.cs

class UI.Components.UiToggleAction : public MonoBehaviour

A toggle and button UI element. The toggle and button are independent by default

Public Members

Toggle toggle
Button button
TMP_Text text

3.8.4. UiSelection.cs

class UI.Components.UiSelection : public MonoBehaviour

UI for one selection of a mesh (one row)

Public Functions

void Initialize (int selectionId, UiCollapsible uiCollapsible, LibiglBehaviour behaviour, IList<UiSelectionselections)
unsafe void ToggleVisible ()
unsafe void Clear (bool forceDelete = false)

Clears the selection and deletes it if it is already empty and the last one

Parameters
  • forceDelete: Delete this even if the selection is not empty. Still needs to be the last selection

unsafe void UpdateText ()
void ToggleEditSprite (bool isActive)

Public Members

TMP_Text text
Button visibleBtn
Button editBtn
Button clearBtn

Private Functions

void SetAsActive ()
void ToggleVisibleSprite (bool isVisible)

Private Members

Image visibleImage = null
Sprite visibleSprite = null
Sprite visibleOffSprite = null
Image editImage = null
Sprite editSprite = null
Sprite activeSprite = null
int _selectionId
UiCollapsible _uiCollapsible
LibiglBehaviour _behaviour
IList<UiSelection_selections

3.8.5. UiSelectionMode.cs

class UI.Components.UiSelectionMode : public MonoBehaviour

Handles the selection mode UI, onclick behaviour. There are several modes from SelectionMode as well as the newSelectionOnDrawBtn where a new selection is added on each stroke.

Public Functions

void Initialize ()
void Repaint ()

Public Members

Image[] icons
Color activeColor
Button newSelectionOnDrawBtn
Button discardSelectionOnDrawBtn

Private Functions

void SetMode (SelectionMode mode)
void ToggleNewSelectionOnDraw ()
void RepaintNewSelectionOnDrawBtn ()
void ToggleDiscardSelectionOnDraw ()
void RepaintDiscardSelectionOnDrawBtn ()

Private Members

SelectionMode _mode

3.8.6. UiPivotMode.cs

class UI.Components.UiPivotMode : public MonoBehaviour

Similar to UiSelectionMode, effectively an enum field.

Public Functions

void Initialize ()
void Repaint ()

Public Members

Image[] icons
Color activeColor

Private Functions

void OnDestroy ()
void SetMode (PivotMode mode)

Private Members

PivotMode _mode

3.8.7. UiProgressIcon.cs

class UI.Components.UiProgressIcon : public MonoBehaviour

Handles showing the progress icon and animating it based on the PreExecute and PostExecute. This indicates the state of the libigl thread.

Public Functions

void PreExecute ()
void PostExecute ()

Public Members

Gradient progressGradient
float progressDelayTime = 1f
float timeoutTime = 9f
Sprite progressErrorSprite

Private Functions

void Start ()
IEnumerator ShowProgressAfterTime ()

Coroutine that animates progress icon over time. Can be stopped

Private Members

Image _backgroundImage
Image _iconImage
Sprite _defaultSprite
Coroutine _progressCoroutine