ARFoundation foundations

After Unite2018, I found out that I have some work ahead of me!

Along with frankly mindblowing new Entity Component System, and fresh (for me) news of Tiny Unity, I also learned that Unity is hard at work on a lot of fantastic AR features, wrapped up in ARFoundation.

I picked it up and started playing with it today, after downloading the example project from here : https://github.com/Unity-Technologies/arfoundation-samples

Below, A quick code snippet for anyone who needs it. Its a kind of foundational thing, being able to subscribe to an event, but especially with something as integral as the session state of the AR Session, it seemed like a good place to start. From this information you can give prompts in your app to control the basic flow of the app.

using UnityEngine.XR.ARFoundation;

public class SubsystemStateManager : MonoBehaviour {

    private void Start() {
        ARSubsystemManager.systemStateChanged += Change;
    }

    void Change( ARSystemStateChangedEventArgs e)
    {
        print( "state changed to : " + e.state);
    }
}
Share