Skip to content

Commit 2af8545

Browse files
author
Stephen Hodgson
committed
Fixed teleporting. Seems the AddGlobalListener was the issue
1 parent 98805c6 commit 2af8545

File tree

7 files changed

+114
-122
lines changed

7 files changed

+114
-122
lines changed

Assets/HoloToolkit-Examples/Input/Scenes/MotionControllerTest.unity

Lines changed: 78 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ Transform:
856856
- {fileID: 1872225222}
857857
- {fileID: 1304828853}
858858
m_Father: {fileID: 0}
859-
m_RootOrder: 8
859+
m_RootOrder: 7
860860
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
861861
--- !u!1 &201041691
862862
GameObject:
@@ -1244,7 +1244,7 @@ Transform:
12441244
m_LocalScale: {x: 0.25, y: 0.25, z: 0.25}
12451245
m_Children: []
12461246
m_Father: {fileID: 0}
1247-
m_RootOrder: 1
1247+
m_RootOrder: 8
12481248
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
12491249
--- !u!114 &293671891
12501250
MonoBehaviour:
@@ -2174,33 +2174,6 @@ Transform:
21742174
m_Father: {fileID: 1463513600}
21752175
m_RootOrder: 4
21762176
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
2177-
--- !u!1 &605452724 stripped
2178-
GameObject:
2179-
m_PrefabParentObject: {fileID: 1493965172262900, guid: d29bc40b7f3df26479d6a0aac211c355,
2180-
type: 2}
2181-
m_PrefabInternal: {fileID: 1996766209}
2182-
--- !u!114 &605452725
2183-
MonoBehaviour:
2184-
m_ObjectHideFlags: 0
2185-
m_PrefabParentObject: {fileID: 0}
2186-
m_PrefabInternal: {fileID: 0}
2187-
m_GameObject: {fileID: 605452724}
2188-
m_Enabled: 1
2189-
m_EditorHideFlags: 0
2190-
m_Script: {fileID: 11500000, guid: f70d42c5aa30ffb4e9cd9116a13bd2b8, type: 3}
2191-
m_Name:
2192-
m_EditorClassIdentifier:
2193-
--- !u!114 &605452726
2194-
MonoBehaviour:
2195-
m_ObjectHideFlags: 0
2196-
m_PrefabParentObject: {fileID: 0}
2197-
m_PrefabInternal: {fileID: 0}
2198-
m_GameObject: {fileID: 605452724}
2199-
m_Enabled: 1
2200-
m_EditorHideFlags: 0
2201-
m_Script: {fileID: 11500000, guid: cae8f3c88e9704a4393cb8d904b62372, type: 3}
2202-
m_Name:
2203-
m_EditorClassIdentifier:
22042177
--- !u!1 &630688233
22052178
GameObject:
22062179
m_ObjectHideFlags: 0
@@ -2318,7 +2291,7 @@ Transform:
23182291
- {fileID: 844015981}
23192292
- {fileID: 1493712557}
23202293
m_Father: {fileID: 0}
2321-
m_RootOrder: 2
2294+
m_RootOrder: 3
23222295
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
23232296
--- !u!1 &663988535
23242297
GameObject:
@@ -3475,7 +3448,7 @@ Transform:
34753448
m_LocalScale: {x: 1, y: 1, z: 1}
34763449
m_Children: []
34773450
m_Father: {fileID: 0}
3478-
m_RootOrder: 0
3451+
m_RootOrder: 1
34793452
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
34803453
--- !u!1 &1033796767
34813454
GameObject:
@@ -4818,7 +4791,7 @@ Transform:
48184791
- {fileID: 823003686}
48194792
- {fileID: 2131677962}
48204793
m_Father: {fileID: 0}
4821-
m_RootOrder: 6
4794+
m_RootOrder: 5
48224795
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
48234796
--- !u!1 &1361861878
48244797
GameObject:
@@ -4946,6 +4919,33 @@ Transform:
49464919
m_Father: {fileID: 1463513600}
49474920
m_RootOrder: 1
49484921
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
4922+
--- !u!1 &1377101692 stripped
4923+
GameObject:
4924+
m_PrefabParentObject: {fileID: 1493965172262900, guid: d29bc40b7f3df26479d6a0aac211c355,
4925+
type: 2}
4926+
m_PrefabInternal: {fileID: 1996766209}
4927+
--- !u!114 &1377101693
4928+
MonoBehaviour:
4929+
m_ObjectHideFlags: 0
4930+
m_PrefabParentObject: {fileID: 0}
4931+
m_PrefabInternal: {fileID: 0}
4932+
m_GameObject: {fileID: 1377101692}
4933+
m_Enabled: 1
4934+
m_EditorHideFlags: 0
4935+
m_Script: {fileID: 11500000, guid: f70d42c5aa30ffb4e9cd9116a13bd2b8, type: 3}
4936+
m_Name:
4937+
m_EditorClassIdentifier:
4938+
--- !u!114 &1377101694
4939+
MonoBehaviour:
4940+
m_ObjectHideFlags: 0
4941+
m_PrefabParentObject: {fileID: 0}
4942+
m_PrefabInternal: {fileID: 0}
4943+
m_GameObject: {fileID: 1377101692}
4944+
m_Enabled: 1
4945+
m_EditorHideFlags: 0
4946+
m_Script: {fileID: 11500000, guid: cae8f3c88e9704a4393cb8d904b62372, type: 3}
4947+
m_Name:
4948+
m_EditorClassIdentifier:
49494949
--- !u!1 &1392344359
49504950
GameObject:
49514951
m_ObjectHideFlags: 0
@@ -5245,7 +5245,7 @@ Transform:
52455245
- {fileID: 601090447}
52465246
- {fileID: 482625260}
52475247
m_Father: {fileID: 0}
5248-
m_RootOrder: 7
5248+
m_RootOrder: 6
52495249
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
52505250
--- !u!1 &1488963448
52515251
GameObject:
@@ -6002,54 +6002,6 @@ MeshRenderer:
60026002
m_SortingLayerID: 0
60036003
m_SortingLayer: 0
60046004
m_SortingOrder: 0
6005-
--- !u!1001 &1662233528
6006-
Prefab:
6007-
m_ObjectHideFlags: 0
6008-
serializedVersion: 2
6009-
m_Modification:
6010-
m_TransformParent: {fileID: 0}
6011-
m_Modifications:
6012-
- target: {fileID: 4000013535415816, guid: b2db04283121ca74495c2ee000fb4243, type: 2}
6013-
propertyPath: m_LocalPosition.x
6014-
value: 0
6015-
objectReference: {fileID: 0}
6016-
- target: {fileID: 4000013535415816, guid: b2db04283121ca74495c2ee000fb4243, type: 2}
6017-
propertyPath: m_LocalPosition.y
6018-
value: 0
6019-
objectReference: {fileID: 0}
6020-
- target: {fileID: 4000013535415816, guid: b2db04283121ca74495c2ee000fb4243, type: 2}
6021-
propertyPath: m_LocalPosition.z
6022-
value: 0
6023-
objectReference: {fileID: 0}
6024-
- target: {fileID: 4000013535415816, guid: b2db04283121ca74495c2ee000fb4243, type: 2}
6025-
propertyPath: m_LocalRotation.x
6026-
value: 0
6027-
objectReference: {fileID: 0}
6028-
- target: {fileID: 4000013535415816, guid: b2db04283121ca74495c2ee000fb4243, type: 2}
6029-
propertyPath: m_LocalRotation.y
6030-
value: 0
6031-
objectReference: {fileID: 0}
6032-
- target: {fileID: 4000013535415816, guid: b2db04283121ca74495c2ee000fb4243, type: 2}
6033-
propertyPath: m_LocalRotation.z
6034-
value: 0
6035-
objectReference: {fileID: 0}
6036-
- target: {fileID: 4000013535415816, guid: b2db04283121ca74495c2ee000fb4243, type: 2}
6037-
propertyPath: m_LocalRotation.w
6038-
value: 1
6039-
objectReference: {fileID: 0}
6040-
- target: {fileID: 4000013535415816, guid: b2db04283121ca74495c2ee000fb4243, type: 2}
6041-
propertyPath: m_RootOrder
6042-
value: 3
6043-
objectReference: {fileID: 0}
6044-
m_RemovedComponents: []
6045-
m_ParentPrefab: {fileID: 100100000, guid: b2db04283121ca74495c2ee000fb4243, type: 2}
6046-
m_IsPrefabParent: 0
6047-
--- !u!114 &1664677085 stripped
6048-
MonoBehaviour:
6049-
m_PrefabParentObject: {fileID: 114000013851064060, guid: b2db04283121ca74495c2ee000fb4243,
6050-
type: 2}
6051-
m_PrefabInternal: {fileID: 1662233528}
6052-
m_Script: {fileID: 11500000, guid: afa1ae235bc6cfa43addd1435e2fd822, type: 3}
60536005
--- !u!1 &1741479576
60546006
GameObject:
60556007
m_ObjectHideFlags: 0
@@ -6169,7 +6121,7 @@ Transform:
61696121
- {fileID: 985072502}
61706122
- {fileID: 1095093713}
61716123
m_Father: {fileID: 0}
6172-
m_RootOrder: 5
6124+
m_RootOrder: 4
61736125
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
61746126
--- !u!1 &1835177424
61756127
GameObject:
@@ -6207,6 +6159,48 @@ Transform:
62076159
m_Father: {fileID: 1322951683}
62086160
m_RootOrder: 0
62096161
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
6162+
--- !u!1001 &1853978898
6163+
Prefab:
6164+
m_ObjectHideFlags: 0
6165+
serializedVersion: 2
6166+
m_Modification:
6167+
m_TransformParent: {fileID: 0}
6168+
m_Modifications:
6169+
- target: {fileID: 4000011792100794, guid: a611e772ef8ddf64d8106a9cbb70f31c, type: 2}
6170+
propertyPath: m_LocalPosition.x
6171+
value: 0
6172+
objectReference: {fileID: 0}
6173+
- target: {fileID: 4000011792100794, guid: a611e772ef8ddf64d8106a9cbb70f31c, type: 2}
6174+
propertyPath: m_LocalPosition.y
6175+
value: 0
6176+
objectReference: {fileID: 0}
6177+
- target: {fileID: 4000011792100794, guid: a611e772ef8ddf64d8106a9cbb70f31c, type: 2}
6178+
propertyPath: m_LocalPosition.z
6179+
value: 0
6180+
objectReference: {fileID: 0}
6181+
- target: {fileID: 4000011792100794, guid: a611e772ef8ddf64d8106a9cbb70f31c, type: 2}
6182+
propertyPath: m_LocalRotation.x
6183+
value: 0
6184+
objectReference: {fileID: 0}
6185+
- target: {fileID: 4000011792100794, guid: a611e772ef8ddf64d8106a9cbb70f31c, type: 2}
6186+
propertyPath: m_LocalRotation.y
6187+
value: 0
6188+
objectReference: {fileID: 0}
6189+
- target: {fileID: 4000011792100794, guid: a611e772ef8ddf64d8106a9cbb70f31c, type: 2}
6190+
propertyPath: m_LocalRotation.z
6191+
value: 0
6192+
objectReference: {fileID: 0}
6193+
- target: {fileID: 4000011792100794, guid: a611e772ef8ddf64d8106a9cbb70f31c, type: 2}
6194+
propertyPath: m_LocalRotation.w
6195+
value: 1
6196+
objectReference: {fileID: 0}
6197+
- target: {fileID: 4000011792100794, guid: a611e772ef8ddf64d8106a9cbb70f31c, type: 2}
6198+
propertyPath: m_RootOrder
6199+
value: 2
6200+
objectReference: {fileID: 0}
6201+
m_RemovedComponents: []
6202+
m_ParentPrefab: {fileID: 100100000, guid: a611e772ef8ddf64d8106a9cbb70f31c, type: 2}
6203+
m_IsPrefabParent: 0
62106204
--- !u!1 &1872168387
62116205
GameObject:
62126206
m_ObjectHideFlags: 0
@@ -6429,7 +6423,7 @@ Prefab:
64296423
type: 2}
64306424
propertyPath: Cursor
64316425
value:
6432-
objectReference: {fileID: 1664677085}
6426+
objectReference: {fileID: 0}
64336427
m_RemovedComponents: []
64346428
m_ParentPrefab: {fileID: 100100000, guid: 3eddd1c29199313478dd3f912bfab2ab, type: 2}
64356429
m_IsPrefabParent: 0
@@ -7093,11 +7087,7 @@ Prefab:
70937087
objectReference: {fileID: 0}
70947088
- target: {fileID: 4541142303025740, guid: d29bc40b7f3df26479d6a0aac211c355, type: 2}
70957089
propertyPath: m_RootOrder
7096-
value: 4
7097-
objectReference: {fileID: 0}
7098-
- target: {fileID: 1493965172262900, guid: d29bc40b7f3df26479d6a0aac211c355, type: 2}
7099-
propertyPath: m_IsActive
7100-
value: 1
7090+
value: 0
71017091
objectReference: {fileID: 0}
71027092
- target: {fileID: 114710303647202208, guid: d29bc40b7f3df26479d6a0aac211c355,
71037093
type: 2}

