0

I am adding UnityPlayer inside Android View. I am trying to use 2 different scenes for AR in Unity. Scene: 1 => Welcome screen to decide,device supports ARCore Scene: 2 => If the device supports ARCore, launch ARcore scene from my Android Activity Scene : 3 => If the device does not support ARCore, launch Vuforia scene from my Android Activity

So, for scene 1, I need to enable ARCore Supported in XR Settings For scene 2, I need to enable Vuforia Augmented Reality Supported in XR settings Not able to enable both options. So is it possible to set these options at runtime, before launching Unity Player from my Activity?

Mostafa Arian Nejad
  • 1,278
  • 1
  • 19
  • 32
Ramprasad
  • 7,981
  • 20
  • 74
  • 135
  • Yes,that answer completely disable/enable XR settings.But my question is,how to enable particualar XR settings,either Vuforia or ARCore. – Ramprasad Feb 22 '18 at 06:55
  • I might run into similar situation. could you show how add unity scene and player into android view? Thanks – flankechen Mar 26 '18 at 08:26

1 Answers1

1

No. You can't currently do this now but this might change in the future. The reason is because there is no way to disable ARCore at this moment. You can probably suggest that as a feature on their Github page and explain you need it.

For Vuforia, you can disable it with VuforiaBehaviour.Instance.enabled = false; and enable it by setting it to true again.

The problem is that you can't do the-same with ARCore. You might be able to do the-same thing by finding all ARCore components in the scene and disabling them but I am not sure if that will release the camera or even work at-all.

Programmer
  • 121,791
  • 22
  • 236
  • 328
  • Great...so I plan to use ARCore as native Java code and Vuforia with Unity. – Ramprasad Feb 22 '18 at 16:10
  • As a temporary solution, you can do that now. Use ARCore as native Java code, then Vuforia with Unity. You can then make your game menu with Android Studio and Java. Here you can load Unity's app i you wish or your ARCore native app. That should work. The bad side is that you will be writing one program in Java and the other one in C# which makes code portability impossible. – Programmer Feb 22 '18 at 16:15
  • I am using Vuforia as a temporary solution,as ARCore supported devices minimal.Once ARCore released,I will move to ARCore completely, because it is more accurate than Vuforia. – Ramprasad Feb 22 '18 at 16:23
  • Ok. I am not an AR guy and don't know their differences. One question though: Vuforia is not free, right? Is ARCore also not free? – Programmer Feb 22 '18 at 16:24
  • 1
    Vuforia is free for particular features like User Defined Target & Ground Plane supports only.Need to purchase license,when we use cloud based targets. But ARCore is free,as it from Google. – Ramprasad Feb 23 '18 at 06:51