-1

I have to make an augmented reality book app using Vuforia and Unity. My Android apps size is 108mb. It's not working with 1GB RAM devices. I want to split the scene into different scenes and load the corresponding scene when a specific image target is found.

Main problem is, that one scene load is huge*. So I need to split the scene and load each scene when an image target is found.

*Editors Note: I don't know wether he means huge perfomance-wise or storage size. Latter means, that he apparently wants to load the scene in runtime from another location.

j08691
  • 204,283
  • 31
  • 260
  • 272

1 Answers1

1

You need to know the names of each of the image target prefabs -

using UnityEngine;
using UnityEngine.SceneManagement;
using System.Collections;
 
public class loadNewScene : MonoBehaviour, ITrackableEventHandler {
     
    private TrackableBehaviour mTrackableBehaviour;
     
     
    void Start () {
        mTrackableBehaviour = GetComponent<TrackableBehaviour>();
        if (mTrackableBehaviour)
        {
            mTrackableBehaviour.RegisterTrackableEventHandler(this);
        }
    }
     
    public void OnTrackableStateChanged(
                                    TrackableBehaviour.Status previousStatus,
                                    TrackableBehaviour.Status newStatus)
    {
        if (newStatus == TrackableBehaviour.Status.DETECTED ||
            newStatus == TrackableBehaviour.Status.TRACKED)
        {
            switch( mTrackableBehaviour.TrackableName ){
                case "Railway" :
                Application.LoadLevel( "rail" );
                break;

                case "Tree" :
                Application.LoadLevel( "tree" );
                break;
            }
        }
    }
     
}