示例#1
0
 void OnCollisionEnter2D(Collision2D other)
 {
     if (other.collider.tag == "bullet")
     {
         GameObject eff = Instantiate(effect, other.transform.position, Quaternion.identity);
         Destroy(eff, 0.5f);
         shake_cam.shacknow(shake_power, shake_duration);
     }
 }
示例#2
0
    public void OnCollisionEnter2D(Collision2D other)
    {
        if (other.collider.tag != "ground" && other.collider.tag != "Player" && other.collider.tag != "bullet")
        {
            explosion.SetActive(true);
            ball_effct.play_effect(this.gameObject);
            shake_cam.shacknow(shake_power, shake_duration);

            Destroy(this.gameObject, 0.05f);
        }
    }