Assets/HoloToolkit/Input/Prefabs/MixedRealityCameraParent.prefab

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,6 @@ Camera:
531531
m_OcclusionCulling: 1
532532
m_StereoConvergence: 10
533533
m_StereoSeparation: 0.022
534-
m_StereoMirrorMode: 0
535534
--- !u!23 &23322403167181422
536535
MeshRenderer:
537536
m_ObjectHideFlags: 1
@@ -541,6 +540,7 @@ MeshRenderer:
541540
m_Enabled: 1
542541
m_CastShadows: 1
543542
m_ReceiveShadows: 1
543+
m_DynamicOccludee: 1
544544
m_MotionVectors: 1
545545
m_LightProbeUsage: 1
546546
m_ReflectionProbeUsage: 1
@@ -556,6 +556,7 @@ MeshRenderer:
556556
m_PreserveUVs: 1
557557
m_IgnoreNormalsForChartDetection: 0
558558
m_ImportantGI: 0
559+
m_StitchLightmapSeams: 0
559560
m_SelectedEditorRenderState: 3
560561
m_MinimumChartSize: 4
561562
m_AutoUVMaxDistance: 0.5
@@ -697,6 +698,7 @@ MonoBehaviour:
697698
m_Script: {fileID: 11500000, guid: 794a5a07720daf4479efca14d8ba4297, type: 3}
698699
m_Name:
699700
m_EditorClassIdentifier:
701+
FadeSharedMaterial: 0
700702
--- !u!114 &114465015496195000
701703
MonoBehaviour:
702704
m_ObjectHideFlags: 1
@@ -812,7 +814,7 @@ MonoBehaviour:
812814
EnableStrafe: 1
813815
RotationSize: 45
814816
StrafeAmount: 0.5
815-
TeleportMarker: {fileID: 1503526479864244, guid: 10d95b99055c6ad40b735cc8b3593745,
817+
teleportMarker: {fileID: 1503526479864244, guid: 10d95b99055c6ad40b735cc8b3593745,
816818
type: 2}
817819
--- !u!114 &114828096048444974
818820
MonoBehaviour:

Assets/HoloToolkit/Input/Scripts/InputSources/InteractionInputSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ protected virtual void OnEnable()
176176
#endif
177177
}
178178

179-
protected virtual void Start()
179+
protected virtual void Awake()
180180
{
181181
#if UNITY_WSA
182182
GestureRecognizer = new GestureRecognizer();

Assets/HoloToolkit/Input/Scripts/Utilities/Managers/InputManager.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
using System;
55
using System.Collections.Generic;
6-
using System.Collections.ObjectModel;
76
using UnityEngine;
87
using UnityEngine.EventSystems;
98

@@ -59,13 +58,8 @@ public class InputManager : Singleton<InputManager>
5958
/// <summary>
6059
/// List of the input sources as detected by the input manager like hands or motion controllers.
6160
/// </summary>
62-
private readonly List<InputSourceInfo> detectedInputSources = new List<InputSourceInfo>();
63-
public readonly ReadOnlyCollection<InputSourceInfo> DetectedInputSources;
64-
65-
public InputManager()
66-
{
67-
DetectedInputSources = new ReadOnlyCollection<InputSourceInfo>(detectedInputSources);
68-
}
61+
private readonly List<InputSourceInfo> detectedInputSources = new List<InputSourceInfo>(0);
62+
public List<InputSourceInfo> DetectedInputSources { get { return detectedInputSources; } }
6963

7064
/// <summary>
7165
/// Indicates if input is currently enabled or not.

Assets/HoloToolkit/Input/Scripts/Utilities/Managers/MixedRealityTeleport.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public class MixedRealityTeleport : Singleton<MixedRealityTeleport>, IController
3737
public float RotationSize = 45.0f;
3838
public float StrafeAmount = 0.5f;
3939

40-
public GameObject TeleportMarker { get; private set; }
40+
[SerializeField]
41+
private GameObject teleportMarker;
4142
private Animator animationController;
4243

4344
/// <summary>
@@ -65,12 +66,12 @@ private void Start()
6566
return;
6667
}
6768

68-
if (TeleportMarker != null)
69+
if (teleportMarker != null)
6970
{
70-
TeleportMarker = Instantiate(TeleportMarker);
71-
TeleportMarker.SetActive(false);
71+
teleportMarker = Instantiate(teleportMarker);
72+
teleportMarker.SetActive(false);
7273

73-
animationController = TeleportMarker.GetComponentInChildren<Animator>();
74+
animationController = teleportMarker.GetComponentInChildren<Animator>();
7475
if (animationController != null)
7576
{
7677
animationController.StopPlayback();
@@ -208,7 +209,7 @@ private void FinishTeleport()
208209
if (isTeleportValid)
209210
{
210211
RaycastHit hitInfo;
211-
Vector3 hitPos = TeleportMarker.transform.position + Vector3.up * (Physics.Raycast(CameraCache.Main.transform.position, Vector3.down, out hitInfo, 5.0f) ? hitInfo.distance : 2.6f);
212+
Vector3 hitPos = teleportMarker.transform.position + Vector3.up * (Physics.Raycast(CameraCache.Main.transform.position, Vector3.down, out hitInfo, 5.0f) ? hitInfo.distance : 2.6f);
212213

213214
fadeControl.DoFade(0.25f, 0.5f, () =>
214215
{
@@ -265,7 +266,7 @@ public void SetWorldPosition(Vector3 worldPosition)
265266

266267
private void EnableMarker()
267268
{
268-
TeleportMarker.SetActive(true);
269+
teleportMarker.SetActive(true);
269270
if (animationController != null)
270271
{
271272
animationController.StartPlayback();
@@ -278,7 +279,7 @@ private void DisableMarker()
278279
{
279280
animationController.StopPlayback();
280281
}
281-
TeleportMarker.SetActive(false);
282+
teleportMarker.SetActive(false);
282283
}
283284

284285
private void PositionMarker()
@@ -289,7 +290,7 @@ private void PositionMarker()
289290
{
290291
isTeleportValid = true;
291292

292-
TeleportMarker.transform.position = focusDetails.Point;
293+
teleportMarker.transform.position = focusDetails.Point;
293294
}
294295
else
295296
{

0 commit comments

Comments
 (0)