void OnTriggerEnter2D(Collider2D collider) { if (collider.tag.CompareTo("Player") == 0) { GameManager.Instant.AddScore(10); m_pacman.ChangeState(PacmanMove.Pacman_Invicible); Destroy(gameObject); } }
private void OnTriggerEnter2D(Collider2D other) { if (string.Compare(other.tag, "Player", StringComparison.Ordinal) != 0) { return; } GameManager.gameManager.addScore(10); _pacmanMove.ChangeState(PacmanMove.PacmanInvincible); Destroy(gameObject); }