3.7. C# UI¶
3.7.1. UiManager.cs¶
-
class
UI.UiManager: public MonoBehaviour¶ Handles easy creation of operations to be done on a mesh and the user interaction (2D UI, speech, gestures) that comes with it.
Public Functions
-
UiMeshDetails
CreateDetailsPanel()¶ Creates a new Details panel and initializes it
- Return
The Vertical Scroll List parent to which items can be added as a child
Public Members
-
GameObject
meshDetailsCanvasPrefab¶
-
GameObject
headerPrefab¶
-
GameObject
groupPrefab¶
-
GameObject
textPrefab¶
-
GameObject
togglePrefab¶
-
GameObject
toggleActionPrefab¶
-
GameObject
iconActionPrefab¶
-
GameObject
selectionPrefab¶
-
GameObject
selectionModePrefab¶
-
GameObject
pivotModePrefab¶
-
MeshRenderer[]
toggleUvGridRenderers¶
-
const int
UiLayer= 5¶
-
UiPivotMode
CurrentPivotMode¶
Private Functions
-
void
Awake()¶
-
void
Start()¶
-
void
InitializeStaticUi()¶ Generates the UI unrelated to a mesh or to manipulate the active mesh MeshManager.ActiveMesh
-
void
CreateActionSpeechUi(string uiText, UnityAction onClick, UiCollapsible collapsible = null, string[] speechKeywords = null)¶ Generates UI, gesture and speed entry points based on an action
- Parameters
onClick: Code to execute when an entry point is triggeredcollapsible: The group to add this item under
-
void
OnDestroy()¶
Private Members
-
bool
_isShowingUvGrid¶
-
UiCollapsible
_toolGroup¶
-
UiCollapsible
_meshGroup¶
-
UiCollapsible
_debugGroup¶
-
UiMeshDetails
3.7.2. UiMeshDetails.cs¶
-
class
UI.UiMeshDetails: public MonoBehaviour¶ Contains all functionality related to the mesh UI panel. There is one of these per LibiglMesh. Contains most UI generation.
Public Functions
-
void
Initialize(LibiglBehaviour behaviour)¶ Main function where UI is generated.
- Parameters
behaviour: The behaviour we are generating the UI panel for.
-
void
OnDestroy()¶
-
void
UpdatePreExecute()¶ Called in PreExecute just before the input is consumed
-
void
UpdatePostExecute()¶ Update the UI Details panel after executing
-
bool
AddSelection()¶ - Return
true if selection was successfully added, max 32 selections
Private Functions
-
void
RepaintActiveMesh()¶ Repaint based on which mesh is active. Should be called when MeshManager.OnActiveMeshChanged
Also called when the object is created as this happens just after a mesh was set
-
void
RepaintActiveSelection()¶ Repaint the active selection. Should be called when LibiglBehaviour.OnActiveSelectionChanged.
-
void
UpdateVertexCountText()¶
Private Members
-
LibiglBehaviour
_behaviour¶ Access to the behaviour that this UI panel belongs to
-
Transform
_listParent¶ The content of the scroll list view, add new components as a child of this transform.
-
UiCollapsible
_selectionGroup¶
-
readonly List<UiSelection>
_selections= new List<UiSelection>()¶
-
int
_activeSelectionId= -1¶ The active selection displayed in the UI
-
UiCollapsible
_debugGroup¶
-
UiToggleAction
_harmonicToggle¶
-
UiToggleAction
_arapToggle¶
-
void