5
5
using System . Collections . Generic ;
6
6
using UnityEngine ;
7
7
8
- #if ! UNITY_EDITOR && UNITY_WSA
8
+ #if ! UNITY_EDITOR && UNITY_WSA && ( ! ENABLE_IL2CPP && NET_STANDARD_2_0 )
9
9
using Windows . Networking . Sockets ;
10
10
using Windows . Storage . Streams ;
11
11
using Windows . Networking ;
@@ -29,10 +29,6 @@ public class GenericNetworkTransmitter : Singleton<GenericNetworkTransmitter>
29
29
/// <param name="data">The data that arrived.</param>
30
30
public delegate void OnDataReady ( byte [ ] data ) ;
31
31
32
- #if UNITY_WSA
33
- public event OnDataReady DataReadyEvent ;
34
- #endif
35
-
36
32
/// <summary>
37
33
/// The server to connect to when data is needed.
38
34
/// </summary>
@@ -48,7 +44,7 @@ public class GenericNetworkTransmitter : Singleton<GenericNetworkTransmitter>
48
44
/// </summary>
49
45
private byte [ ] mostRecentDataBuffer ;
50
46
51
- #if ! UNITY_EDITOR && UNITY_WSA
47
+ #if ! UNITY_EDITOR && UNITY_WSA && ( ! ENABLE_IL2CPP && NET_STANDARD_2_0 )
52
48
/// <summary>
53
49
/// Tracks the network connection to the remote machine we are sending meshes to.
54
50
/// </summary>
@@ -63,6 +59,8 @@ public class GenericNetworkTransmitter : Singleton<GenericNetworkTransmitter>
63
59
/// If we cannot connect to the server, this is how long we will wait before retrying.
64
60
/// </summary>
65
61
private float timeToDeferFailedConnections = 10.0f ;
62
+
63
+ public event OnDataReady DataReadyEvent ;
66
64
#endif
67
65
68
66
/// <summary>
@@ -106,7 +104,7 @@ private void Update()
106
104
}
107
105
108
106
// 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 )
110
108
private void RequestDataRetry ( )
111
109
{
112
110
if ( ! RequestAndGetData ( ) )
@@ -121,7 +119,7 @@ private void RequestDataRetry()
121
119
/// </summary>
122
120
public void ConfigureAsServer ( )
123
121
{
124
- #if ! UNITY_EDITOR && UNITY_WSA
122
+ #if ! UNITY_EDITOR && UNITY_WSA && ( ! ENABLE_IL2CPP && NET_STANDARD_2_0 )
125
123
Task t = new Task ( ( ) =>
126
124
{
127
125
networkListener = new StreamSocketListener ( ) ;
@@ -142,7 +140,7 @@ public void ConfigureAsServer()
142
140
/// </summary>
143
141
private bool ConnectListener ( )
144
142
{
145
- #if ! UNITY_EDITOR && UNITY_WSA
143
+ #if ! UNITY_EDITOR && UNITY_WSA && ( ! ENABLE_IL2CPP && NET_STANDARD_2_0 )
146
144
if ( waitingForConnection )
147
145
{
148
146
Debug . Log ( "Not a good time to connect listener" ) ;
@@ -164,7 +162,7 @@ private bool ConnectListener()
164
162
#endif
165
163
}
166
164
167
- #if ! UNITY_EDITOR && UNITY_WSA
165
+ #if ! UNITY_EDITOR && UNITY_WSA && ( ! ENABLE_IL2CPP && NET_STANDARD_2_0 )
168
166
/// <summary>
169
167
/// When a connection is made to us, this call back gets called and
170
168
/// we send our data.
0 commit comments