Created
March 4, 2018 11:38
-
-
Save bibinba/7bee02afb187fadced26d44b147d6252 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class kill : MonoBehaviour { | |
public Animator death; | |
public ParticleSystem katana; | |
private int a; | |
// Use this for initialization | |
void Start () { | |
a = 0; | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
private void OnTriggerEnter(Collider other) | |
{ | |
if (other.gameObject.tag == "enemy") | |
{ | |
katana.transform.position = other.transform.position; | |
katana.Play(); | |
Debug.Log(a); | |
a++; | |
if (a < 3) | |
{ | |
death.SetTrigger("hit"); | |
} | |
else | |
{ | |
death.SetTrigger("death"); | |
a = 0; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment