2017-12-08 14 views
0

私はHoloLensを使用しており、GPSが必要です。私はHoloLensをBluetooth GPSレシーバーに接続し、UWP(project)でGPSデータを読み取るプロジェクトを見つけました。HoloLensのUWPアプリをUnityに変換

Unityに私のGPSデータが必要なので、UWPコードをUnityに変換しようとしていますが、UnityにはC#StreamSocketsなどがありません。

ユニティで特定のUWPコードを使用する最も良い方法は何ですか?

答えて

0

あなた、あなたのスクリプトで簡単に言えば、プラットフォームのディレクティブNETFX_CORE:

#if NETFX_CORE 
    using Windows.Networking.Sockets; 
#endif 

private void MyFunctionForHololens() 
{ 
    #if NETFX_CORE 
     // UWP code here using StreamSocket class 
    #else 
     // non-UWP core here (maybe some error message for platform not supported) 
    #endif 
} 

ユニティのプラットフォームディレクティブのドキュメント:https://docs.unity3d.com/Manual/PlatformDependentCompilation.html

関連する問題