|
@@ -15,6 +15,7 @@ public class BluetoothDispatcher : MonoBehaviour
|
|
|
|
|
|
|
|
void Dispatch(byte sign, byte[] data)
|
|
void Dispatch(byte sign, byte[] data)
|
|
|
{
|
|
{
|
|
|
|
|
+ if (!IsWindows()) return;
|
|
|
string logStr = sign + ", LEN " + data.Length;
|
|
string logStr = sign + ", LEN " + data.Length;
|
|
|
logStr += ", Bytes " + String.Join(",", data);
|
|
logStr += ", Bytes " + String.Join(",", data);
|
|
|
Debug.Log(logStr);
|
|
Debug.Log(logStr);
|
|
@@ -27,4 +28,18 @@ public class BluetoothDispatcher : MonoBehaviour
|
|
|
shoot(data);
|
|
shoot(data);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ int platformID = -1;
|
|
|
|
|
+
|
|
|
|
|
+ void SetPlatformID()
|
|
|
|
|
+ {
|
|
|
|
|
+ if (Application.platform == RuntimePlatform.WindowsEditor) platformID = 1;
|
|
|
|
|
+ else platformID = 2;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ bool IsWindows()
|
|
|
|
|
+ {
|
|
|
|
|
+ if (platformID == -1) SetPlatformID();
|
|
|
|
|
+ return platformID == 1;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|