private void OnCollisionEnter2D(Collision2D col) { if (col.collider.CompareTag("monster")) { bulletPool.ReturnInstance(gameObject); time = 0; } }
//怪物死亡动画 public void Die() { animator.SetBool("Die", true); if (animator.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1.0f && (animator.GetCurrentAnimatorStateInfo(0).IsName("Slime_Die"))) { monsterPool.ReturnInstance(gameObject); } }