Advertisement
rdgorodrigo

coef2

Jul 23rd, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class PowerupScript : MonoBehaviour{
  5. new AudioSource audio;
  6. public Animator anim;
  7.  
  8. void Start() {
  9. audio = GetComponent<AudioSource>();
  10. }
  11. void OnTriggerEnter(Collider other)
  12. {
  13. if (other.tag == "Enemy") {
  14. Tortuga playerScript = other.gameObject.GetComponent<Tortuga> ();
  15. anim = other.gameObject.GetComponentInChildren<Animator> ();
  16.  
  17. if (playerScript) {
  18. // We speed up the player and then tell to stop after a few seconds
  19. anim.SetInteger ("muerte", 1);
  20. playerScript.coeffSpeedUp = 9.5f;
  21. StartCoroutine (playerScript.StopSpeedUp ());
  22.  
  23. if (playerScript.StopSpeedUp = 9.5f){
  24.  
  25. anim.SetInteger ("muerte", 0);
  26.  
  27. }
  28.  
  29. audio.Play ();
  30. }
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement