diff --git a/org.mixedrealitytoolkit.core/CHANGELOG.md b/org.mixedrealitytoolkit.core/CHANGELOG.md index f58f6423b..0bc7ca7c2 100644 --- a/org.mixedrealitytoolkit.core/CHANGELOG.md +++ b/org.mixedrealitytoolkit.core/CHANGELOG.md @@ -2,6 +2,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## Unreleased + +### Added + +* Added new `editorDefault` field for debugging the various `DisplayType`s in-editor. [PR #1130](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1130) + ## [4.0.0-pre.3] - 2026-05-20 ### Added diff --git a/org.mixedrealitytoolkit.core/Camera/CameraSettingsManager.cs b/org.mixedrealitytoolkit.core/Camera/CameraSettingsManager.cs index a4b0d5c90..24d650372 100644 --- a/org.mixedrealitytoolkit.core/Camera/CameraSettingsManager.cs +++ b/org.mixedrealitytoolkit.core/Camera/CameraSettingsManager.cs @@ -12,7 +12,10 @@ namespace MixedReality.Toolkit [AddComponentMenu("MRTK/Core/Camera Settings Manager")] public class CameraSettingsManager : MonoBehaviour { - [SerializeField] + [SerializeField, Tooltip("The default display type in the editor.")] + private DisplayType editorDefault = DisplayType.Transparent; + + [SerializeField, Tooltip("The settings to apply when the display is opaque (VR).")] private CameraSettings opaqueDisplay = new CameraSettings(DisplayType.Opaque); /// @@ -24,7 +27,7 @@ public CameraSettings OpaqueDisplay set => opaqueDisplay = value; } - [SerializeField] + [SerializeField, Tooltip("The settings to apply when the display is transparent (AR).")] private CameraSettings transparentDisplay = new CameraSettings(DisplayType.Transparent); /// @@ -81,7 +84,7 @@ private void UpdateCameraSettings(DisplayType type) { using (UpdateCameraSettingsPerfMarker.Auto()) { - UnityEngine.Camera mainCamera = Camera.main; + Camera mainCamera = Camera.main; switch (type) { @@ -133,7 +136,7 @@ private DisplayType GetDisplayType() { using (GetDisplayTypePerfMarker.Auto()) { - if (XRSubsystemHelpers.DisplaySubsystem == null) { return DisplayType.Unknown; } + if (XRSubsystemHelpers.DisplaySubsystem == null) { return Application.isEditor ? editorDefault : DisplayType.Unknown; } return XRSubsystemHelpers.DisplaySubsystem.displayOpaque ? DisplayType.Opaque : DisplayType.Transparent; } } diff --git a/org.mixedrealitytoolkit.core/package.json b/org.mixedrealitytoolkit.core/package.json index 7e450af30..4cb20d897 100644 --- a/org.mixedrealitytoolkit.core/package.json +++ b/org.mixedrealitytoolkit.core/package.json @@ -1,6 +1,6 @@ { "name": "org.mixedrealitytoolkit.core", - "version": "4.0.0-development.pre.3", + "version": "4.0.0-development.pre.4", "description": "A limited collection of common interfaces and utilities that most MRTK packages share. Most implementations of these interfaces are contained in other packages in the MRTK ecosystem.", "displayName": "MRTK Core Definitions", "msftFeatureCategory": "MRTK3", diff --git a/org.mixedrealitytoolkit.input/Assets/Prefabs/MRTK XR Rig.prefab b/org.mixedrealitytoolkit.input/Assets/Prefabs/MRTK XR Rig.prefab index c5f034143..e3a8ad08e 100644 --- a/org.mixedrealitytoolkit.input/Assets/Prefabs/MRTK XR Rig.prefab +++ b/org.mixedrealitytoolkit.input/Assets/Prefabs/MRTK XR Rig.prefab @@ -14,6 +14,8 @@ GameObject: - component: {fileID: 2351505566771328560} - component: {fileID: 2351505566771328561} - component: {fileID: 404949538145338360} + - component: {fileID: 2036977346182542242} + - component: {fileID: 9155035745778857788} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -28,13 +30,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2351505566771328562} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2351505566903569412} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!20 &2351505566771328527 Camera: @@ -50,9 +52,17 @@ Camera: m_projectionMatrixMode: 1 m_GateFitMode: 2 m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 m_SensorSize: {x: 36, y: 24} m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 m_NormalizedViewPortRect: serializedVersion: 2 x: 0 @@ -232,6 +242,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 80bee04b0b615324e81420c8aac0dc47, type: 3} m_Name: m_EditorClassIdentifier: + editorDefault: 1 opaqueDisplay: clearMode: 1 clearColor: {r: 0, g: 0, b: 0, a: 0} @@ -246,6 +257,38 @@ MonoBehaviour: farPlaneDistance: 50 adjustQualityLevel: 1 qualityLevel: 0 +--- !u!45 &2036977346182542242 +Skybox: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2351505566771328562} + m_Enabled: 1 + m_CustomSkybox: {fileID: 0} +--- !u!114 &9155035745778857788 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2351505566771328562} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 699100ca886480c4a94ced56b1ae0e94, type: 3} + m_Name: + m_EditorClassIdentifier: + themeDataSource: {fileID: 11400000, guid: 57993c46ea42acf4ca3067542443bc45, type: 2} + binders: + - rid: 8397413447246282960 + references: + version: 2 + RefIds: + - rid: 8397413447246282960 + type: {class: SkyboxMaterialBinder, ns: MixedReality.Toolkit.Theming, asm: MixedReality.Toolkit.Theming} + data: + k__BackingField: {fileID: 2036977346182542242} + k__BackingField: Skybox --- !u!1 &2351505566903569413 GameObject: m_ObjectHideFlags: 0 @@ -271,6 +314,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2351505566903569413} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 1.6, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -281,7 +325,6 @@ Transform: - {fileID: 5769779419222680683} - {fileID: 7294214612838230064} m_Father: {fileID: 2351505567455720332} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &3712792914886690938 MonoBehaviour: @@ -338,6 +381,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2351505567455720334} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -348,7 +392,6 @@ Transform: - {fileID: 1074856417076994631} - {fileID: 6448619845270702420} m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &4160709927669568829 MonoBehaviour: @@ -416,13 +459,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7735890427496681069} + serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2351505567455720332} - m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &8085333164323593313 MonoBehaviour: @@ -500,13 +543,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8479077998186684813} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 2351505567455720332} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &7720573869748407015 MonoBehaviour: @@ -549,6 +592,7 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 2351505566903569412} m_Modifications: - target: {fileID: 3021976565802998075, guid: d8a2a1f4b4f78754c86045f7a36fe424, type: 3} @@ -567,14 +611,6 @@ PrefabInstance: propertyPath: m_ActivateInput.m_InputActionReferencePerformed value: objectReference: {fileID: 0} - - target: {fileID: 6058071957502615222, guid: d8a2a1f4b4f78754c86045f7a36fe424, type: 3} - propertyPath: m_UpdateType - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6853218870844938225, guid: d8a2a1f4b4f78754c86045f7a36fe424, type: 3} - propertyPath: m_RootOrder - value: 1 - objectReference: {fileID: 0} - target: {fileID: 6853218870844938225, guid: d8a2a1f4b4f78754c86045f7a36fe424, type: 3} propertyPath: m_LocalPosition.x value: 0 @@ -620,6 +656,9 @@ PrefabInstance: value: MRTK Gaze Controller objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d8a2a1f4b4f78754c86045f7a36fe424, type: 3} --- !u!114 &529201713281613631 stripped MonoBehaviour: @@ -653,12 +692,9 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 2351505566903569412} m_Modifications: - - target: {fileID: 445577537456690332, guid: 2e5b90c191b94004182e55a48f0ca427, type: 3} - propertyPath: m_RootOrder - value: 2 - objectReference: {fileID: 0} - target: {fileID: 445577537456690332, guid: 2e5b90c191b94004182e55a48f0ca427, type: 3} propertyPath: m_LocalPosition.x value: 0 @@ -708,6 +744,9 @@ PrefabInstance: value: objectReference: {fileID: 529201713281613631} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 2e5b90c191b94004182e55a48f0ca427, type: 3} --- !u!4 &5769779419222680683 stripped Transform: @@ -730,6 +769,7 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 2351505567455720332} m_Modifications: - target: {fileID: 919676360596656614, guid: 02502921f64c38d48b14f1d6c2438b16, type: 3} @@ -748,10 +788,6 @@ PrefabInstance: propertyPath: m_Name value: MRTK Interaction Manager objectReference: {fileID: 0} - - target: {fileID: 7821592117992173402, guid: 02502921f64c38d48b14f1d6c2438b16, type: 3} - propertyPath: m_RootOrder - value: 2 - objectReference: {fileID: 0} - target: {fileID: 7821592117992173402, guid: 02502921f64c38d48b14f1d6c2438b16, type: 3} propertyPath: m_LocalPosition.x value: 0 @@ -793,6 +829,9 @@ PrefabInstance: value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 02502921f64c38d48b14f1d6c2438b16, type: 3} --- !u!114 &800708247703322884 stripped MonoBehaviour: @@ -815,16 +854,13 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 2351505566903569412} m_Modifications: - target: {fileID: 1948193615953854874, guid: 90f955d6c9d709448a0b1e29e1f9c046, type: 3} propertyPath: m_Name value: MRTK LeftHand Controller objectReference: {fileID: 0} - - target: {fileID: 1948193615953854875, guid: 90f955d6c9d709448a0b1e29e1f9c046, type: 3} - propertyPath: m_RootOrder - value: 3 - objectReference: {fileID: 0} - target: {fileID: 1948193615953854875, guid: 90f955d6c9d709448a0b1e29e1f9c046, type: 3} propertyPath: m_LocalPosition.x value: 0 @@ -874,6 +910,9 @@ PrefabInstance: value: objectReference: {fileID: 529201713281613631} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 90f955d6c9d709448a0b1e29e1f9c046, type: 3} --- !u!114 &6032659918864907508 stripped MonoBehaviour: diff --git a/org.mixedrealitytoolkit.input/CHANGELOG.md b/org.mixedrealitytoolkit.input/CHANGELOG.md index 1254dcd0f..da60bd152 100644 --- a/org.mixedrealitytoolkit.input/CHANGELOG.md +++ b/org.mixedrealitytoolkit.input/CHANGELOG.md @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). * Added `MRTKFocusFeature` to provide XrSession focus info to MRTK components. [PR #1057](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1057) * Added input action focus handling to disable controller/hand tracked state when the XrSession goes out of focus. [PR #1057](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1057) * Added support for XR_MSFT_hand_tracking_mesh and XR_ANDROID_hand_mesh on compatible runtimes. [PR #993](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/993) +* Added `Skybox` component to "MRTK XR Rig.prefab" for theming the skybox material. [PR #1130](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1130) ### Changed diff --git a/org.mixedrealitytoolkit.theming/Binders/BaseThemeBinder.cs b/org.mixedrealitytoolkit.theming/Binders/BaseThemeBinder.cs index f36683211..4f80c710b 100644 --- a/org.mixedrealitytoolkit.theming/Binders/BaseThemeBinder.cs +++ b/org.mixedrealitytoolkit.theming/Binders/BaseThemeBinder.cs @@ -6,16 +6,31 @@ namespace MixedReality.Toolkit.Theming { + /// + /// Base class for a theme binder that binds a theme data value of type to a target component of type . + /// public abstract class BaseThemeBinder : IBinder { + /// + /// The target component to apply the theme data to. + /// [field: SerializeField] protected K Target { get; private set; } + /// [field: SerializeField, HideInInspector] public string ThemeDefinitionItemName { get; private set; } + /// + /// Applies the theme data value to the target component. + /// + /// The theme data to apply. protected abstract void Apply(BaseThemeItemData themeItemData); + /// + /// Invoked when the active theme is changed on the data source. + /// + /// The change event containing the new theme. protected void OnThemeChanged(ChangeEvent changeEvent) { if (changeEvent.newValue == null) diff --git a/org.mixedrealitytoolkit.theming/Binders/BehaviourEnabledBinder.cs b/org.mixedrealitytoolkit.theming/Binders/BehaviourEnabledBinder.cs new file mode 100644 index 000000000..a4221c91f --- /dev/null +++ b/org.mixedrealitytoolkit.theming/Binders/BehaviourEnabledBinder.cs @@ -0,0 +1,23 @@ +// Copyright (c) Mixed Reality Toolkit Contributors +// Licensed under the BSD 3-Clause + +using UnityEngine; + +namespace MixedReality.Toolkit.Theming +{ + /// + /// Binds a boolean theme data value to the enabled state of a . + /// + [System.Serializable] + public class BehaviourEnabledBinder : BaseThemeBinder + { + /// + protected override void Apply(BaseThemeItemData themeItemData) + { + if (Target != null) + { + Target.enabled = themeItemData.Value; + } + } + } +} diff --git a/org.mixedrealitytoolkit.theming/Binders/BehaviourEnabledBinder.cs.meta b/org.mixedrealitytoolkit.theming/Binders/BehaviourEnabledBinder.cs.meta new file mode 100644 index 000000000..e456b5a66 --- /dev/null +++ b/org.mixedrealitytoolkit.theming/Binders/BehaviourEnabledBinder.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e360db02646a69842969f67dd0c46e9b \ No newline at end of file diff --git a/org.mixedrealitytoolkit.theming/Binders/FontIconSetBinder.cs b/org.mixedrealitytoolkit.theming/Binders/FontIconSetBinder.cs index db211806f..f93229968 100644 --- a/org.mixedrealitytoolkit.theming/Binders/FontIconSetBinder.cs +++ b/org.mixedrealitytoolkit.theming/Binders/FontIconSetBinder.cs @@ -8,9 +8,13 @@ namespace MixedReality.Toolkit.Theming { + /// + /// Binds a font icon set theme data value to a . + /// [Serializable] public class FontIconSetBinder : BaseThemeBinder { + /// protected override void Apply(BaseThemeItemData themeItemData) { if (Target != null && @@ -28,22 +32,40 @@ protected override void Apply(BaseThemeItemData themeItemData) } } + /// + /// A composite binding target for a and a component. + /// [Serializable] public class FontIconSetBinding { + /// + /// The target icon selector component to apply the font icon set to. + /// [field: SerializeField] public FontIconSelector IconSelector { get; private set; } + /// + /// The target text mesh pro component to apply the font asset to. + /// [field: SerializeField] public TMP_Text TextMeshProComponent { get; private set; } } + /// + /// A composite data type containing a and a . + /// [Serializable] public class FontIconSetData { + /// + /// The font asset to apply to the text mesh pro component. + /// [field: SerializeField] public TMP_FontAsset Font { get; private set; } + /// + /// The font icon set to apply to the icon selector component. + /// [field: SerializeField] public FontIconSet FontIconSet { get; private set; } } diff --git a/org.mixedrealitytoolkit.theming/Binders/GraphicColorBinder.cs b/org.mixedrealitytoolkit.theming/Binders/GraphicColorBinder.cs index 50a290082..d92d615e9 100644 --- a/org.mixedrealitytoolkit.theming/Binders/GraphicColorBinder.cs +++ b/org.mixedrealitytoolkit.theming/Binders/GraphicColorBinder.cs @@ -6,9 +6,13 @@ namespace MixedReality.Toolkit.Theming { + /// + /// Binds a color theme data value to the color property of a . + /// [System.Serializable] public class GraphicColorBinder : BaseThemeBinder { + /// protected override void Apply(BaseThemeItemData themeItemData) { if (Target != null) diff --git a/org.mixedrealitytoolkit.theming/Binders/GraphicMaterialBinder.cs b/org.mixedrealitytoolkit.theming/Binders/GraphicMaterialBinder.cs index 66b77fc41..96af3af55 100644 --- a/org.mixedrealitytoolkit.theming/Binders/GraphicMaterialBinder.cs +++ b/org.mixedrealitytoolkit.theming/Binders/GraphicMaterialBinder.cs @@ -6,9 +6,13 @@ namespace MixedReality.Toolkit.Theming { + /// + /// Binds a material theme data value to the material property of a . + /// [System.Serializable] public class GraphicMaterialBinder : BaseThemeBinder { + /// protected override void Apply(BaseThemeItemData themeItemData) { if (Target != null) diff --git a/org.mixedrealitytoolkit.theming/Binders/IBinder.cs b/org.mixedrealitytoolkit.theming/Binders/IBinder.cs index dd64ad902..e1ac52d7d 100644 --- a/org.mixedrealitytoolkit.theming/Binders/IBinder.cs +++ b/org.mixedrealitytoolkit.theming/Binders/IBinder.cs @@ -3,11 +3,26 @@ namespace MixedReality.Toolkit.Theming { + /// + /// Interface for a theme binder that subscribes to a and applies theme data to a target. + /// public interface IBinder { + /// + /// Subscribes to the given theme data source for theme changes. + /// + /// The theme data source to subscribe to. void Subscribe(ThemeDataSource themeDataSource); + + /// + /// Unsubscribes from the given theme data source. + /// + /// The theme data source to unsubscribe from. void Unsubscribe(ThemeDataSource themeDataSource); + /// + /// The name of the theme definition item this binder targets. + /// string ThemeDefinitionItemName { get; } } } diff --git a/org.mixedrealitytoolkit.theming/Binders/ImageSpriteBinder.cs b/org.mixedrealitytoolkit.theming/Binders/ImageSpriteBinder.cs index a02e8cd81..c72379ae1 100644 --- a/org.mixedrealitytoolkit.theming/Binders/ImageSpriteBinder.cs +++ b/org.mixedrealitytoolkit.theming/Binders/ImageSpriteBinder.cs @@ -6,9 +6,13 @@ namespace MixedReality.Toolkit.Theming { + /// + /// Binds a sprite theme data value to the sprite property of a . + /// [System.Serializable] public class ImageSpriteBinder : BaseThemeBinder { + /// protected override void Apply(BaseThemeItemData themeItemData) { if (Target != null) diff --git a/org.mixedrealitytoolkit.theming/Binders/LayoutGroupPaddingBinder.cs b/org.mixedrealitytoolkit.theming/Binders/LayoutGroupPaddingBinder.cs index c2c5ce61a..a714bc9a5 100644 --- a/org.mixedrealitytoolkit.theming/Binders/LayoutGroupPaddingBinder.cs +++ b/org.mixedrealitytoolkit.theming/Binders/LayoutGroupPaddingBinder.cs @@ -6,9 +6,13 @@ namespace MixedReality.Toolkit.Theming { + /// + /// Binds a rect offset theme data value to the padding property of a . + /// [System.Serializable] public class LayoutGroupPaddingBinder : BaseThemeBinder { + /// protected override void Apply(BaseThemeItemData themeItemData) { if (Target != null) diff --git a/org.mixedrealitytoolkit.theming/Binders/RendererMaterialBinder.cs b/org.mixedrealitytoolkit.theming/Binders/RendererMaterialBinder.cs index 0850970bc..5dccbe78f 100644 --- a/org.mixedrealitytoolkit.theming/Binders/RendererMaterialBinder.cs +++ b/org.mixedrealitytoolkit.theming/Binders/RendererMaterialBinder.cs @@ -5,9 +5,13 @@ namespace MixedReality.Toolkit.Theming { + /// + /// Binds a material theme data value to the material property of a . + /// [System.Serializable] public class RendererMaterialBinder : BaseThemeBinder { + /// protected override void Apply(BaseThemeItemData themeItemData) { if (Target != null) diff --git a/org.mixedrealitytoolkit.theming/Binders/RoundedRectMask2DRadiusBinder.cs b/org.mixedrealitytoolkit.theming/Binders/RoundedRectMask2DRadiusBinder.cs index 21388e483..7f8fbb414 100644 --- a/org.mixedrealitytoolkit.theming/Binders/RoundedRectMask2DRadiusBinder.cs +++ b/org.mixedrealitytoolkit.theming/Binders/RoundedRectMask2DRadiusBinder.cs @@ -6,9 +6,13 @@ namespace MixedReality.Toolkit.Theming { + /// + /// Binds a float theme data value to the corner radii property of a . + /// [System.Serializable] public class RoundedRectMask2DRadiusBinder : BaseThemeBinder { + /// protected override void Apply(BaseThemeItemData themeItemData) { if (Target != null) diff --git a/org.mixedrealitytoolkit.theming/Binders/SkyboxMaterialBinder.cs b/org.mixedrealitytoolkit.theming/Binders/SkyboxMaterialBinder.cs new file mode 100644 index 000000000..0efef5429 --- /dev/null +++ b/org.mixedrealitytoolkit.theming/Binders/SkyboxMaterialBinder.cs @@ -0,0 +1,23 @@ +// Copyright (c) Mixed Reality Toolkit Contributors +// Licensed under the BSD 3-Clause + +using UnityEngine; + +namespace MixedReality.Toolkit.Theming +{ + /// + /// Binds a material theme data value to the material property of a . + /// + [System.Serializable] + public class SkyboxMaterialBinder : BaseThemeBinder + { + /// + protected override void Apply(BaseThemeItemData themeItemData) + { + if (Target != null) + { + Target.material = themeItemData.Value; + } + } + } +} diff --git a/org.mixedrealitytoolkit.theming/Binders/SkyboxMaterialBinder.cs.meta b/org.mixedrealitytoolkit.theming/Binders/SkyboxMaterialBinder.cs.meta new file mode 100644 index 000000000..2a5595525 --- /dev/null +++ b/org.mixedrealitytoolkit.theming/Binders/SkyboxMaterialBinder.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5970cbf205f8c324bb5e3f76a5cad6a0 \ No newline at end of file diff --git a/org.mixedrealitytoolkit.theming/Binders/SpriteRendererColorBinder.cs b/org.mixedrealitytoolkit.theming/Binders/SpriteRendererColorBinder.cs index 24b1ccc51..fb9a79086 100644 --- a/org.mixedrealitytoolkit.theming/Binders/SpriteRendererColorBinder.cs +++ b/org.mixedrealitytoolkit.theming/Binders/SpriteRendererColorBinder.cs @@ -5,9 +5,13 @@ namespace MixedReality.Toolkit.Theming { + /// + /// Binds a color theme data value to the color property of a . + /// [System.Serializable] public class SpriteRendererColorBinder : BaseThemeBinder { + /// protected override void Apply(BaseThemeItemData themeItemData) { if (Target != null) diff --git a/org.mixedrealitytoolkit.theming/Binders/SpriteRendererSpriteBinder.cs b/org.mixedrealitytoolkit.theming/Binders/SpriteRendererSpriteBinder.cs index bfbe24a0c..cb0ed154b 100644 --- a/org.mixedrealitytoolkit.theming/Binders/SpriteRendererSpriteBinder.cs +++ b/org.mixedrealitytoolkit.theming/Binders/SpriteRendererSpriteBinder.cs @@ -5,9 +5,13 @@ namespace MixedReality.Toolkit.Theming { + /// + /// Binds a sprite theme data value to the sprite property of a . + /// [System.Serializable] public class SpriteRendererSpriteBinder : BaseThemeBinder { + /// protected override void Apply(BaseThemeItemData themeItemData) { if (Target != null) diff --git a/org.mixedrealitytoolkit.theming/Binders/TMP_TextFontAssetBinder.cs b/org.mixedrealitytoolkit.theming/Binders/TMP_TextFontAssetBinder.cs index dd86cb292..3f5f2f345 100644 --- a/org.mixedrealitytoolkit.theming/Binders/TMP_TextFontAssetBinder.cs +++ b/org.mixedrealitytoolkit.theming/Binders/TMP_TextFontAssetBinder.cs @@ -5,9 +5,13 @@ namespace MixedReality.Toolkit.Theming { + /// + /// Binds a font asset theme data value to the font property of a . + /// [System.Serializable] public class TMP_TextFontAssetBinder : BaseThemeBinder { + /// protected override void Apply(BaseThemeItemData themeItemData) { if (Target != null) diff --git a/org.mixedrealitytoolkit.theming/Binders/TransformLocalScaleBinder.cs b/org.mixedrealitytoolkit.theming/Binders/TransformLocalScaleBinder.cs index 0baf4905a..88ebe0f8a 100644 --- a/org.mixedrealitytoolkit.theming/Binders/TransformLocalScaleBinder.cs +++ b/org.mixedrealitytoolkit.theming/Binders/TransformLocalScaleBinder.cs @@ -5,9 +5,13 @@ namespace MixedReality.Toolkit.Theming { + /// + /// Binds a vector3 theme data value to the local scale property of a . + /// [System.Serializable] public class TransformLocalScaleBinder : BaseThemeBinder { + /// protected override void Apply(BaseThemeItemData themeItemData) { if (Target != null) diff --git a/org.mixedrealitytoolkit.theming/CHANGELOG.md b/org.mixedrealitytoolkit.theming/CHANGELOG.md index ff4a26279..52880eb4c 100644 --- a/org.mixedrealitytoolkit.theming/CHANGELOG.md +++ b/org.mixedrealitytoolkit.theming/CHANGELOG.md @@ -2,6 +2,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## Unreleased + +### Added + +* Added serializable theme item data types for booleans. [PR #1130](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1130) +* Added built-in binders for skybox materials and behaviour enabled states. [PR #1130](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1130) + ## [1.0.0-pre.1] - 2026-05-20 ### Added diff --git a/org.mixedrealitytoolkit.theming/Editor/ThemeDefinitionEditor.cs.meta b/org.mixedrealitytoolkit.theming/Editor/ThemeDefinitionEditor.cs.meta index 252cb02a7..94b14e254 100644 --- a/org.mixedrealitytoolkit.theming/Editor/ThemeDefinitionEditor.cs.meta +++ b/org.mixedrealitytoolkit.theming/Editor/ThemeDefinitionEditor.cs.meta @@ -1,2 +1,11 @@ fileFormatVersion: 2 -guid: bd66f2c84c6572b48a8ed4194a8bc818 \ No newline at end of file +guid: bd66f2c84c6572b48a8ed4194a8bc818 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/org.mixedrealitytoolkit.theming/ItemData/BoolItemData.cs b/org.mixedrealitytoolkit.theming/ItemData/BoolItemData.cs new file mode 100644 index 000000000..7a2fb0b5c --- /dev/null +++ b/org.mixedrealitytoolkit.theming/ItemData/BoolItemData.cs @@ -0,0 +1,8 @@ +// Copyright (c) Mixed Reality Toolkit Contributors +// Licensed under the BSD 3-Clause + +namespace MixedReality.Toolkit.Theming +{ + [System.Serializable] + public class BoolItemData : BaseThemeItemData { } +} diff --git a/org.mixedrealitytoolkit.theming/ItemData/BoolItemData.cs.meta b/org.mixedrealitytoolkit.theming/ItemData/BoolItemData.cs.meta new file mode 100644 index 000000000..3848b6cc7 --- /dev/null +++ b/org.mixedrealitytoolkit.theming/ItemData/BoolItemData.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6eef238277b82de42820e22d387ab78a \ No newline at end of file diff --git a/org.mixedrealitytoolkit.theming/README.md b/org.mixedrealitytoolkit.theming/README.md index 58b69ce18..e4884ca00 100644 --- a/org.mixedrealitytoolkit.theming/README.md +++ b/org.mixedrealitytoolkit.theming/README.md @@ -92,7 +92,9 @@ When the active theme changes, the binder looks up its named item in the new the | `TransformLocalScaleBinder` | `Vector3` | `Transform` | `Transform.localScale` | | `LayoutGroupPaddingBinder` | `RectOffset` | `HorizontalOrVerticalLayoutGroup` | Padding | | `RoundedRectMask2DRadiusBinder` | `float` | `RoundedRectMask2D` | Corner radius | -| `FontIconSetBinder` | `FontIconSetData` | — | Font + icon set | +| `FontIconSetBinder` | `FontIconSetData` | `FontIconSetBinding` | Font + icon set | +| `BehaviourEnabledBinder` | `bool` | `Behaviour` | `Behaviour.enabled` | +| `SkyboxMaterialBinder` | `Material` | `Skybox` | `Skybox.material` | | `StateVisualizerEffectColorBinder` | `Color` | `StateVisualizer` | Tint effect color per state | --- diff --git a/org.mixedrealitytoolkit.theming/Theming/MRTK_Theming_DefaultDefinition.asset b/org.mixedrealitytoolkit.theming/Theming/MRTK_Theming_DefaultDefinition.asset index 115e45c6d..c69554af0 100644 --- a/org.mixedrealitytoolkit.theming/Theming/MRTK_Theming_DefaultDefinition.asset +++ b/org.mixedrealitytoolkit.theming/Theming/MRTK_Theming_DefaultDefinition.asset @@ -94,3 +94,12 @@ MonoBehaviour: - k__BackingField: Surface Container Color k__BackingField: reference: MixedReality.Toolkit.Theming.ColorThemeItemData, MixedReality.Toolkit.Theming + - k__BackingField: Skybox + k__BackingField: + reference: MixedReality.Toolkit.Theming.MaterialThemeItemData, MixedReality.Toolkit.Theming + - k__BackingField: Enable Shared List Backplate + k__BackingField: + reference: MixedReality.Toolkit.Theming.BoolItemData, MixedReality.Toolkit.Theming + - k__BackingField: Enable Button Select Pulse + k__BackingField: + reference: MixedReality.Toolkit.Theming.BoolItemData, MixedReality.Toolkit.Theming diff --git a/org.mixedrealitytoolkit.theming/package.json b/org.mixedrealitytoolkit.theming/package.json index e804a9e08..0ee19c34c 100644 --- a/org.mixedrealitytoolkit.theming/package.json +++ b/org.mixedrealitytoolkit.theming/package.json @@ -1,6 +1,6 @@ { "name": "org.mixedrealitytoolkit.theming", - "version": "1.0.0-development.pre.1", + "version": "1.0.0-development.pre.2", "description": "Core theming 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.", "displayName": "MRTK UX Theming", "author": "Mixed Reality Toolkit Contributors", diff --git a/org.mixedrealitytoolkit.uxcomponents/Button/Prefabs/Empty Button.prefab b/org.mixedrealitytoolkit.uxcomponents/Button/Prefabs/Empty Button.prefab index b990a9ddd..194530161 100644 --- a/org.mixedrealitytoolkit.uxcomponents/Button/Prefabs/Empty Button.prefab +++ b/org.mixedrealitytoolkit.uxcomponents/Button/Prefabs/Empty Button.prefab @@ -1019,6 +1019,7 @@ MonoBehaviour: binders: - rid: 1538473242837123161 - rid: 1538473242837123160 + - rid: 8397413649693540611 references: version: 2 RefIds: @@ -1032,6 +1033,11 @@ MonoBehaviour: data: k__BackingField: {fileID: 9026472854072389792} k__BackingField: Canvas Backplate Quad Material + - rid: 8397413649693540611 + type: {class: BehaviourEnabledBinder, ns: MixedReality.Toolkit.Theming, asm: MixedReality.Toolkit.Theming} + data: + k__BackingField: {fileID: 7976009683108370513} + k__BackingField: Enable Button Select Pulse --- !u!1 &9026472854072389795 GameObject: m_ObjectHideFlags: 0 diff --git a/org.mixedrealitytoolkit.uxcomponents/CHANGELOG.md b/org.mixedrealitytoolkit.uxcomponents/CHANGELOG.md index b1d8ccc78..b9f98602e 100644 --- a/org.mixedrealitytoolkit.uxcomponents/CHANGELOG.md +++ b/org.mixedrealitytoolkit.uxcomponents/CHANGELOG.md @@ -2,6 +2,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## Unreleased + +### Added + +* Added "Enable Button Select Pulse" binding to "Empty Button.prefab". [PR #1130](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1130) + ## [4.0.0-pre.3] - 2026-05-20 ### Changed diff --git a/org.mixedrealitytoolkit.uxcomponents/package.json b/org.mixedrealitytoolkit.uxcomponents/package.json index 45c8af2ac..bfe9eaca4 100644 --- a/org.mixedrealitytoolkit.uxcomponents/package.json +++ b/org.mixedrealitytoolkit.uxcomponents/package.json @@ -1,6 +1,6 @@ { "name": "org.mixedrealitytoolkit.uxcomponents", - "version": "4.0.0-development.pre.3", + "version": "4.0.0-development.pre.4", "description": "UX library leveraging RectTransform and Canvas for dynamic layout and presentation. Contains prefabs, visuals, controls, and everything to get started building 3D user interfaces for mixed reality.", "displayName": "MRTK UX Components", "msftFeatureCategory": "MRTK3",