Ejemplo n.º 1
0
    IEnumerator StartLoading()
    {
        if (_loadingScreenObject == null)
        {
            yield break;
        }

        int i = 0;

        if (!_loadingScreenObject.gameObject.activeSelf)
        {
            _loadingScreenObject.gameObject.SetActive(true);
        }

        _loadingBarImage.fillAmount = 0.0f;

        yield return(_loadingScreenTime1);

        _loadingBarImage.fillAmount += .7f;

        yield return(_loadingScreenTime2);

        _loadingBarImage.fillAmount += .3f;

        yield return(_loadingScreenTime3);

        if (_loadingScreenObject.gameObject.activeSelf)
        {
            _loadingScreenObject.gameObject.SetActive(false);
        }

        SpawnManager    playerSpawnMgr  = RedSpawnMgr;
        EnemyController enemyController = BlueSpawnMgr.GetComponent <EnemyController>();

        playerSpawnMgr.Enable();
        enemyController.Enable();
        _costMgr.Enable(playerSpawnMgr);
        _levelMgr.Enable();
    }