Esempio n. 1
0
 private void Update()
 {
     if (LoaderManager.Get().OnLevel())
     {
         time += Time.deltaTime;
     }
 }
Esempio n. 2
0
 void TextLoader()
 {
     int loadingVal = (int)(LoaderManager.Get().loadingProgress * 100);
     loadingText.text = loadingVal.ToString() + "%";
     if (LoaderManager.Get().loadingProgress >= 1)
         SetVisible(false);
 }
    IEnumerator ChangeScene(string sceneName)
    {
        AudioSource.PlayClipAtPoint(audioSelect, CameraController.Get().transform.position, 1f);
        yield return(new WaitForSeconds(2));

        LoaderManager.Get().LoadScene(sceneName);
    }
Esempio n. 4
0
 void BarLoader()
 {
     int loadingVal = (int)(LoaderManager.Get().loadingProgress * 100);
     Debug.Log(loadingVal * 0.01);
     loadingBar.fillAmount = (loadingVal*0.01f);
     if (LoaderManager.Get().loadingProgress >= 1)
         SetVisible(false);
 }
Esempio n. 5
0
    public void ForcedChangeScene()
    {
        if (SceneManager.GetActiveScene().name == "Gameplay")
        {
            Destroy(GameManager.Get().gameObject);
            Destroy(WaveSystem.Get().gameObject);
            Destroy(TurretSpawner.Get().gameObject);
            Destroy(Highscore.Get().gameObject);
            Destroy(MilestoneManager.Get().gameObject);

            UpgradeSystem upgrades = UpgradeSystem.Get();

            if (upgrades)
            {
                upgrades.CleanList();
            }
        }
        else if (SceneManager.GetActiveScene().name == "Upgrade Screen")
        {
            AkSoundEngine.StopAll();
        }



        if (sceneName == "Gameplay")
        {
            AkSoundEngine.StopAll();
            UpgradeSystem upgrades = UpgradeSystem.Get();

            if (upgrades)
            {
                upgrades.CleanList();
            }

            LoaderManager.Get().LoadScene(sceneName);
            UILoadingScreen.Get().SetVisible(true);
        }
        else if (sceneName == "Upgrade Screen")
        {
            AkSoundEngine.StopAll();

            UpgradeSystem upgrades = UpgradeSystem.Get();

            if (upgrades)
            {
                upgrades.CleanList();
            }

            SceneManager.LoadScene(sceneName);
        }
        else
        {
            SceneManager.LoadScene(sceneName);
        }

        Time.timeScale = 1;
    }
Esempio n. 6
0
    public void Update()
    {
        int loadingVal = (int)(LoaderManager.Get().loadingProgress * 100);

        loadingText.text = "Loading Level " + gameMan.level + " " + loadingVal;
        if (LoaderManager.Get().loadingProgress >= 1)
        {
            SetVisible(false);
        }
    }
Esempio n. 7
0
    public void Update()
    {
        int loadingVal = (int)(LoaderManager.Get().loadingProgress * 100);

        loadingText.text = loadingVal + "%";
        if (LoaderManager.Get().loadingProgress >= 1)
        {
            SetVisible(false);
        }
    }
    public void Update()
    {
        int loadingVal = (int)(LoaderManager.Get().loadingProgress * 100);

        loadingText.text = "Loading " + loadingVal;
        if (LoaderManager.Get().loadingProgress >= 1)
        {
            Destroy(this.gameObject);
        }
    }
Esempio n. 9
0
 public void NextLvl()
 {
     level++;
     LoaderManager.Get().LoadScene("GameScene");
     UILoadingScreen.Get().SetVisible(true);
     landingScreen.SetActive(false);
     winText.gameObject.SetActive(false);
     loseText.gameObject.SetActive(false);
     next.onClick.RemoveAllListeners();
 }
