private void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.tag == "life") { life = life + 1; } if (other.gameObject.tag == "killbox") { thegamemanager.EndGame(); speedIncreaseMilestone = speedIncreaseMilestoneStore; speedMilestoneCounte = speedmilestonecountstore; movespeed = movespeedstore; tempMoveSpeedDown = tempMoveSpeedDownstore; tempMoveSpeedUp = tempMoveSpeedUpstore; life = 3f; sound.DeathSound(); } if (other.gameObject.tag == "enemy") { other.gameObject.SetActive(false); GetPlayerHit(); } }
private void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.tag == "life") { life = life + 1; } if (other.gameObject.tag == "killbox") { thegamemanager.Restartgame(); // meghívja a metódust speedIncreaseMilestone = speedIncreaseMilestoneStore; speedMilestoneCounte = speedmilestonecountstore; movespeed = movespeedstore; tempMoveSpeedDown = tempMoveSpeedDownstore; tempMoveSpeedUp = tempMoveSpeedUpstore; life = 3f; sound.DeathSound(); } if (other.gameObject.tag == "enemy") // ha összeér a killbox-al jelölt objectumhoz(catcher) { other.gameObject.SetActive(false); GetPlayerHit(); /* if (life == 0) * { * { * * * * thegamemanager.Restartgame(); // meghívja a metódust * * speedIncreaseMilestone = speedIncreaseMilestoneStore; * speedMilestoneCounte = speedmilestonecountstore; * movespeed = movespeedstore; * tempMoveSpeedDown = tempMoveSpeedDownstore; * tempMoveSpeedUp = tempMoveSpeedUpstore; * * * life = 3f; * sound.DeathSound(); * * } * } */ } }