No way to set Interactable / Checkbox to checked on start?
Overview
I can't seem to find any way to set an Interactable / checkbox to start checked.
Expected Behavior
Property that allows setting checkbox to checked
Actual Behavior
Can't find property
Steps to reproduce
(Links to sample github project preferred)
Unity Editor Version
2018.3.8f1
Mixed Reality Toolkit Release Version
vNext Beta 2
Achievable like this:
- in
MixedRealityToolkit.SDK\Features\UX\Interactable\Scripts\Interactable.csscript add a fieldpublic int DefaultDimension = 0; - at the end of
Awake()method set the dimension index like this:SetDimensionIndex(DefaultDimension); - to expose it in inspector add these 2 lines in
MixedRealityToolkit.SDK\Inspectors\UX\Interactable\InteractableInspector.csinsideRenderCustomInspector()method:
SerializedProperty defaultDimension = serializedObject.FindProperty("DefaultDimension");
defaultDimension.intValue = EditorGUILayout.IntField(new GUIContent("Default Dimension", "Active dimension on start"), defaultDimension.intValue);
Set the "Default Dimension" to 1 in inspector if you want your toggle to be "Selected" by default
Created PR #5069 for potential fix. I know it's more than what we are asking here. https://github.com/microsoft/MixedRealityToolkit-Unity/pull/5069
fixed
Finally, what is the property to know if a checkbox is checked ? or to check/uncheck it ?
I believe it's IsToggled.