Esempio n. 10
0
 public bool Playing()
 {
     if (LoaderManager.Get().OnLevel())
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 11
0
    public void Update()
    {
        int loadingVal = (int)(LoaderManager.Get().loadingProgress * 100);

        loadingText.text = "LOADING LEVEL " + PlayerStatusSave.Get().level.ToString() + " " + loadingVal + "%";
        loadingBar.value = loadingVal;
        if (LoaderManager.Get().loadingProgress >= 1)
        {
            SetVisible(false);
        }
    }
Esempio n. 12
0
 public void GoToThisScene()
 {
     if (sceneName == "Level")
     {
         LoaderManager.Get().LoadScene(sceneName);
         UILoadingScreen.Get().SetVisible(true);
     }
     else
     {
         SceneManager.LoadScene(sceneName);
     }
 }
Esempio n. 13
0
    public void Update()
    {
        int loadingVal = (int)(LoaderManager.Get().loadingProgress * 100) + 1;

        loadingText.text = "LOADING LEVEL " + loadingVal + "%";
        loadingBar.value = loadingVal;
        if (LoaderManager.Get().loadingProgress >= 1)
        {
            LoaderManager.Get().loadingProgress = 0;
            LoaderManager.Get().timeLoading     = 0;
            SetVisible(false);
        }
    }
Esempio n. 14
0
    public void Update()
    {
        int loadingVal = (int)(LoaderManager.Get().loadingProgress * 100);

        loadingText.text = "Loading " + loadingVal;
        if (LoaderManager.Get().loadingProgress >= 1 && !onGame)
        {
            if (anim)
            {
                anim.SetTrigger("loadingComplete");
            }
        }
    }
Esempio n. 15
0
    IEnumerator playerDeath()
    {
        deathOn = true;
        ShipController.Get().OnDeath();
        CameraController.Get().Deactivate();
        yield return(new WaitForSeconds(5));

        LoaderManager.Get().LoadScene("MainMenu");
        yield return(null);

        ShipController.Get().Revive();
        CameraController.Get().Activate();
        ChangeLevel();
        deathOn = false;
    }
    public void GoToThisScene()
    {
        switch (sceneName)
        {
        case "Level1":
            BGMMenu.Get().stopMenuMusic();
            LoaderManager.Get().LoadScene(sceneName);
            UILoadingScreen.Get().SetVisible(true);
            break;

        case "Level2":
            BGMMenu.Get().stopMenuMusic();
            LoaderManager.Get().LoadScene(sceneName);
            UILoadingScreen.Get().SetVisible(true);
            break;

        case "GameOver":
            SceneManager.LoadScene(sceneName);
            break;

        case "Menu":
            if (SceneManager.GetActiveScene().name == "GameOver")
            {
                BGMMenu.Get().playMenuMusic();
            }
            SceneManager.LoadScene(sceneName);
            break;

        case "Controls":
            SceneManager.LoadScene(sceneName);
            break;

        case "Credits":
            SceneManager.LoadScene(sceneName);
            break;

        default:
            if (isLevelRestartButton)
            {
                SceneManager.LoadScene(SaveLastLevel.Get().loadLevelName());
            }
            else
            {
                SceneManager.LoadScene(sceneName);
            }
            break;
        }
    }
Esempio n. 17
0
 private void Initialize()
 {
     loader = LoaderManager.Get();
     Tower.TowerDestroyed     += GameOver;
     LightStand.LightFinished += GameWon;
     if (DebugScreen.GetInstance())
     {
         DebugScreen.GetInstance().AddButton("ResetGameScene", ResetGame);
         DebugScreen.GetInstance().AddButton("Add Players Level", LevelUpPlayers);
     }
     aSource = GetComponent <AudioSource>();
     AudioManager.Get().AddMusic(aSource);
     mage   = GameObject.Find("Mage");
     archer = GameObject.Find("Archer");
     GiveOrbsToPlayers();
     isInitialized = true;
 }
Esempio n. 18
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "BoundWall")
        {
            GameManager.Get().ChangeLevel();
            transform.GetChild(0).transform.gameObject.SetActive(true);
            switch (scene)
            {
            case Scenes.LEVEL2:
                LoaderManager.Get().LoadScene("Level2");
                break;

            case Scenes.FINAL:
                LoaderManager.Get().LoadScene("FinalScreen");
                break;
            }
        }
    }
Esempio n. 19
0
    public void Update()
    {
        int loadingVal = (int)(LoaderManager.Get().loadingProgress * 100);

        loadingText.text = "Loading " + loadingVal;

        if (LoaderManager.Get().loadingProgress >= 1)
        {
            Destroy(this.gameObject);
        }

        if (!textChange)
        {
            StartCoroutine(RandomTexts());
        }

        nextLevel.text = "Next zone: " + levelCount;
    }
Esempio n. 20
0
    public void LevelFinish()
    {
        Scene currScene = SceneManager.GetActiveScene();

        switch (currScene.name)
        {
        case "Level1":
            LoaderManager.Get().LoadScene("Level2");
            break;

        case "Level2":
            LoaderManager.Get().LoadScene("Level3");
            break;

        case "Level3":
            LoaderManager.Get().LoadScene("FinalScreen");
            break;
        }
    }
Esempio n. 21
0
    private void Start()
    {
        switch (LoaderManager.Get().GetNextScene())
        {
        case "Level1":
            levelNameText.text = "Level 1";
            break;

        case "Level2":
            levelNameText.text = "Level 2";
            break;

        case "Level3":
            levelNameText.text = "Level 3";
            break;

        default:
            levelNameText.text = "";
            break;
        }
    }
Esempio n. 22
0
 public void GoToLevel()
 {
     if (savedStatus.isPlayerAlive)
     {
         savedStatus.level++;
         if (savedStatus.level > maxLevels)
         {
             SceneManager.LoadScene("Menu");
         }
         else
         {
             LoaderManager.Get().LoadScene("Level" + (savedStatus.level));
             UILoadingScreen.Get().SetVisible(true);
         }
     }
     else
     {
         LoaderManager.Get().LoadScene("Level" + savedStatus.level);
         UILoadingScreen.Get().SetVisible(true);
     }
 }
    public void ChangeScene()
    {
        if (hasLoadingScreen)
        {
            LoaderManager.Get().LoadScene(sceneToChange);
            UILoadingScreen.Get().SetVisible(true);

            if (GameManager.Get())
            {
                Destroy(GameManager.Get().gameObject);
            }
        }
        else
        {
            if (GameManager.Get())
            {
                Destroy(GameManager.Get().gameObject);
            }

            SceneManager.LoadScene(sceneToChange);
        }
    }
Esempio n. 24
0
    // Update is called once per frame
    void Update()
    {
        if (gameStarted)
        {
            if (totalTime > 0)
            {
                totalTime -= Time.deltaTime;
            }

            if (totalTime <= 0 || gameOver)
            {
                LoaderManager.Get().LoadScene("MainMenuScene");
            }
            if (win)
            {
                winTimer += Time.deltaTime;
                if (winTimer > 5)
                {
                    LoaderManager.Get().LoadScene("MainMenuScene");
                }
            }
        }
        if (Input.GetKeyDown(KeyCode.F1))
        {
            BossMode();
        }
        if (Input.GetKeyDown(KeyCode.F2))
        {
            WinGame();
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            SetPause();
        }
    }
Esempio n. 25
0
    public void ChangeScene()
    {
        if (sceneName == "")
        {
            sceneName = SceneManager.GetActiveScene().name;
        }

        Time.timeScale = 1;

        if (isALevel)
        {
            if (assignLevelNumber)
            {
                PlayerStatusSave.Get().level = levelNumber;
            }

            LoaderManager.Get().LoadScene(sceneName);
            UILoadingScreen.Get().SetVisible(true);
        }
        else
        {
            SceneManager.LoadScene(sceneName);
        }
    }
Esempio n. 26
0
 public void GoToGameOver()
 {
     LoaderManager.Get().LoadScene(3);
     savedLevelThatComesFrom = actualLevelData.level;
 }
Esempio n. 27
0
 public void GoToNextLevel()
 {
     LoaderManager.Get().LoadScene(actualLevelData.nextLevel);
     savedLevelThatComesFrom = actualLevelData.level;
 }
Esempio n. 28
0
 public void GoToMenu()
 {
     LoaderManager.Get().LoadScene(0);
     savedLevelThatComesFrom = actualLevelData.level;
 }
Esempio n. 29
0
 public void Update()
 {
     loadingVal      += (int)(LoaderManager.Get().loadingProgress * 100);
     loadingVal       = Mathf.Clamp(loadingVal, 0, 100);
     loadingText.text = "Loading " + loadingVal;
 }
Esempio n. 30
0
 public void ChangeLevel()
 {
     LoaderManager.Get().LoadNewLevel();
 }