public void OnTrapLanding() { SetAnimations(false, false, false, false); _animator.SetBool(_deathAnimKey, true); _rigidbody2D.simulated = false; _sceneController.OnDeath(); }
private void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.layer == LayerMask.NameToLayer("Coin")) { Debug.Log(other); OnCoinCollected(other.transform.parent.GetComponent <CoinObjectLogic>()); return; } if (other.gameObject.layer == LayerMask.NameToLayer("Time")) { Debug.Log(other); var timeLogic = other.transform.parent.GetComponent <TimeObjectLogic>(); timeLogic.OnCollected(); return; } if (other.gameObject.layer == LayerMask.NameToLayer("Trap")) { Debug.Log("TRAP: " + other); SetAnimations(false, false, false, false); _animator.SetBool(_deathAnimKey, true); _sceneController.OnDeath(); return; } }