Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Mine : MonoBehaviour {
  5.  
  6. Transform playerT;
  7. GameObject itself;
  8.  
  9. // Use this for initialization
  10. void Awake() {
  11. playerT = GameObject.FindGameObjectWithTag ("Player").transform;
  12. }
  13.  
  14.  
  15. void OnTriggerEnter(Collider other)
  16. {
  17. if (other.gameObject.tag == "Monster") {
  18.  
  19. EnemyHealth enemyHeatlh = other.GetComponent<EnemyHealth> ();
  20. enemyHeatlh.Death ();
  21.  
  22. PyroExplode Pyro = gameObject.AddComponent("PyroExplode") as PyroExplode;
  23.  
  24. Pyro.setTransform(transform);
  25. Pyro.Generate ();
  26.  
  27. Destroy (Pyro.gameObject, 1.6f);
  28. Destroy (this.gameObject, 1.6f);
  29.  
  30. }
  31. }
  32. }
  33.  
  34. public void Generate(){
  35. Instantiate ( Resources.Load ("Pyro1"), mineTransform.position, mineTransform.rotation);
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement