private void OnCollisionEnter(Collision collision) { if (delay > 0) { return; } delay = 0.5f; if (collision.gameObject.name.StartsWith("shotEnemy_prefab")) { Destroy(collision.gameObject); PlayerScore.GetInstancePlayerScore().ReduceLives(); } }
// Start is called before the first frame update private void OnCollisionEnter(Collision collision) { if (collision.gameObject.name.StartsWith("shot_prefab")) { if (m_Animator != null) { m_Animator.SetTrigger("Hit"); } Destroy(collision.gameObject); GameObject enemy = GetComponent <Transform>().gameObject; string tag = enemy.tag; Destroy(enemy, 0.5f); PlayerScore.GetInstancePlayerScore().ScoreCounter(tag); if (tag.Equals("0")) { RandomUfoController.GetInstanceRandomUfoController().ReloadUfoAppear(); } } }