My Scene does not open, but it goes to black screen (middle of the fading)?
I tested this with out fading and it worked and went to the losing scene.
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class loseParticle : MonoBehaviour {
public GameObject explosionPrefab;
void OnTriggerEnter2D(Collider2D obj) {
GameObject explosionObject = Instantiate(explosionPrefab, this.transform.position, Quaternion.identity) as GameObject;
Destroy (explosionObject, 5f);
Destroy (obj.gameObject);
StartCoroutine(ChangeLevel());
}
IEnumerator ChangeLevel () {
float fadeTime = GameObject.Find("_GM").GetComponent<Fading>().BeginFade(1);
yield return new WaitForSeconds(fadeTime);
SceneManager.LoadScene(2);
}
}