-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
326 additions
and
3 deletions.
There are no files selected for viewing
192 changes: 192 additions & 0 deletions
192
UnityProjects/MRTKDevTemplate/Assets/Example Assets/room/RoomPrefab.prefab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!1 &1027766260150840433 | ||
GameObject: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
serializedVersion: 6 | ||
m_Component: | ||
- component: {fileID: 5638131629905098188} | ||
- component: {fileID: 6617231595093284833} | ||
- component: {fileID: 2102423086962134640} | ||
- component: {fileID: 8109946847869331357} | ||
m_Layer: 0 | ||
m_Name: Cube.001 | ||
m_TagString: Untagged | ||
m_Icon: {fileID: 0} | ||
m_NavMeshLayer: 0 | ||
m_StaticEditorFlags: 0 | ||
m_IsActive: 1 | ||
--- !u!4 &5638131629905098188 | ||
Transform: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 1027766260150840433} | ||
m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} | ||
m_LocalPosition: {x: -0, y: 0.65676373, z: -0.7} | ||
m_LocalScale: {x: 116.666664, y: 159.24263, z: 100} | ||
m_Children: [] | ||
m_Father: {fileID: 8151393333055720330} | ||
m_RootOrder: 1 | ||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||
--- !u!33 &6617231595093284833 | ||
MeshFilter: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 1027766260150840433} | ||
m_Mesh: {fileID: 4493585093827132993, guid: 6b0debf97988b7445b5111a86fcb716e, type: 3} | ||
--- !u!23 &2102423086962134640 | ||
MeshRenderer: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 1027766260150840433} | ||
m_Enabled: 1 | ||
m_CastShadows: 1 | ||
m_ReceiveShadows: 1 | ||
m_DynamicOccludee: 1 | ||
m_MotionVectors: 1 | ||
m_LightProbeUsage: 1 | ||
m_ReflectionProbeUsage: 1 | ||
m_RayTracingMode: 2 | ||
m_RayTraceProcedural: 0 | ||
m_RenderingLayerMask: 1 | ||
m_RendererPriority: 0 | ||
m_Materials: | ||
- {fileID: 2100000, guid: cb93607d1eaac094f93cad9763b32353, type: 2} | ||
- {fileID: 2100000, guid: cb93607d1eaac094f93cad9763b32353, type: 2} | ||
m_StaticBatchInfo: | ||
firstSubMesh: 0 | ||
subMeshCount: 0 | ||
m_StaticBatchRoot: {fileID: 0} | ||
m_ProbeAnchor: {fileID: 0} | ||
m_LightProbeVolumeOverride: {fileID: 0} | ||
m_ScaleInLightmap: 1 | ||
m_ReceiveGI: 1 | ||
m_PreserveUVs: 0 | ||
m_IgnoreNormalsForChartDetection: 0 | ||
m_ImportantGI: 0 | ||
m_StitchLightmapSeams: 1 | ||
m_SelectedEditorRenderState: 3 | ||
m_MinimumChartSize: 4 | ||
m_AutoUVMaxDistance: 0.5 | ||
m_AutoUVMaxAngle: 89 | ||
m_LightmapParameters: {fileID: 0} | ||
m_SortingLayerID: 0 | ||
m_SortingLayer: 0 | ||
m_SortingOrder: 0 | ||
m_AdditionalVertexStreams: {fileID: 0} | ||
--- !u!64 &8109946847869331357 | ||
MeshCollider: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 1027766260150840433} | ||
m_Material: {fileID: 0} | ||
m_IsTrigger: 0 | ||
m_Enabled: 1 | ||
serializedVersion: 4 | ||
m_Convex: 0 | ||
m_CookingOptions: 30 | ||
m_Mesh: {fileID: 4493585093827132993, guid: 6b0debf97988b7445b5111a86fcb716e, type: 3} | ||
--- !u!1 &4341625919259258056 | ||
GameObject: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
serializedVersion: 6 | ||
m_Component: | ||
- component: {fileID: 3720680212623092329} | ||
m_Layer: 0 | ||
m_Name: Area | ||
m_TagString: Untagged | ||
m_Icon: {fileID: 0} | ||
m_NavMeshLayer: 0 | ||
m_StaticEditorFlags: 0 | ||
m_IsActive: 1 | ||
--- !u!4 &3720680212623092329 | ||
Transform: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 4341625919259258056} | ||
m_LocalRotation: {x: -0.00000003774895, y: 0, z: -0, w: 1} | ||
m_LocalPosition: {x: -0, y: 1.9007708, z: 0} | ||
m_LocalScale: {x: 100, y: 100, z: 100} | ||
m_Children: [] | ||
m_Father: {fileID: 8151393333055720330} | ||
m_RootOrder: 0 | ||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||
--- !u!1 &5090441940898183724 | ||
GameObject: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
serializedVersion: 6 | ||
m_Component: | ||
- component: {fileID: 5382708896632745925} | ||
m_Layer: 0 | ||
m_Name: Spot | ||
m_TagString: Untagged | ||
m_Icon: {fileID: 0} | ||
m_NavMeshLayer: 0 | ||
m_StaticEditorFlags: 0 | ||
m_IsActive: 1 | ||
--- !u!4 &5382708896632745925 | ||
Transform: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 5090441940898183724} | ||
m_LocalRotation: {x: -0.00000003774895, y: 0, z: -0, w: 1} | ||
m_LocalPosition: {x: -0, y: 1.9038757, z: -0.6999314} | ||
m_LocalScale: {x: 100, y: 100, z: 100} | ||
m_Children: [] | ||
m_Father: {fileID: 8151393333055720330} | ||
m_RootOrder: 2 | ||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||
--- !u!1 &8814742530214482224 | ||
GameObject: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
serializedVersion: 6 | ||
m_Component: | ||
- component: {fileID: 8151393333055720330} | ||
m_Layer: 0 | ||
m_Name: RoomPrefab | ||
m_TagString: Untagged | ||
m_Icon: {fileID: 0} | ||
m_NavMeshLayer: 0 | ||
m_StaticEditorFlags: 0 | ||
m_IsActive: 1 | ||
--- !u!4 &8151393333055720330 | ||
Transform: | ||
m_ObjectHideFlags: 0 | ||
m_CorrespondingSourceObject: {fileID: 0} | ||
m_PrefabInstance: {fileID: 0} | ||
m_PrefabAsset: {fileID: 0} | ||
m_GameObject: {fileID: 8814742530214482224} | ||
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0} | ||
m_LocalPosition: {x: 0, y: 0, z: 0} | ||
m_LocalScale: {x: 1, y: 1, z: 1} | ||
m_Children: | ||
- {fileID: 3720680212623092329} | ||
- {fileID: 5638131629905098188} | ||
- {fileID: 5382708896632745925} | ||
m_Father: {fileID: 0} | ||
m_RootOrder: 0 | ||
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} |
7 changes: 7 additions & 0 deletions
7
UnityProjects/MRTKDevTemplate/Assets/Example Assets/room/RoomPrefab.prefab.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
UnityProjects/MRTKDevTemplate/Assets/Scripts/OnlyShowWhileOpaque.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.XR; | ||
|
||
namespace Microsoft.MixedReality.Toolkit.Examples.Demos | ||
{ | ||
/// <summary> | ||
/// This script disables the GameObject if the first detected XRDisplaySubsystem is | ||
/// not opaque. (If no XRDisplaySubsystem is found, the script assumes the platform's | ||
/// display is opaque.) Useful for only showing environment models on opaque/VR devices. | ||
/// </summary> | ||
internal class OnlyShowWhileOpaque : MonoBehaviour | ||
{ | ||
private XRDisplaySubsystem displaySubsystem = null; | ||
|
||
private bool isVisible = false; | ||
|
||
private void Awake() | ||
{ | ||
isVisible = gameObject.activeSelf; | ||
} | ||
|
||
private void Update() | ||
{ | ||
// TODO: possibly remove timeout once XRSubsystemHelpers are more efficient (#10852) | ||
if (displaySubsystem == null && Time.time < 5.0f) | ||
{ | ||
displaySubsystem = XRSubsystemHelpers.DisplaySubsystem; | ||
} | ||
|
||
// If we've successfully found a displaySubsystem, but the current visibility | ||
// doesn't match the opacity of the XR display... | ||
if (displaySubsystem != null && isVisible != displaySubsystem.displayOpaque) | ||
{ | ||
isVisible = displaySubsystem.displayOpaque; | ||
gameObject.SetActive(isVisible); | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
UnityProjects/MRTKDevTemplate/Assets/Scripts/OnlyShowWhileOpaque.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.