Beispiel #1
0
    IEnumerator InitGame()
    {
        selectedBubbleColors = new HashSet <RelaxBubbleColor>();
        selectedBubbleColors.Add(RelaxBubbleColor.Normal);
        summaryCounterText.GetComponent <Text>().text = "/" + (_gridManager.gridWidthInHexes * _gridManager.gridHeightInHexes).ToString();

        audioSource.clip = mainTrack[UnityEngine.Random.Range(0, mainTrack.Length)];
        if (PlayerPrefs.HasKey("isMusicOff") && bool.Parse(PlayerPrefs.GetString("isMusicOff")))
        {
            audioSource.Pause();
        }
        else
        {
            audioSource.Play();
        }
        _gridManager = this.GetComponent <RelaxGridManager>();
        _gridManager.SetUpGrid(sizeToHeigh[currentBubbleSize]);
        player.transform.position = new Vector3(_gridManager.cameraCenter.x, _gridManager.cameraCenter.y, -10);

        //_pauseScript = pauseButton.GetComponent<PauseScript>();

        yield return(new WaitForSeconds(0.5f));

        menuPanel.SetActive(true);
        yield return(new WaitForSeconds(0.5f));

        tapHereText.GetComponent <UIElement>().Show(false);

        if (UnityEngine.Random.Range(1, 7) == 1)
        {
            RequestInterstitialAds();
        }
    }
Beispiel #2
0
 void UpdateGrid()
 {
     _gridManager = this.GetComponent <RelaxGridManager>();
     _gridManager.ChangeGridShape(sizeToHeigh[currentBubbleSize]);
     player.transform.position = new Vector3(_gridManager.cameraCenter.x, _gridManager.cameraCenter.y, -10);
     burstedCounter            = 0;
     counterText.GetComponent <Text>().text        = burstedCounter.ToString();
     summaryCounterText.GetComponent <Text>().text = "/" + (_gridManager.gridWidthInHexes * _gridManager.gridHeightInHexes).ToString();
 }