Skip to content

Commit b030961

Browse files
authored
Merge pull request #327 from HodgsonSDAS/master
Cross platform compatibility
2 parents f52e3dc + 460a21a commit b030961

File tree

8 files changed

+21
-19
lines changed

8 files changed

+21
-19
lines changed

Assets/HoloToolkit/Sharing/Tests/ImportExportAnchorManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ private void MarkSharingServiceReady()
233233
{
234234
sharingServiceReady = true;
235235

236-
#if UNITY_EDITOR
236+
#if UNITY_EDITOR || UNITY_STANDALONE
237237
InitRoomApi();
238238
#endif
239239
}

Assets/HoloToolkit/SpatialMapping/Scripts/RemoteMapping/FileSurfaceObserver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void Load(string fileName)
7070
private void Update()
7171
{
7272
// Keyboard commands for saving and loading a remotely generated mesh file.
73-
#if UNITY_EDITOR
73+
#if UNITY_EDITOR || UNITY_STANDALONE
7474
// S - saves the active mesh
7575
if (Input.GetKeyUp(KeyCode.S))
7676
{

Assets/HoloToolkit/SpatialMapping/Scripts/RemoteMapping/MeshSaver.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System.IO;
77
using UnityEngine;
88

9-
#if !UNITY_EDITOR
9+
#if !UNITY_EDITOR && UNITY_METRO
1010
using System.Threading.Tasks;
1111
using Windows.Storage;
1212
#endif
@@ -30,7 +30,7 @@ public static string MeshFolderName
3030
{
3131
get
3232
{
33-
#if !UNITY_EDITOR
33+
#if !UNITY_EDITOR && UNITY_METRO
3434
return ApplicationData.Current.RoamingFolder.Path;
3535
#else
3636
return Application.persistentDataPath;
@@ -117,7 +117,7 @@ private static Stream OpenFileForRead(string folderName, string fileName)
117117
{
118118
Stream stream = null;
119119

120-
#if !UNITY_EDITOR
120+
#if !UNITY_EDITOR && UNITY_METRO
121121
Task<Task> task = Task<Task>.Factory.StartNew(
122122
async () =>
123123
{
@@ -144,7 +144,7 @@ private static Stream OpenFileForWrite(string folderName, string fileName)
144144
{
145145
Stream stream = null;
146146

147-
#if !UNITY_EDITOR
147+
#if !UNITY_EDITOR && UNITY_METRO
148148
Task<Task> task = Task<Task>.Factory.StartNew(
149149
async () =>
150150
{

Assets/HoloToolkit/SpatialMapping/Scripts/RemoteMapping/RemoteMappingManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ private void Start()
4646
keywordRecognizer.OnPhraseRecognized += KeywordRecognizer_OnPhraseRecognized;
4747
keywordRecognizer.Start();
4848

49-
#if UNITY_EDITOR
49+
#if UNITY_EDITOR || UNITY_STANDALONE
5050
remoteMeshTarget = GetComponent<RemoteMeshTarget>();
5151

5252
if (remoteMeshTarget != null && SpatialMappingManager.Instance.Source == null)
@@ -60,7 +60,7 @@ private void Start()
6060
// Called every frame by the Unity engine.
6161
private void Update()
6262
{
63-
#if UNITY_EDITOR
63+
#if UNITY_EDITOR || UNITY_STANDALONE
6464
// Use the 'network' sourced mesh.
6565
if (Input.GetKeyUp(RemoteMappingKey))
6666
{
@@ -88,7 +88,7 @@ private void KeywordRecognizer_OnPhraseRecognized(PhraseRecognizedEventArgs args
8888
/// </summary>
8989
private void SendMeshes()
9090
{
91-
#if !UNITY_EDITOR
91+
#if !UNITY_EDITOR && UNITY_METRO
9292
List<MeshFilter> MeshFilters = SpatialMappingManager.Instance.GetMeshFilters();
9393
for (int index = 0; index < MeshFilters.Count; index++)
9494
{

Assets/HoloToolkit/SpatialMapping/Scripts/RemoteMapping/RemoteMeshSource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4-
using System.Collections.Generic;
54
using UnityEngine;
65

7-
#if !UNITY_EDITOR
6+
#if !UNITY_EDITOR && UNITY_METRO
7+
using System.Collections.Generic;
88
using Windows.Networking.Sockets;
99
using Windows.Storage.Streams;
1010
using Windows.Networking;
@@ -24,7 +24,7 @@ public class RemoteMeshSource : Singleton<RemoteMeshSource>
2424
[Tooltip("The connection port on the machine to use.")]
2525
public int ConnectionPort = 11000;
2626

27-
#if !UNITY_EDITOR
27+
#if !UNITY_EDITOR && UNITY_METRO
2828
/// <summary>
2929
/// Tracks the network connection to the remote machine we are sending meshes to.
3030
/// </summary>

Assets/HoloToolkit/SpatialMapping/Scripts/RemoteMapping/RemoteMeshTarget.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System.IO;
77
using UnityEngine;
88

9-
#if UNITY_EDITOR
9+
#if UNITY_EDITOR || UNITY_STANDALONE
1010
using System.Net;
1111
using System.Net.Sockets;
1212
#endif
@@ -26,7 +26,7 @@ public class RemoteMeshTarget : SpatialMappingSource
2626
[Tooltip("The connection port on the machine to use.")]
2727
public int ConnectionPort = 11000;
2828

29-
#if UNITY_EDITOR
29+
#if UNITY_EDITOR || UNITY_STANDALONE
3030
/// <summary>
3131
/// Listens for network connections over TCP.
3232
/// </summary>

Assets/HoloToolkit/SpatialMapping/Scripts/SpatialProcessing/RemoveSurfaceVertices.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class RemoveSurfaceVertices : Singleton<RemoveSurfaceVertices>
4040
/// </summary>
4141
private Queue<Bounds> boundingObjectsQueue;
4242

43-
#if UNITY_EDITOR
43+
#if UNITY_EDITOR || UNITY_STANDALONE
4444
/// <summary>
4545
/// How much time (in sec), while running in the Unity Editor, to allow RemoveSurfaceVertices to consume before returning control to the main program.
4646
/// </summary>

Assets/HoloToolkit/SpatialMapping/Scripts/SpatialProcessing/SurfaceMeshesToPlanes.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
using System.Collections.Generic;
77
using UnityEngine;
88

9-
#if !UNITY_EDITOR
9+
#if !UNITY_EDITOR && UNITY_METRO
1010
using System.Threading;
1111
using System.Threading.Tasks;
12-
#else
12+
#endif
13+
14+
#if UNITY_EDITOR
1315
using UnityEditor;
1416
#endif
1517

@@ -82,7 +84,7 @@ public class SurfaceMeshesToPlanes : Singleton<SurfaceMeshesToPlanes>
8284
/// </summary>
8385
private bool makingPlanes = false;
8486

85-
#if UNITY_EDITOR
87+
#if UNITY_EDITOR || UNITY_STANDALONE
8688
/// <summary>
8789
/// How much time (in sec), while running in the Unity Editor, to allow RemoveSurfaceVertices to consume before returning control to the main program.
8890
/// </summary>
@@ -186,7 +188,7 @@ private IEnumerator MakePlanesRoutine()
186188
// Pause our work, and continue on the next frame.
187189
yield return null;
188190

189-
#if !UNITY_EDITOR
191+
#if !UNITY_EDITOR && UNITY_METRO
190192
// When not in the unity editor we can use a cool background task to help manage FindPlanes().
191193
Task<BoundedPlane[]> planeTask = Task.Run(() => PlaneFinding.FindPlanes(meshData, snapToGravityThreshold, MinArea));
192194

0 commit comments

Comments
 (0)