public void _ButtonResum()
 {
     GetComponent <AudioSource>().Play();
     Time.timeScale = 1;
     PanelPause.SetActive(false);
     pause.gameObject.SetActive(true);
 }
示例#2
0
    void Awake()
    {
        panelPause = goPanelPause.GetComponent<PanelPause> ();

        button = gameObject.GetComponent<Button> ();
        button.onClick.AddListener (delegate() {
            buttonClick();
        });

        sound = gameObject.GetComponent<AudioSource>();
    }
示例#3
0
 private void Start()
 {
     Instance    = this;
     _pausePanel = FindObjectOfType <PanelPause>();
     Debug.Log(_pausePanel);
     if (_pausePanel != null)
     {
         if (_pausePanel.gameObject.activeSelf)
         {
             _pausePanel.gameObject.SetActive(false);
         }
     }
 }
示例#4
0
    public void PauseGame()
    {
        if (panelDebug.activeInHierarchy)
        {
            panelDebug.SetActive(false);
        }
        PlayerScript playerScript;

        if (gameManagerScript.IsVirtualCamFollowingScientist)
        {
            playerScript = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerScript>();
        }
        else
        {
            playerScript = GameObject.FindGameObjectWithTag("Robot").GetComponent <PlayerScript>();
        }
        if (!PanelPause.activeInHierarchy)
        {
            if (PanelInventory.activeInHierarchy)
            {
                PanelInventory.SetActive(false);
                return;
            }
            playerScript.IsAbleToAttack = false;
            Time.timeScale = 0;
            PanelBoss.SetActive(false);
        }
        else
        {
            Time.timeScale = 1;
            StartCoroutine(AttackBool(playerScript));
            panelParameters.SetActive(false);
            PanelInventory.SetActive(false);
            if (isLastPanelBossActive)
            {
                PanelBoss.SetActive(true);
            }
        }
        PanelPause.SetActive(!PanelPause.activeInHierarchy);
    }
 //resumes the game from the paused state
 public void resumeGame()
 {
     Time.timeScale = 1;
     PanelPause.SetActive(false);
 }
    //Pauses the game and timescale

    public void pauseGame()
    {
        Time.timeScale = 0.0001F;
        PanelPause.SetActive(true);
    }
示例#7
0
 public void Unpause()
 {
     Time.timeScale = 1f;
     PanelPause.SetActive(false);
     JoystickCanvas.SetActive(true);
 }
示例#8
0
    void Awake()
    {
        AdControl.hideBanner();

        Application.targetFrameRate = 60;

        gameState = GameConst.GAME_STATE.PLAYING;

        bonusStyleControl = GetComponent<BonusStyleControl> ();

        trans = GetComponent<Transform> ();

        canvas = GameObject.Find ("Canvas");

        score = canvas.GetComponent<Score>();

        panelGameOver = goPanelGameover.GetComponent<PanelGameOver> ();

        panelPause = goPanelPause.GetComponent<PanelPause> ();

        listSnake = new List<SnakeBody> ();
        listFood = new List<Food>();
        snakeState = GameConst.snakeState.MOVING;

        AudioSource[] audios = gameObject.GetComponents<AudioSource> ();
        combineSound = audios[0];
        eatSound = audios[1];
        crushSound = audios[2];
    }