Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions org.mixedrealitytoolkit.core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions org.mixedrealitytoolkit.core/Camera/CameraSettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/// <summary>
Expand All @@ -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);

/// <summary>
Expand Down Expand Up @@ -81,7 +84,7 @@ private void UpdateCameraSettings(DisplayType type)
{
using (UpdateCameraSettingsPerfMarker.Auto())
{
UnityEngine.Camera mainCamera = Camera.main;
Camera mainCamera = Camera.main;

switch (type)
{
Expand Down Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion org.mixedrealitytoolkit.core/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
91 changes: 65 additions & 26 deletions org.mixedrealitytoolkit.input/Assets/Prefabs/MRTK XR Rig.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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}
Expand All @@ -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:
<Target>k__BackingField: {fileID: 2036977346182542242}
<ThemeDefinitionItemName>k__BackingField: Skybox
--- !u!1 &2351505566903569413
GameObject:
m_ObjectHideFlags: 0
Expand All @@ -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}
Expand All @@ -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:
Expand Down Expand Up @@ -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}
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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}
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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}
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions org.mixedrealitytoolkit.input/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 15 additions & 0 deletions org.mixedrealitytoolkit.theming/Binders/BaseThemeBinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,31 @@

namespace MixedReality.Toolkit.Theming
{
/// <summary>
/// Base class for a theme binder that binds a theme data value of type <typeparamref name="T"/> to a target component of type <typeparamref name="K"/>.
/// </summary>
public abstract class BaseThemeBinder<T, K> : IBinder
{
/// <summary>
/// The target component to apply the theme data to.
/// </summary>
[field: SerializeField]
protected K Target { get; private set; }

/// <inheritdoc />
[field: SerializeField, HideInInspector]
public string ThemeDefinitionItemName { get; private set; }

/// <summary>
/// Applies the theme data value to the target component.
/// </summary>
/// <param name="themeItemData">The theme data to apply.</param>
protected abstract void Apply(BaseThemeItemData<T> themeItemData);

/// <summary>
/// Invoked when the active theme is changed on the data source.
/// </summary>
/// <param name="changeEvent">The change event containing the new theme.</param>
protected void OnThemeChanged(ChangeEvent<Theme> changeEvent)
{
if (changeEvent.newValue == null)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Mixed Reality Toolkit Contributors
// Licensed under the BSD 3-Clause

using UnityEngine;

namespace MixedReality.Toolkit.Theming
{
/// <summary>
/// Binds a boolean theme data value to the enabled state of a <see cref="UnityEngine.Behaviour"/>.
/// </summary>
[System.Serializable]
public class BehaviourEnabledBinder : BaseThemeBinder<bool, Behaviour>
{
/// <inheritdoc />
protected override void Apply(BaseThemeItemData<bool> themeItemData)
{
if (Target != null)
{
Target.enabled = themeItemData.Value;
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading