예제 #1
0
 //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;
 }
예제 #2
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);
 }
예제 #3
0
    //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;
        }
    }
예제 #4
0
    // 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);
            }
        }
    }
예제 #5
0
 private void Awake()
 {
     instance = this;
     hide();
 }
예제 #6
0
 public static void Pausegame()
 {
     Pausemenu.ShowStatic();
     Time.timeScale = 0f;
 }
예제 #7
0
 public static void ResumeGame()
 {
     Pausemenu.HideStatic();
     Time.timeScale = 1f;
 }
예제 #8
0
 void Start()
 {
     pause_menu = GameObject.Find("SceneManager").GetComponent <Pausemenu>();
 }