private void OnTriggerEnter2D(Collider2D other) { var ch = other.GetComponent <ICheckpoint>(); if (ch == null) { var hp = other.GetComponent <HpContainer>(); if (hp != null) { Life.RecoverHp(hp.Hp); hp.gameObject.SetActive(false); Sfx.Collect(); } return; } SetRespawn(ch.GetPosition()); }