Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Mine : MonoBehaviour {
- Transform playerT;
- GameObject itself;
- // Use this for initialization
- void Awake() {
- playerT = GameObject.FindGameObjectWithTag ("Player").transform;
- }
- void OnTriggerEnter(Collider other)
- {
- if (other.gameObject.tag == "Monster") {
- EnemyHealth enemyHeatlh = other.GetComponent<EnemyHealth> ();
- enemyHeatlh.Death ();
- PyroExplode Pyro = gameObject.AddComponent("PyroExplode") as PyroExplode;
- Pyro.setTransform(transform);
- Pyro.Generate ();
- Destroy (Pyro.gameObject, 1.6f);
- Destroy (this.gameObject, 1.6f);
- }
- }
- }
- public void Generate(){
- Instantiate ( Resources.Load ("Pyro1"), mineTransform.position, mineTransform.rotation);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement