Unity打包Wave VR项目时的AndroidManifest.xml设置

Unity打包Wave VR项目时的AndroidManifest.xml设置

官方文档

具体的修改设置,在官方文件中都有,直接上链接,我就不再多余赘述。
相关的官方文档:https://hub.vive.com/storage/docs/zh-cn/ConfigureAppCapabilities.html

文档

文档修改后的内容如下:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.CNTEN.WaveSample"
    xmlns:tools="http://schemas.android.com/tools">
  
  <application android:icon="@drawable/app_icon"
               android:label="@string/app_name"
               android:theme="@style/Theme.WaveVR.Loading"
               android:resizeableActivity="false"
       tools:replace="android:theme">

    <uses-sdk android:minSdkVersion="25"/>
    
    <!--You can use your theme here.-->
    <activity android:name="com.htc.vr.unity.WVRUnityVRActivity"
              android:label="@string/app_name"
              android:screenOrientation="landscape"
              android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
      android:configChanges="density|fontScale|keyboard|keyboardHidden|layoutDirection|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
      android:enableVrMode="@string/wvr_vr_mode_component">
      
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <category android:name="com.htc.intent.category.VRAPP" />
      </intent-filter>
      
      <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
      <meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true" />
      <meta-data android:name="minWaveSDKVersion" android:value="1" />
      <!--Please consider the DoF support of HMD and controller individually for your content.-->
      <!--Set value3DoF” if your content only considers the rotation pose. -->
      <!--Set value6DoF” if your content considers both rotation and position pose. -->
      <!--Set value3,6DoF” if your content is capable of supporting both 3 and 6 DoF playing. -->
      <meta-data android:name="com.htc.vr.content.NumDoFHmd" android:value="6DoF"/>
      <meta-data android:name="com.htc.vr.content.NumDoFController" android:value="6DoF"/>
      <!--Fill the value of how many controllers the application can support.-->
      <!--The value could be 0, 1 or 2. Use comma(,) between value if your content can support multiple cases.-->
      <!--Set value0if your content supports gaze mode only. -->
      <!--Set value1if your content only supports playing with one controller. -->
      <!--Set value1,2if your content supports playing with either one controller or two controllers. -->
      <!--Set value0,1,2if your content supports all cases, which mean user can play by gaze mode, one controller or two controllers. -->
      <meta-data android:name="com.htc.vr.content.NumController" android:value="2"/>
      
    </activity>
    
  </application>

  <!-- <uses-permission android:name="android.permission.CAMERA" /> -->
  <!-- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> -->
  <uses-permission android:name="vive.wave.vr.oem.data.OEMDataRead" />
  <uses-permission android:name="vive.wave.vr.oem.data.OEMDataWrite" />
</manifest>

其中package="com.CNTEN.WaveSample"是要根据项目中的PlayerSettings->Other Settings->Identification->Package Name设置相同。

文档位置


首先,一看到AndroidManifest.xml文件我们都会到图片中的1号位置(Plugins文件夹下的Android文件夹中)去寻找。但如果你是刚导入的Wave VR SDK就会发现Plugins文件夹下根本就没有Android文件夹;如果你Build报错过后,才会看见这个位置出现了AndroidManifest.xml文件,这时你根据文档去修改这个路径下的文件是不会有用的。
我们应该去修改图片中2号位置的文件,该文件进行修改后,打包时1号位置的文件也会进行同步修改,这也就是只写修改1号位置文件无效的原因。

额外设置

除此之外,还需要一项设置,在另一篇文章中:Unity安卓(WaveVR)打包失败:CommandInvokationFailure: Gradle build failed.

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

天富儿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值