private void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.CompareTag("NextScene")) { SceneMngr.NextScene(); } }
void OnBecameInvisible() { Destroy(gameObject); SceneMngr s = new SceneMngr(); s.Restart(); }
// Start is called before the first frame update protected virtual void Start() { gridRef = FindObjectOfType <Grid>(); playerRef = FindObjectOfType <Player>(); mngrRef = FindObjectOfType <SceneMngr>(); iFrameCounter = amntIframe; // set the iframecounter so you can take damage from the start of the game }