private void OnCollisionEnter2D(Collision2D collision) { if (collision.collider.tag == "Player") { Debug.Log("Collided with player"); PlayerCollisionEvent.Raise(); } }
private void OnCollisionEnter2D(Collision2D collision) { if (collision.collider.tag == "Player") { Debug.Log("Collided with player"); OnSeedCollected.Raise(); SeedAnim.SetTrigger("OnCollected"); GetComponent <Collider2D>().enabled = false; } }
public void OnPlayerHit() { int heartCounts = hearts.Count; if (hearts.Count > 0) { for (int index = heartCounts - 1; index >= 0; --index) { if (hearts[index].IsActive()) { hearts[index].enabled = false; if (index == 0) { OnPlayerDeathEvent.Raise(); } break; } } } }
public void OnResumeGame() { OnGameResumedEvent.Raise(); gameObject.SetActive(false); PauseButton.gameObject.SetActive(true); }