Easy Code Scanner + Vuforia + unity5.3.4f1 + android + ios
Easy Code Scanner 下載地址:Easy Code Scanner v2.3
在做 Vuforia 的專案時,需要在遊戲過程中進行二維碼的掃描以進行遊戲的啟用操作。所以使用了這個Easy Code Scanner外掛,Android端和iOS端都可以完美執行使用,非常簡單,不需要在Android端和IOS端寫原生的程式碼。
iOS端完全不用自己寫東西,直接在unity中照著Easy Code Scanner的例子使用它的介面就可以了。Android端則需要修改一下AndroidManifest(因為專案中還使用了Vuforia,Vuforia自帶一個AndroidManifest,需要把這倆個合併一下),Android端的程式碼就不用改了。
Easy Code Scanner 的 AndroidManifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.c4mprod.ezcodescanner"
android:versionCode="3"
android:versionName="1.8" >
<uses-sdk android:minSdkVersion="9" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application
android:debuggable="false"
android:icon="@drawable/app_icon"
android:label="@string/app_name" >
<activity
android:name="com.c4mprod.ezcodescanner.RootActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.c4mprod.ezcodescanner.camera.CameraActivity"
android:screenOrientation="sensor" />
</application>
</manifest>
Vuforia 的 AndroidManifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unity3d.player"
android:installLocation="preferExternal"
android:theme="@android:style/Theme.NoTitleBar"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="22" />
<uses-feature android:name="android.hardware.camera" />
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:debuggable="false">
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
<activity android:name="com.unity3d.player.VideoPlayer"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<!--
To support devices using the TI S3D library for stereo mode we must
add the following library.
Devices that require this are: ODG X6
-->
<uses-library android:name="com.ti.s3d" android:required="false" />
<!--
To support the ODG R7 in stereo mode we must add the following library.
-->
<uses-library android:name="com.osterhoutgroup.api.ext" android:required="false" />
</application>
</manifest>
<!-- android:installLocation="preferExternal" -->
合併後的 AndroidManifest:
<?xml
version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unity3d.player"
android:installLocation="preferExternal"
android:theme="@android:style/Theme.NoTitleBar"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="22" />
<uses-feature android:name="android.hardware.camera" />
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:debuggable="false">
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
<activity android:name="com.unity3d.player.VideoPlayer"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<activity android:name="com.c4mprod.ezcodescanner.RootActivity"
android:label="@string/app_name">
</activity>
<activity android:name="com.c4mprod.ezcodescanner.camera.CameraActivity" android:screenOrientation="sensor"/>
<!--
To support devices using the TI S3D library for stereo mode we must
add the following library.
Devices that require this are: ODG X6
-->
<uses-library android:name="com.ti.s3d" android:required="false" />
</application>
</manifest>
【個人廣告】
希望大家可以支援我的個人微訊號“小遊戲情報局”
相關文章
- Vuforia - AR初探
- Scanner
- android ios UIAndroidiOSUI
- iOS 工程開發中的 Code ReviewiOSView
- Scanner物件物件
- Scanner的使用
- Java Scanner物件Java物件
- iOS 持續整合系列 - 自動化 Code ReviewiOSView
- Scanner——Java基礎Java
- Day11-Scanner
- java小記-scannerJava
- Flutter Android/iOS包大小分析FlutterAndroidiOS
- iOS/Android 影片編輯SDKiOSAndroid
- ●Joyoi Easy
- Java的方法Scanner類Java
- java中Scanner類使用Java
- JavaScript如何呼叫Native iOS/Android 方法JavaScriptiOSAndroid
- Android與iOS測試注意點AndroidiOS
- Android 和 iOS 圖片輪播AndroidiOS
- As Easy As A+B
- Leetcode(easy heap)LeetCode
- Easy-Admin
- LeetCode-EasyLeetCode
- 【BUUCTF】Easy JavaJava
- 【BUUCTF】easy calc
- 字串魔法(easy)字串
- # Scanner:區別next和nextLine
- Scanner類、Random類、ArrayList類random
- Heavy Duty Truck Diagnostic Scanner and Software
- Scanner類,System類,Runtime類
- 使用者互動Scanner
- H5 呼叫 Android 和 iOS 方法H5AndroidiOS
- 探索 react-native run-ios(android)ReactiOSAndroid
- Android/iOS內嵌Unity開發示例AndroidiOSUnity
- iOS通關書單,Android可入iOSAndroid
- ? React-Native 官方示例演示 ( ios & android)ReactiOSAndroid
- 使用 JSBridge 與原生 IOS、Android 進行互動(含 H5、Android、IOS 端程式碼,附 Demo)JSiOSAndroidH5
- vue-easy-rendererVue
- type challenge(easy 部分)