AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
SharingMenu.cs
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See LICENSE in the project root for license information.
3 
4 using System.IO;
5 using UnityEditor;
6 using UnityEngine;
7 using HoloToolkit.Unity;
8 
9 namespace HoloToolkit.Sharing
10 {
11  public static class SharingMenu
12  {
13  [MenuItem("Mixed Reality Toolkit/Sharing Service/Launch Sharing Service", false, 100)]
14  public static void LaunchSessionServer()
15  {
16  string filePathName = @"External\HoloToolkit\Sharing\Server\SharingService.exe";
17 
18  if (!File.Exists(filePathName))
19  {
20  Debug.LogError("Sharing service does not exist at location: " + filePathName);
21  Debug.LogError("Please enable the Sharing Service via HoloToolkit -> Configure -> Apply Project Settings.");
22  return;
23  }
24 
25  ExternalProcess.FindAndLaunch(filePathName, @"-local");
26  }
27 
28  [MenuItem("Mixed Reality Toolkit/Sharing Service/Launch Session Manager", false, 101)]
29  public static void LaunchSessionUI()
30  {
31  string filePathName = @"External\HoloToolkit\Sharing\Tools\SessionManager\x86\SessionManager.UI.exe";
32 
33  if (!File.Exists(filePathName))
34  {
35  Debug.LogError("Session Manager UI does not exist at location: " + filePathName);
36  Debug.LogError("Please enable the Sharing Service via HoloToolkit -> Configure -> Apply Project Settings.");
37  return;
38  }
39 
40  ExternalProcess.FindAndLaunch(filePathName);
41  }
42 
43  [MenuItem("Mixed Reality Toolkit/Sharing Service/Launch Profiler", false, 103)]
44  public static void LaunchProfilerX()
45  {
46  string filePathName = @"External\HoloToolkit\Sharing\Tools\Profiler\x86\ProfilerX.exe";
47 
48  if (!File.Exists(filePathName))
49  {
50  Debug.LogError("Profiler does not exist at location: " + filePathName);
51  Debug.LogError("Please enable the Sharing Service via HoloToolkit -> Configure -> Apply Project Settings.");
52  return;
53  }
54 
55  ExternalProcess.FindAndLaunch(filePathName);
56  }
57  }
58 }
Helper class for launching external processes inside of the unity editor.
static bool FindAndLaunch(string appName)