Question by
Meena_Fari · Mar 28, 2016 at 12:39 AM ·
objectload scenedestroygameobject
check object destroyed and load new scene
I want to check that object is destroyed or not, if object is destroyed then load new scene. here is my script:
using UnityEngine;
using System.Collections;
public class hey : MonoBehaviour {
void Start(){
GetComponent<ParticleSystem> ().emissionRate = 0;
}
void Update(){
if (Input.GetMouseButtonDown (1)) {
GetComponent<ParticleSystem> ().Emit (20);
}
}
void OnParticleCollision(GameObject obj)
{
Destroy (obj, 2.0f);
//here i want to check and then load new scene..
//I try that thing, but failed..nothing happen
if (object.Equals (obj, null)) {
Application.LoadLevel (7);
}
//also this one, but nothing happens
if(gameObject.tag=="fire123"==null){
Application.LoadLevel (7);
}
// also this one too, but failed :-(
void OnDestroy(){
Application.LoadLevel (7);
} }
Comment