//for game end and Finalscore card display public void GameEnd() { Invoke("ScoreCardEnabled", 1.6f); //for final score card late display Pausemenu.SetActive(false); //for pause menu disable infomenu.SetActive(false); //SoundController.Static.bgSound.volume = 0; }
void Start() { //cache the player, spawnpoint and other important objects player = GameObject.Find("CubePlayer"); spawn_point = GameObject.Find("Spawnpoint"); pause_menu = GameObject.Find("SceneManager").GetComponent <Pausemenu>(); event_system = gameObject.GetComponent <EventSystemScript>(); death_menu = GameObject.Find("Deathmenu").GetComponent <Canvas>(); powerups = GameObject.FindGameObjectsWithTag("Powerup"); set_active(false); }
//for ingame ui buttons controls public void OnButtonClick(string ButtonName) { switch (ButtonName) { //for pause button case "Pause": Time.timeScale = 0; Pausemenu.SetActive(false); ResumeMenuParent.SetActive(true); infomenu.SetActive(false); SoundController.Static.PlayClickSound(); //for click sound break; //for resume button case "Resume": Time.timeScale = 1; ResumeMenuParent.SetActive(false); Pausemenu.SetActive(true); infomenu.SetActive(true); SoundController.Static.PlayClickSound(); //for click sound break; //for playagain button case "PlayAgain": Application.LoadLevelAsync(Application.loadedLevelName); //for game re loaded Time.timeScale = 1; ResumeMenuParent.SetActive(false); GameEndMenuParent.SetActive(false); SoundController.Static.PlayClickSound(); //for click sound print("play btn Clicked"); break; //for home button case "Home": Application.LoadLevelAsync("MainMenu"); //for mainmenu scene ResumeMenuParent.SetActive(false); SoundController.Static.PlayClickSound(); //for click sound break; //for Facebook button case "FbLike": string fbUrl = "https://www.facebook.com/AceGamesHyderabad"; //for open acegame fb page Application.OpenURL(fbUrl); //for open acegame fb page SoundController.Static.PlayClickSound(); //for click sound break; } }
// Update is called once per frame void Update() { //for Distance if (GameController.CurrentState == GameController.GameState.GamePlay) { Distance_IngameCount(); //for Coins Coins_IngameCount(); // for Score Score_IngameCount(); //for multiplier Multiplier_IngameCount(); } #if UNITY_EDITOR #endif if (Input.GetKeyDown(KeyCode.Escape)) { if (!GameEndMenuParent.activeSelf) { if (Time.timeScale != 0) { Time.timeScale = 0; Pausemenu.SetActive(false); ResumeMenuParent.SetActive(true); infomenu.SetActive(false); SoundController.Static.PlayClickSound(); //for click sound } else { Time.timeScale = 1; ResumeMenuParent.SetActive(false); Pausemenu.SetActive(true); infomenu.SetActive(true); SoundController.Static.PlayClickSound(); //for click sound } } else { Application.LoadLevel(1); } } }
private void Awake() { instance = this; hide(); }
public static void Pausegame() { Pausemenu.ShowStatic(); Time.timeScale = 0f; }
public static void ResumeGame() { Pausemenu.HideStatic(); Time.timeScale = 1f; }
void Start() { pause_menu = GameObject.Find("SceneManager").GetComponent <Pausemenu>(); }