Skip to content

Commit 2ebe8b5

Browse files
authored
Allow the HandModel ModelPrefab property to be set at runtime. (#863)
* This aligns with the functionality of the deprecated ArticulatedHandController's ModelPrefab, which allowed runtime setting, that this HandModel is meant to replace.
1 parent 6bef678 commit 2ebe8b5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

org.mixedrealitytoolkit.input/Controllers/HandModel.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,18 @@ public class HandModel : MonoBehaviour
1717
{
1818
#region Properties
1919

20-
[SerializeField, Tooltip("The prefab of the MRTK Controller to show that will be automatically instantitated by this behaviour.")]
20+
[SerializeField, Tooltip("The prefab of the MRTK Controller to show that will be automatically instantiated by this behavior.")]
2121
private Transform modelPrefab;
2222

2323
/// <summary>
24-
/// The prefab of the model to show that will be automatically instantitated by this <see cref="MonoBehaviour"/>.
24+
/// The prefab of the model to show that will be automatically instantiated by this <see cref="MonoBehaviour"/>.
2525
/// </summary>
2626
/// <remarks>Expected to be XRNode.LeftHand or XRNode.RightHand.</remarks>
27-
public Transform ModelPrefab => modelPrefab;
27+
public Transform ModelPrefab
28+
{
29+
get => modelPrefab;
30+
set => modelPrefab = value;
31+
}
2832

2933
[SerializeField, Tooltip("The transform that is used as the parent for the model prefab when it is instantiated. Will be set to a new child GameObject if None.")]
3034
private Transform modelParent;

0 commit comments

Comments
 (0)