Example #1
0
    public void Init()
    {
        postProcess.profile.TryGetSettings(out depthOfField);
        depthOfField.active = false;
        postProcess.profile.TryGetSettings(out vignette);
        vignette.active = false;

        state                 = EnumStateScene.StartLevel;
        _roundTimeLeft        = roundTime;
        _gameTimeLeft         = gameTime;
        instanceLevel         = Instantiate(instanceLevels[Random.Range(0, instanceLevels.Capacity)], plateauTournant.transform);
        propsSpawnPointsArray = GameObject.FindGameObjectsWithTag("Spawnpoint");
        SpawnProps();
        StopCoroutine(StartLevelText());
        StartCoroutine(StartLevelText());
    }
Example #2
0
 public void Pause()
 {
     pause = !pause;
     if (pause)
     {
         state          = EnumStateScene.Pause;
         Time.timeScale = 0;
         PlayerUI.instance.pauseObject.SetActive(pause);
         SoundManager.instance.PlayPause();
     }
     else
     {
         state          = EnumStateScene.Level;
         Time.timeScale = 1;
         PlayerUI.instance.pauseObject.SetActive(pause);
         SoundManager.instance.Resume();
     }
 }
Example #3
0
    IEnumerator StartLevelText()
    {
        var P_anim = PlayerUI.instance.lauchLevelText.gameObject.GetComponent <Animator>();

        P_anim.SetInteger("LevelStartTextInt", 0);
        yield return(new WaitForSeconds(1.1f));

        PlayerUI.instance.lauchLevelText.text = "2";
        P_anim.SetInteger("LevelStartTextInt", 1);
        yield return(new WaitForSeconds(1.1f));

        PlayerUI.instance.lauchLevelText.text = "1";
        P_anim.SetInteger("LevelStartTextInt", 2);
        yield return(new WaitForSeconds(1.1f));

        PlayerUI.instance.lauchLevelText.text = "GO";
        P_anim.SetInteger("LevelStartTextInt", 3);
        yield return(new WaitForSeconds(0.9f));

        PlayerUI.instance.lauchLevelText.gameObject.SetActive(false);
        PlayerUI.instance.FondLauchLevel.gameObject.SetActive(false);
        state = EnumStateScene.Level;
    }