我正在使用对撞机脚本在撞到物体时结束游戏。我使用的代码不起作用。请帮忙!
using UnityEngine;
using UnityEngine.SceneManagement;
using System.Collections;
public class Collider : MonoBehaviour {
void OnTriggerEvent(Collider other){
Debug.Log (other.tag);
if (other.tag == "Wall") {
Debug.Log ("collided");
// Application.LoadLevel ("level one");
SceneManager.LoadScene (2);
} if (other.tag == "End"){
SceneManager.LoadScene(6);
}
}
}