Skip to content

Commit fb3bb6f

Browse files
Missing from last commit
1 parent 774cbf4 commit fb3bb6f

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

Assets/HoloToolkit-Examples/SharingWithUNET/Scripts/GenericNetworkTransmitter.cs

+8-10
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Collections.Generic;
66
using UnityEngine;
77

8-
#if !UNITY_EDITOR && UNITY_WSA
8+
#if !UNITY_EDITOR && UNITY_WSA && (!ENABLE_IL2CPP && NET_STANDARD_2_0)
99
using Windows.Networking.Sockets;
1010
using Windows.Storage.Streams;
1111
using Windows.Networking;
@@ -29,10 +29,6 @@ public class GenericNetworkTransmitter : Singleton<GenericNetworkTransmitter>
2929
/// <param name="data">The data that arrived.</param>
3030
public delegate void OnDataReady(byte[] data);
3131

32-
#if UNITY_WSA
33-
public event OnDataReady DataReadyEvent;
34-
#endif
35-
3632
/// <summary>
3733
/// The server to connect to when data is needed.
3834
/// </summary>
@@ -48,7 +44,7 @@ public class GenericNetworkTransmitter : Singleton<GenericNetworkTransmitter>
4844
/// </summary>
4945
private byte[] mostRecentDataBuffer;
5046

51-
#if !UNITY_EDITOR && UNITY_WSA
47+
#if !UNITY_EDITOR && UNITY_WSA && (!ENABLE_IL2CPP && NET_STANDARD_2_0)
5248
/// <summary>
5349
/// Tracks the network connection to the remote machine we are sending meshes to.
5450
/// </summary>
@@ -63,6 +59,8 @@ public class GenericNetworkTransmitter : Singleton<GenericNetworkTransmitter>
6359
/// If we cannot connect to the server, this is how long we will wait before retrying.
6460
/// </summary>
6561
private float timeToDeferFailedConnections = 10.0f;
62+
63+
public event OnDataReady DataReadyEvent;
6664
#endif
6765

6866
/// <summary>
@@ -106,7 +104,7 @@ private void Update()
106104
}
107105

108106
// A lot of the work done in this class can only be done in UWP. The editor is not a UWP app.
109-
#if !UNITY_EDITOR && UNITY_WSA
107+
#if !UNITY_EDITOR && UNITY_WSA && (!ENABLE_IL2CPP && NET_STANDARD_2_0)
110108
private void RequestDataRetry()
111109
{
112110
if (!RequestAndGetData())
@@ -121,7 +119,7 @@ private void RequestDataRetry()
121119
/// </summary>
122120
public void ConfigureAsServer()
123121
{
124-
#if !UNITY_EDITOR && UNITY_WSA
122+
#if !UNITY_EDITOR && UNITY_WSA && (!ENABLE_IL2CPP && NET_STANDARD_2_0)
125123
Task t = new Task(() =>
126124
{
127125
networkListener = new StreamSocketListener();
@@ -142,7 +140,7 @@ public void ConfigureAsServer()
142140
/// </summary>
143141
private bool ConnectListener()
144142
{
145-
#if !UNITY_EDITOR && UNITY_WSA
143+
#if !UNITY_EDITOR && UNITY_WSA && (!ENABLE_IL2CPP && NET_STANDARD_2_0)
146144
if (waitingForConnection)
147145
{
148146
Debug.Log("Not a good time to connect listener");
@@ -164,7 +162,7 @@ private bool ConnectListener()
164162
#endif
165163
}
166164

167-
#if !UNITY_EDITOR && UNITY_WSA
165+
#if !UNITY_EDITOR && UNITY_WSA && (!ENABLE_IL2CPP && NET_STANDARD_2_0)
168166
/// <summary>
169167
/// When a connection is made to us, this call back gets called and
170168
/// we send our data.

Assets/HoloToolkit/Utilities/Scripts/ApplicationViewManager.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Collections;
66
using UnityEngine;
77

8-
#if !UNITY_EDITOR && UNITY_WSA
8+
#if !UNITY_EDITOR && UNITY_WSA && (!ENABLE_IL2CPP && NET_STANDARD_2_0)
99
using System.Threading.Tasks;
1010
using Windows.ApplicationModel.Core;
1111
using Windows.UI.Core;
@@ -27,7 +27,7 @@ public class ApplicationViewManager : MonoBehaviour
2727
{
2828
private void Start()
2929
{
30-
#if !UNITY_EDITOR && UNITY_WSA
30+
#if !UNITY_EDITOR && UNITY_WSA && (!ENABLE_IL2CPP && NET_STANDARD_2_0)
3131
UnityEngine.WSA.Application.InvokeOnUIThread(
3232
() =>
3333
{
@@ -36,7 +36,7 @@ private void Start()
3636
#endif
3737
}
3838

39-
#if !UNITY_EDITOR && UNITY_WSA
39+
#if !UNITY_EDITOR && UNITY_WSA && (!ENABLE_IL2CPP && NET_STANDARD_2_0)
4040
static int Full3DViewId { get; set; }
4141
static System.Collections.Concurrent.ConcurrentDictionary<int, Action<object>> CallbackDictionary
4242
= new System.Collections.Concurrent.ConcurrentDictionary<int, Action<object>>();
@@ -46,7 +46,7 @@ static System.Collections.Concurrent.ConcurrentDictionary<int, Action<object>> C
4646
/// Call this method with Application View Dispatcher, or in Application View Thread, will return to Full3D View and close Application View
4747
/// </summary>
4848
/// <param name="returnValue">The return value of the XAML View Execution</param>
49-
#if !UNITY_EDITOR && UNITY_WSA
49+
#if !UNITY_EDITOR && UNITY_WSA && (!ENABLE_IL2CPP && NET_STANDARD_2_0)
5050
public static async void CallbackReturnValue(object returnValue)
5151
{
5252
var viewId = ApplicationView.GetForCurrentView().Id;
@@ -80,7 +80,7 @@ public static void CallbackReturnValue(object returnValue)
8080
public IEnumerator OnLaunchXamlView<TReturnValue>(string xamlPageName, Action<TReturnValue> callback, object pageNavigateParameter = null)
8181
{
8282
bool isCompleted = false;
83-
#if !UNITY_EDITOR && UNITY_WSA
83+
#if !UNITY_EDITOR && UNITY_WSA && (!ENABLE_IL2CPP && NET_STANDARD_2_0)
8484
object returnValue = null;
8585
CoreApplicationView newView = CoreApplication.CreateNewView();
8686
int newViewId = 0;

0 commit comments

Comments
 (0)