We’ve been working on a new package that allows for in-Editor simulation of ARFoundation via a mock AR device. It’s finally ready for you to try.
I’ve added a sample scene to the ARFoundation Samples github repo. It’s in a separate branch, since it relies on a new package that hasn’t been tested extensively. There’s a scene called “MockExample” that runs in the Editor. There’s an API for supplying data to the mock device, such as planes and feature points.
This is very early stuff, and we’ll be updating it soon. It should allow for much faster iteration within the Editor, so I hope you find it useful!
It is a package; the sample repo contains several scripts showing its use. It’s not production quality yet, so you have to do some dances with the package manifest to obtain the package (the samples repo is already setup appropriately).
So I am a bit unsure how this actually works. Is the mock just a remote connection to a mobile device using the Unity Remote app? Or is the mock some sort of build-in editor tool that enables you to ‘fake’ AR within editor?
@Freaking-Pingo This is not a “remote” for testing. As your 2nd statement says, it’s a in editor “mock” tool for testing AR inside of the Unity editor without having to build to device.
EDIT: ARRig script is called ‘Scaler.cs’ in the Mockup scene
Looking forward to iOS build so can test
Just encountered iOS built error also.
Is it possible to get this demo scene because i’m unable to figure out how to rebuilt it from AR Foundation and the mock scene?
Perhaps i’m stupid but it doesn’t seem very intuitive. For eg, demo has ARRig script but sample scene nor Mockup doesn’t.
The “ARRig” in that screenshot is now called “ARSessionOrigin” and all scenes in the sample repo should have this.
The mock example also has a “scaler” script (all it does is set the transform’s localScale). The only difference between the gdc demo and the mock example is a the content is a blue cube instead of a village scene.
Also, the iOS build error hah been fixed but you’ll need to update the package to get the fix (the repo still points to the older package). Also note that the mock doesn’t run on iOS so this is only an error if you happen to set the current build platform to iOS.
@tdmowrer We’ve noticed some major memory leaks occurring in our app that uses ARFoundation with ARKit. As we’ve tried to track where this leak is occurring, I’m noticing that if I simply run the MockExample scene in the Unity Editor and leave it running, that the total allocated memory continuously grows and grows. I started at 0.66GB total allocated, and after about 5 minutes was up to 1.17GB.
Hi! I tried to open the ARFoundation Sample project in mock branch, when I open the project (either in Standalone or in Android) I get the following error:
C:/Users/fiorenti/AppData/Local/Unity/cache/packages/staging-packages.unity.com/com.unity.xr.mock@0.0.1-preview.6/com.unity.xr.remoting/Runtime/RemoteScreenComponent.cs(12,16): error CS0246: The type or namespace name AsyncGPUReadbackRequest' could not be found. Are you missing UnityEngine.Experimental.Rendering’ using directive?