I’m building a mobile game for android, and i’ve gotten pretty far with no issues. My scenes were loading properly and everything was working fine on both the Unity Editor and the Android APK until recently. I have a “Loading Page” transition into every scene. My game starts off with a splash scene, then loads to the transition “Loading Page” and then to the “Main Page”. On both the Unity Editor and the Android APK, these all load fine. In my “Main Page”, i have a “Start” button, which when clicked, it loads the “Game Page”. In the Unity Editor, when i press the “Start” button everything runs smoothly and it loads perfectly fine. When i build the Android APK and try pressing the “Start” button on mobile, it takes me to the transition “Loading Page” no problem, but then just freezes and never loads the “Game Page”. This has only started happening recently, and i have not made that many changes to my game. I went as far as to start a whole new project from scratch and building it all again and starting from today the issue has started again. I am using Photon Network, and thought that maybe that was the issue due to me just recently getting Unity_2017. I removed all Photon Network scripts and all assets from my project and loaded all scenes offline through SceneManager.LoadAsync, and am still getting the same issue… I’ve tried loading other scenes other than the “Game Page” after the transition “Loading Page” but still the same issue. I removed all 3D objects from my scenes and even went as far as to removing all 3D objects from the project entirely.
I am confused as to what is going on here. If someone has some kind of answer to this or some way i can try to resolve this it would be greatly appreciated!!! Please help!!
This is the code i am using to transition from scene to scene through the “Loading Page” :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using UnityEngine.EventSystems;
public class LoadingText : MonoBehaviour {
private AsyncOperation ao;
private int levelToLoad;
private string lastLoadedScene;
// Use this for initialization
IEnumerator Start () {
lastLoadedScene = getLastLoadedScene.getLastLevel ();
if (lastLoadedScene == "SplashNameLoad") {
levelToLoad = 2;
}
else if (lastLoadedScene == "Main") {
levelToLoad = 3;
}
ao = SceneManager.LoadSceneAsync (levelToLoad);
ao.allowSceneActivation = false;
GetComponent<Text> ().text = "Loading";
yield return new WaitForSeconds (0.5f);
GetComponent<Text> ().text = "Loading.";
yield return new WaitForSeconds (0.5f);
GetComponent<Text> ().text = "Loading..";
yield return new WaitForSeconds (0.5f);
GetComponent<Text> ().text = "Loading...";
yield return new WaitForSeconds (0.5f);
GetComponent<Text> ().text = "Loading..";
yield return new WaitForSeconds (0.5f);
GetComponent<Text> ().text = "Loading.";
yield return new WaitForSeconds (0.5f);
GetComponent<Text> ().text = "Loading";
ao.allowSceneActivation = true;
}
}