Class ButtonConfigHelper
Helper component that gathers the most commonly modified button elemtents in one place.
Namespace: Microsoft.MixedReality.Toolkit.UI
Assembly: cs.temp.dll.dll
Syntax
public class ButtonConfigHelper : MonoBehaviour
Properties
IconSet
The button's icon set. Note that setting this will not automatically assign an icon from the new set.
Declaration
public ButtonIconSet IconSet { get; set; }
Property Value
Type | Description |
---|---|
ButtonIconSet |
IconStyle
Modifies the button's icon rendering style.
Declaration
public ButtonIconStyle IconStyle { get; set; }
Property Value
Type | Description |
---|---|
ButtonIconStyle |
MainLabelText
Modifies the main label text.
Declaration
public string MainLabelText { get; set; }
Property Value
Type | Description |
---|---|
String |
OnClick
Returns the Interactable's OnClick event.
Declaration
public UnityEvent OnClick { get; }
Property Value
Type | Description |
---|---|
UnityEvent |
SeeItSayItLabelEnabled
Turns the see it / say it label object on / off.
Declaration
public bool SeeItSayItLabelEnabled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
SeeItSayItLabelText
Modifies the 'See it / Say it' label text.
Declaration
public string SeeItSayItLabelText { get; set; }
Property Value
Type | Description |
---|---|
String |
Methods
ForceRefresh()
Forces the config helper to apply its internal settings.
Declaration
public void ForceRefresh()
SetCharIcon(UInt32, UnityEngine.Object)
Sets the character for the button. This automatically sets the button icon style to Char.
Declaration
public void SetCharIcon(uint newIconChar, UnityEngine.Object newIconCharFont = null)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | newIconChar | Unicode string for new icon character. |
UnityEngine.Object | newIconCharFont | Optional TMPro font asset. If null, the existing font asset will be used. |
SetCharIconByName(String)
Searches the icon set for a character matching newIconCharName. If no icon set is available, or if no texture with that name is found, no action is taken.
Declaration
public void SetCharIconByName(string newIconCharName)
Parameters
Type | Name | Description |
---|---|---|
String | newIconCharName | Name of the new icon character as defined in the IconSet. |
SetQuadIcon(Texture)
Sets the quad texture for the button. This automatically sets the button icon style to Quad.
Declaration
public void SetQuadIcon(Texture newIconTexture)
Parameters
Type | Name | Description |
---|---|---|
Texture | newIconTexture |
SetQuadIconByName(String)
Searches the icon set for a texture matching newIconTextureName. If no icon set is available, or if no texture with that name is found, no action is taken.
Declaration
public void SetQuadIconByName(string newIconTextureName)
Parameters
Type | Name | Description |
---|---|---|
String | newIconTextureName | Name of the new icon texture asset. |
SetSpriteIcon(Sprite)
Sets the sprite for the button. This automatically sets the button icon style to Sprite.
Declaration
public void SetSpriteIcon(Sprite newIconSprite)
Parameters
Type | Name | Description |
---|---|---|
Sprite | newIconSprite |
SetSpriteIconByName(String)
Searches the icon set for a texture matching newIconSpriteName. If no icon set is available, or if no texture with that name is found, no action is taken.
Declaration
public void SetSpriteIconByName(string newIconSpriteName)
Parameters
Type | Name | Description |
---|---|---|
String | newIconSpriteName |