12345678910111213141516171819 |
- using System;
- using UnityEngine;
- using System.Collections;
- public class ObstacleDestoyer : MonoBehaviour {
- public GameObject Particle;
- public float DeltaY= 1;
- public void BlowUp()
- {
- if(Particle)
- {
- var go = Instantiate(Particle,transform.position + Vector3.up * DeltaY,transform.rotation);
- Destroy(go,5);
- }
- Destroy (gameObject);
- }
- }
|