public void Resumegame() { sound.ButtonSound(); Time.timeScale = 1f; // unity saját idő mérője 0-megál, 1 normál pausemenu.SetActive(false); sound.MainMusic(); }
public void ReStartGame() { theDeathscreen.gameObject.SetActive(false); thePausebutton.SetActive(true); platformlist = FindObjectsOfType <Plat_destroy>(); for (int i = 0; i < platformlist.Length; i++) { platformlist[i].gameObject.SetActive(false); } platformgen.spikethreshold = values.spikethreshold; platformgen.enemythreshold = values.enemythreshold; theplayer.transform.position = platformstartpoint; platgen.position = platformstartpoint; theplayer.gameObject.SetActive(true); thescoremanager.scorecount = 0; thescoremanager.scoreincreaseing = true; powerupreset = true; scroll.parallax = true; sound.MainMusic(); }
public void RestartgameFromDeath() { savebutton.gameObject.SetActive(true); playername.gameObject.SetActive(true); sound.ButtonSound(); sound.MainMusic(); FindObjectOfType <Game_manager>().ReStartGame(); }
void Start() { myridgedbody = GetComponent <Rigidbody2D>(); myanimator = GetComponent <Animator>(); jumptimecounter = jumptime; speedMilestoneCounte = speedIncreaseMilestone; speedIncreaseMilestoneStore = speedIncreaseMilestone; movespeedstore = movespeed; speedmilestonecountstore = speedMilestoneCounte; tempMoveSpeedUp = movespeed * speedup; tempMoveSpeedDown = movespeed * speeddown; tempMoveSpeedDownstore = tempMoveSpeedDown; tempMoveSpeedUpstore = tempMoveSpeedUp; pause = FindObjectOfType <Pause_menu>(); sound = FindObjectOfType <Audio_manager>(); shoot = FindObjectOfType <Shoot_bullet>(); life = 3f; lifetext.text = "Life: " + Mathf.Round(life); sound.MainMusic(); }