Advertisement
Guest User

Untitled

a guest
May 24th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. if (Input.GetButtonDown ("Attack1"))
  2. {
  3.     animator.SetTrigger ("Attack_01");
  4.     StartCoroutine("Attack1");
  5. }
  6.  
  7. IEnumerator Attack1()
  8. {
  9.     yield return new WaitForSeconds (0.5f);
  10.     attack1 = true;
  11.     yield return null;
  12.     attack1 = false;
  13. }
  14.  
  15. void OnTriggerEnter2D(Collider2D other)
  16. {
  17.     if (other.tag == "Enemy" && attack == true)
  18.     {
  19.         other.GetComponent<Animator>().SetBool ("Death_bool",true);
  20.         other.GetComponent<Animator>().SetTrigger ("Death");
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement