Skip to content
This repository was archived by the owner on Mar 21, 2023. It is now read-only.

Commit e096a47

Browse files
committed
IL2CPP対応
1 parent 74112e8 commit e096a47

File tree

7 files changed

+42
-42
lines changed

7 files changed

+42
-42
lines changed

Assets/HoloLensModule/Environment/Scripts/FileIOControl.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.IO;
55
using UnityEngine;
66
using System.Threading;
7-
#if UNITY_UWP
7+
#if WINDOWS_UWP
88
using System.Threading.Tasks;
99
#elif UNITY_EDITOR || UNITY_STANDALONE
1010
#endif
@@ -19,7 +19,7 @@ public static string LocalFolderPath
1919
get
2020
{
2121
var path = Application.dataPath + "\\..\\Local";
22-
#if UNITY_UWP
22+
#if WINDOWS_UWP
2323
path = Application.persistentDataPath;
2424
#elif UNITY_EDITOR || UNITY_STANDALONE
2525
if (!Directory.Exists(path))
@@ -42,7 +42,7 @@ public static string StreamingAssetsFolderPath
4242
public static IEnumerator ReadTextFile(string name,Action<string> action)
4343
{
4444
string data = null;
45-
#if UNITY_UWP
45+
#if WINDOWS_UWP
4646
Task task = Task.Run(() =>
4747
{
4848
if (File.Exists(name))
@@ -68,7 +68,7 @@ public static IEnumerator ReadTextFile(string name,Action<string> action)
6868
public static IEnumerator ReadBytesFile(string name, Action<byte[]> action)
6969
{
7070
byte[] data = null;
71-
#if UNITY_UWP
71+
#if WINDOWS_UWP
7272
Task task = Task.Run(() =>
7373
{
7474
if (File.Exists(name))
@@ -94,7 +94,7 @@ public static IEnumerator ReadBytesFile(string name, Action<byte[]> action)
9494
// Write
9595
public static IEnumerator WriteTextFile(string name,string data,Action action = null)
9696
{
97-
#if UNITY_UWP
97+
#if WINDOWS_UWP
9898
Task task = Task.Run(() =>
9999
{
100100
if (File.Exists(name))
@@ -116,7 +116,7 @@ public static IEnumerator WriteTextFile(string name,string data,Action action =
116116

117117
public static IEnumerator WriteAppendTextFile(string name, string data, Action action = null)
118118
{
119-
#if UNITY_UWP
119+
#if WINDOWS_UWP
120120
Task task = Task.Run(() =>
121121
{
122122
if (File.Exists(name))
@@ -138,7 +138,7 @@ public static IEnumerator WriteAppendTextFile(string name, string data, Action a
138138

139139
public static IEnumerator WriteBytesFile(string name, byte[] data, Action action = null)
140140
{
141-
#if UNITY_UWP
141+
#if WINDOWS_UWP
142142
Task task = Task.Run(() =>
143143
{
144144
if (File.Exists(name))

Assets/HoloLensModule/Environment/Scripts/SystemInfomation.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using UnityEngine;
44
using System.Net;
55
using System;
6-
#if UNITY_UWP
6+
#if WINDOWS_UWP
77
using Windows.Networking.Connectivity;
88
using Windows.System.Diagnostics;
99
#endif
@@ -25,7 +25,7 @@ public class SystemInfomation
2525
public static void AppExit()
2626
{
2727
Application.Quit();
28-
#if UNITY_UWP
28+
#if WINDOWS_UWP
2929
Windows.ApplicationModel.Core.CoreApplication.Exit();
3030
#endif
3131
}
@@ -43,7 +43,7 @@ public static string IPAddress
4343
get
4444
{
4545
string ipaddress = "";
46-
#if UNITY_UWP
46+
#if WINDOWS_UWP
4747
var host = NetworkInformation.GetHostNames();
4848
foreach (var item in host)
4949
{
@@ -76,7 +76,7 @@ public static string Subnetmask
7676
get
7777
{
7878
string subnetmask = "";
79-
#if UNITY_UWP
79+
#if WINDOWS_UWP
8080
var host = NetworkInformation.GetHostNames();
8181
foreach (var item in host)
8282
{
@@ -97,7 +97,7 @@ public static string Subnetmask
9797
}
9898
}
9999
#elif UNITY_EDITOR || UNITY_STANDALONE
100-
var info = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces();
100+
var info = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces();
101101
foreach (var item in info)
102102
{
103103
if (item.OperationalStatus == System.Net.NetworkInformation.OperationalStatus.Up &&
@@ -155,7 +155,7 @@ public static string WifiSSID
155155
get
156156
{
157157
string ssid = "";
158-
#if UNITY_UWP
158+
#if WINDOWS_UWP
159159
var profile = NetworkInformation.GetInternetConnectionProfile();
160160
if (profile.IsWlanConnectionProfile==true)
161161
{
@@ -172,7 +172,7 @@ public static byte? WifiSignalBars
172172
get
173173
{
174174
byte? signal = null;
175-
#if UNITY_UWP
175+
#if WINDOWS_UWP
176176
var profile = NetworkInformation.GetInternetConnectionProfile();
177177
if (profile.IsWlanConnectionProfile == true)
178178
{
@@ -189,7 +189,7 @@ public static long WorkingSetMemory
189189
get
190190
{
191191
long memory = 0;
192-
#if UNITY_UWP
192+
#if WINDOWS_UWP
193193
memory = (long)ProcessDiagnosticInfo.GetForCurrentProcess().MemoryUsage.GetReport().WorkingSetSizeInBytes;
194194
#elif UNITY_EDITOR || UNITY_STANDALONE
195195
memory = System.Environment.WorkingSet;

Assets/HoloLensModule/Network/TCP/TCPClientManager.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Collections;
33
using System.Collections.Generic;
44
using System.Text;
5-
#if UNITY_UWP
5+
#if WINDOWS_UWP
66
using System.Threading.Tasks;
77
using Windows.Networking;
88
using Windows.Networking.Sockets;
@@ -23,7 +23,7 @@ public class TCPClientManager
2323
public delegate void ListenerByteEventHandler(byte[] data);
2424
public ListenerByteEventHandler ListenerByteEvent;
2525

26-
#if UNITY_UWP
26+
#if WINDOWS_UWP
2727
private StreamWriter writer = null;
2828
private Task writetask = null;
2929
#elif UNITY_EDITOR || UNITY_STANDALONE
@@ -41,7 +41,7 @@ public TCPClientManager(string ipaddress, int port)
4141

4242
public void ConnectClient(string ipaddress, int port)
4343
{
44-
#if UNITY_UWP
44+
#if WINDOWS_UWP
4545
Task.Run(async() =>
4646
{
4747
StreamSocket socket = new StreamSocket();
@@ -88,7 +88,7 @@ public bool SendMessage(string ms)
8888

8989
public bool SendMessage(byte[] data)
9090
{
91-
#if UNITY_UWP
91+
#if WINDOWS_UWP
9292
if (writetask == null || writetask.IsCompleted == true)
9393
{
9494
if (writer != null)
@@ -117,7 +117,7 @@ public bool SendMessage(byte[] data)
117117

118118
public void DisConnectClient()
119119
{
120-
#if UNITY_UWP
120+
#if WINDOWS_UWP
121121
if (writer!=null)
122122
{
123123
writer.Dispose();
@@ -133,7 +133,7 @@ public void DisConnectClient()
133133
stream = null;
134134
#endif
135135
}
136-
#if UNITY_UWP
136+
#if WINDOWS_UWP
137137
#elif UNITY_EDITOR || UNITY_STANDALONE
138138
private void ConnectCallback(IAsyncResult ar)
139139
{

Assets/HoloLensModule/Network/TCP/TCPServerManager.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Collections;
33
using System.Collections.Generic;
44
using System.Net;
5-
#if UNITY_UWP
5+
#if WINDOWS_UWP
66
using System.Threading.Tasks;
77
using Windows.Networking.Sockets;
88
using System.IO;
@@ -15,7 +15,7 @@ namespace HoloLensModule.Network
1515
{
1616
public class TCPServerManager
1717
{
18-
#if UNITY_UWP
18+
#if WINDOWS_UWP
1919
private StreamSocketListener socketlistener = null;
2020
private List<StreamWriter> streamList = new List<StreamWriter>();
2121
#elif UNITY_EDITOR || UNITY_STANDALONE
@@ -33,7 +33,7 @@ public TCPServerManager(int port)
3333

3434
public void ConnectServer(int port)
3535
{
36-
#if UNITY_UWP
36+
#if WINDOWS_UWP
3737
Task.Run(async () =>
3838
{
3939
socketlistener = new StreamSocketListener();
@@ -49,15 +49,15 @@ public void ConnectServer(int port)
4949

5050
public void DisConnectClient()
5151
{
52-
#if UNITY_UWP
52+
#if WINDOWS_UWP
5353
socketlistener.Dispose();
5454
#elif UNITY_EDITOR || UNITY_STANDALONE
5555
tcpListener.Stop();
5656
#endif
5757
isActiveThread = false;
5858
}
5959

60-
#if UNITY_UWP
60+
#if WINDOWS_UWP
6161
private async void ConnectionReceived(StreamSocketListener sender, StreamSocketListenerConnectionReceivedEventArgs args)
6262
{
6363
StreamReader reader = new StreamReader(args.Socket.InputStream.AsStreamForRead());

Assets/HoloLensModule/Network/UDP/UDPListenerManager.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System;
2-
#if UNITY_UWP
2+
#if WINDOWS_UWP
33
using System.IO;
44
using System.Threading.Tasks;
55
using Windows.Networking.Sockets;
@@ -19,11 +19,11 @@ public class UDPListenerManager
1919
public delegate void ListenerByteEventHandler(byte[] data, string address);
2020
public ListenerByteEventHandler ListenerByteEvent;
2121

22-
#if UNITY_UWP
22+
#if WINDOWS_UWP
2323
private Task task = null;
2424
private DatagramSocket socket = null;
2525
#elif UNITY_EDITOR || UNITY_STANDALONE
26-
private UdpClient udpclient = null;
26+
private UdpClient udpclient = null;
2727
#endif
2828

2929
public UDPListenerManager() { }
@@ -35,7 +35,7 @@ public UDPListenerManager(int port)
3535

3636
public void ConnectListener(int port)
3737
{
38-
#if UNITY_UWP
38+
#if WINDOWS_UWP
3939
if (task==null)
4040
{
4141
task = Task.Run(async () => {
@@ -45,12 +45,12 @@ public void ConnectListener(int port)
4545
});
4646
}
4747
#elif UNITY_EDITOR || UNITY_STANDALONE
48-
udpclient = new UdpClient(port);
48+
udpclient = new UdpClient(port);
4949
udpclient.BeginReceive(new AsyncCallback(ReceiveCallback), udpclient);
5050
#endif
5151
}
5252

53-
#if UNITY_UWP
53+
#if WINDOWS_UWP
5454
async void MessageReceived(DatagramSocket sender, DatagramSocketMessageReceivedEventArgs args)
5555
{
5656
StreamReader reader = new StreamReader(args.GetDataStream().AsStreamForRead());
@@ -63,7 +63,7 @@ async void MessageReceived(DatagramSocket sender, DatagramSocketMessageReceivedE
6363
}
6464
}
6565
#elif UNITY_EDITOR || UNITY_STANDALONE
66-
private void ReceiveCallback(IAsyncResult result)
66+
private void ReceiveCallback(IAsyncResult result)
6767
{
6868
UdpClient udp = (UdpClient)result.AsyncState;
6969
IPEndPoint remote = null;
@@ -76,7 +76,7 @@ private void ReceiveCallback(IAsyncResult result)
7676

7777
public void DisConnectListener()
7878
{
79-
#if UNITY_UWP
79+
#if WINDOWS_UWP
8080
if (socket != null)
8181
{
8282
socket.MessageReceived -= MessageReceived;
@@ -85,7 +85,7 @@ public void DisConnectListener()
8585
task = null;
8686
}
8787
#elif UNITY_EDITOR || UNITY_STANDALONE
88-
if (udpclient != null)
88+
if (udpclient != null)
8989
{
9090
udpclient.Close();
9191
udpclient = null;

Assets/HoloLensModule/Network/UDP/UDPSenderManager.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22
using System.Text;
3-
#if UNITY_UWP
3+
#if WINDOWS_UWP
44
using System.IO;
55
using System.Threading.Tasks;
66
using Windows.Networking;
@@ -15,11 +15,11 @@ namespace HoloLensModule.Network
1515
public class UDPSenderManager
1616
{
1717

18-
#if UNITY_UWP
18+
#if WINDOWS_UWP
1919
private StreamWriter writer = null;
2020
private Task task = null;
2121
#elif UNITY_EDITOR || UNITY_STANDALONE
22-
private Thread thread = null;
22+
private Thread thread = null;
2323
private UdpClient udpclient = null;
2424
#endif
2525

@@ -32,7 +32,7 @@ public UDPSenderManager(string ipaddress, int port)
3232

3333
public void ConnectSender(string ipaddress, int port)
3434
{
35-
#if UNITY_UWP
35+
#if WINDOWS_UWP
3636
task = Task.Run(async () =>
3737
{
3838
DatagramSocket socket = new DatagramSocket();
@@ -57,7 +57,7 @@ public bool SendMessage(string ms)
5757

5858
public bool SendMessage(byte[] data)
5959
{
60-
#if UNITY_UWP
60+
#if WINDOWS_UWP
6161
if (writer != null)
6262
{
6363
if (task == null || task.IsCompleted == true)
@@ -71,7 +71,7 @@ public bool SendMessage(byte[] data)
7171
}
7272
}
7373
#elif UNITY_EDITOR || UNITY_STANDALONE
74-
if (thread == null || thread.ThreadState != ThreadState.Running)
74+
if (thread == null || thread.ThreadState != ThreadState.Running)
7575
{
7676
thread = new Thread(() =>
7777
{
@@ -86,7 +86,7 @@ public bool SendMessage(byte[] data)
8686

8787
public void DisConnectSender()
8888
{
89-
#if UNITY_UWP
89+
#if WINDOWS_UWP
9090
task = null;
9191
#elif UNITY_EDITOR || UNITY_STANDALONE
9292
if (udpclient != null)
60 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)