Пример #1
0
    void Start()
    {
        planetUI.SetActive(true);
        homeUI.SetActive(false);

        planetGenerator = GetComponent <PlanetGenerator>();
        factions        = planetGenerator.GenerateFactions();
        terra           = planetGenerator.GenerateTerra();

        //Guardem la terra del principi
        terraAnterior = terra.Copy();

        poolControler = GetComponent <PoolControler>();
        poolControler.CreatePool(InitialPoolNumber);

        laser1.SetActive(false);
        laser2.SetActive(false);

        StartCoroutine(StartRound());
    }
Пример #2
0
    public IEnumerator StartRound()
    {
        if (GameOver)
        {
            if (!GameOverUI.activeSelf)
            {
                StartCoroutine(showGameOverScreen());
                yield return(null);
            }
            else
            {
                SceneManager.LoadScene("mainMenu");
            }
        }
        else
        {
            round++;
            cameraShake.ShowBlackScreen();
            yield return(new WaitForSeconds(cameraShake.BlackscreenAnimationDuration));

            planetUI.SetActive(true);
            homeUI.SetActive(false);


            roundCounter  = 0;
            savedPlanets  = new List <Planet>();
            terraAnterior = terra.Copy();
            viewInfo.SetDificulty(round);

            //poolControler.RefreshFactions();
            roundPlanets = poolControler.GetRoundPool(round / 3 + 3);
            numPlanets   = roundPlanets.Count;

            viewInfo.SetData(roundPlanets[roundCounter]);
            roundActive          = true;
            viewInfo.RoundActive = true;
            cameraShake.HideBlackScreen();
            yield return(new WaitForSeconds(cameraShake.BlackscreenAnimationDuration));
        }
    }