Example #1
0
 private void AuraSetActive(bool value)
 {
     if (value == false)
     {
         auraSoundSource.enabled = false;
         goIntoAuraMessage.SetActive(false);
         directionalIndicatorToAura.SetActive(false);
         directionalIndicatorToAura.GetComponent <DirectionIndicator>().DirectionIndicatorObject.GetComponent <MeshRenderer>().enabled = false;
         particlesArea.SetActive(false);
     }
     else
     {
         auraSoundSource.enabled = true;
         uiMenuHandler.PutInFrontOfCamera(goIntoAuraMessage);
         goIntoAuraMessage.SetActive(true);
         particlesArea.SetActive(true);
         //directionalIndicatorToAura.SetActive(true);
     }
 }
Example #2
0
    private IEnumerator CountdownThenSpawn()
    {
        currentPhaseOfLevel = PhaseOfLevel.TRAVEL_FLOW;
        countdownStarted    = true;
        int timer = countdownToStartGame;

        if (countdownStartGame.activeInHierarchy == false)
        {
            uiMenuScript.PutInFrontOfCamera(countdownStartGame);
            countdownStartGame.SetActive(true);
        }

        while (timer >= 0)
        {
            if (timer == 5)
            {
                WebClientSender.instance.ResetLedDolphin(); //Some of these commands are redundant due to the fact sometimes they are not executed because of connection unstable
            }
            yield return(new WaitForSeconds(1f));

            timer--;
            labelCountdownTextMesh.text = timer.ToString();
        }

        WebClientSender.instance.OpenEyesDolphin();
        WebClientSender.instance.ResetLedDolphin();


        countdownStartGame.SetActive(false);
        labelCountdownTextMesh.text = countdownToStartGame.ToString();


        if (gameModeSelected == GameMode.TUTORIAL)
        {
            StartCoroutine(SpawnWavesTutorial());
        }
        else if (gameModeSelected == GameMode.TUTORIAL_BASIC)
        {
            StartCoroutine(SpawnWavesTutorialBasic());
        }
        else
        {
            StartCoroutine(SpawnWavesRandom()); //spawnWavesRandomCoroutine = StartCoroutine(SpawnWavesRandom()); If we want to later stop coroutine (not recommended with this complex one)
        }
        countdownStarted = false;
    }