###前提・実現したいこと
SLAMを使用してマーカーレストラッキングを実現させています。
その際、アプリをサーフェイスなどのタブレットPCで
起動させたいと考えています。
なので、Unityで対象をPCにしてビルドしてみたのですが、
エラーが発生し、ビルドが成功しません。
Kudanのサンプルシーンを試しにビルドしています。
以下のコードはすべてサンプルに入っているものです。
###発生している問題・エラーメッセージ
エラーメッセージは2種類で
Assets/KudanAR/Scripts/Classes/TrackeriOS.cs(435,25): error CS0103: The name `NativeInterface' does not exist in the current context
Error building Player because scripts had compiler errors
の2つです。
下のメッセージに関しましては、
スクリプトのエラーが発生しているからビルドできないよ、
という意味であると理解しておりますので、
問題は1つめのエラーメッセージの内容です。
###該当のソースコード
問題が起きているのはTrackeriOS.cs内の以下の関数です。
C#
1 public override void ArbiTrackGetPose(out Vector3 position, out Quaternion orientation) 2 { 3 float[] result = new float[7]; 4 NativeInterface.ArbiTrackGetPose(result); 5 6 position = new Vector3(result[0], result[1], -result[2]); 7 orientation = new Quaternion(result[3], result[4], result[5], result[6]); 8 }
問題のArbiTrackGetPoseを呼んでいる所は
C#
1 public void ArbiTrackGetPose(out Vector3 position, out Quaternion orientation) 2 { 3 _trackerPlugin.ArbiTrackGetPose(out position, out orientation); 4 }
となっております。
_trackerPluginは以下のように定義されます。
C#
1 void GetPlugin () 2 { 3#if UNITY_EDITOR_OSX 4 _trackerPlugin = new TrackerOSX(); 5 checkEditorLicenseKey(); 6 checkLicenseKeyValidity(); 7#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN 8 _trackerPlugin = new TrackerWindows(); 9 checkEditorLicenseKey(); 10 checkLicenseKeyValidity(); 11#elif UNITY_IOS 12 _trackerPlugin = new TrackeriOS(_background); 13#elif UNITY_ANDROID 14 _trackerPlugin = new TrackerAndroid(_background); 15#endif 16 }
windows版でビルドしたいのにiOSのスクリプトでエラーが発生していますので、
どこかおかしいのは分かるのですが、GetPluginを修正して、
_trackerPluginを分岐させたのに治らないので質問させていただきます。
###試したこと
1、GetPlugin内にUNITY_STANDALONE_WINの記述がなかったため、
それを追加。
2、ビルドを試しているPCには元々カメラが搭載されていないので、
Webカメラを接続し、ビルド
3、以下をコメント化してビルド
#elif UNITY_IOS _trackerPlugin = new TrackeriOS(_background);
上記どれを試してみても、エラーメッセージの文言は変わりませんでした。
###補足情報(言語/FW/ツール等のバージョンなど)
Unity5.3.6f1
Kudan1.4
C#
###追記(20170123):
エラーが発生するのはビルドを実行した直後です。
それまではconsoleにエラーは表示されていません。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。