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.MainTheme(); }
public void Resetgame() { theDeathscreen.gameObject.SetActive(false); thePausebutton.SetActive(true); platformlist = FindObjectsOfType <Plat_destroy>(); // megkeresi az összes platformot és belerakja a listába for (int i = 0; i < platformlist.Length; i++) { platformlist[i].gameObject.SetActive(false); //végig megy a listánn és mided inactiválja } theplayer.transform.position = platformstartpoint; // visszaállítás platgen.position = platformstartpoint; theplayer.gameObject.SetActive(true); // inactiv, nem látjuk thescoremanager.scorecount = 0; thescoremanager.scoreincreaseing = true; powerupreset = true; scroll.paralax = true; sound.MainTheme(); }
public void Restartgame() { savebutton.gameObject.SetActive(true); playername.gameObject.SetActive(true); sound.ButtonSound(); sound.MainTheme(); FindObjectOfType <Game_manager>().Resetgame(); }
// Use this for initialization //amit az elején akarok, mert csak egyszer csinálja meg void Start() { myridgedbody = GetComponent <Rigidbody2D>(); // hozzáfér a player adatához // mycollider = GetComponent<Collider2D>(); // a playerhez kapcsolt collidet használja myanimator = GetComponent <Animator>(); //animátor componensek 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.MainTheme(); }