Skip to content

Commit 0a8d247

Browse files
authored
StateVisualizer: Add protected access to some internal members to allow subclassing to add new states (#926)
* StateVisualizer: Add protected access to some internal members to allow subclassing to add new states * Update changelog and version * Reset patch version to 0
1 parent 14fcf76 commit 0a8d247

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

org.mixedrealitytoolkit.uxcore/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
44

5+
## [3.3.0-development] - 2024-09-12
6+
7+
### Changed
8+
9+
* StateVisualizer: Modified access modifiers of State, stateContainers and UpdateStateValue to protected internal to allow adding states through subclassing. [PR #926](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/926)
10+
511
## [3.2.2-development] - 2024-08-29
612

713
### Changed

org.mixedrealitytoolkit.uxcore/StateVisualizer/StateVisualizer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class StateVisualizer : MonoBehaviour
4141
/// the value is submitted.
4242
/// </remarks>
4343
[Serializable]
44-
internal class State
44+
protected internal class State
4545
{
4646
[SerializeReference]
4747
[Tooltip("The list of effects to apply.")]
@@ -87,7 +87,7 @@ public bool IsVariable
8787
/// The collection of feedback states that this <see cref="StateVisualizer"/> operates on.
8888
/// </summary>
8989
[SerializeField]
90-
internal SerializableDictionary<string, State> stateContainers = new SerializableDictionary<string, State>();
90+
protected internal SerializableDictionary<string, State> stateContainers = new SerializableDictionary<string, State>();
9191

9292
// Default states that are written at validation + startup.
9393
private readonly Dictionary<string, State> defaultStates = new Dictionary<string, State>()
@@ -422,7 +422,7 @@ protected virtual bool UpdateStateValues()
422422
/// <returns>
423423
/// <see langword="true"/> if the parameter was changed this frame, <see langword="false"/> if it remained constant.
424424
/// </returns>
425-
internal bool UpdateStateValue(string stateName, float newValue)
425+
protected internal bool UpdateStateValue(string stateName, float newValue)
426426
{
427427
if (stateContainers.TryGetValue(stateName, out var state))
428428
{

org.mixedrealitytoolkit.uxcore/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "org.mixedrealitytoolkit.uxcore",
3-
"version": "3.2.2-development",
3+
"version": "3.3.0-development",
44
"description": "Core interaction and visualization scripts for building MR UI components. Intended to be consumed when building UX libraries. For pre-existing library of components see the UX Components package.",
55
"displayName": "MRTK UX Core Scripts",
66
"msftFeatureCategory": "MRTK3",

0 commit comments

Comments
 (0)