예제 #1
0
    private IEnumerator LevelStartCountdown()
    {
        EndLevel();
        PlayerSpawner.UnlockSpawner();
        OpponentSpawner.UnlockSpawner();
        UIManagerService.GetInstance().ShowTilesContainer();
        SplashLabel.color = new Color(1f, 1f, 1f);
        TimerLabel.gameObject.SetActive(true);
        SplashLabel.gameObject.SetActive(true);
        SplashLabel.text = "Level Starting In...\n3";
        yield return(new WaitForSeconds(1));

        SplashLabel.text = "Level Starting In...\n2";
        yield return(new WaitForSeconds(1));

        SplashLabel.text = "Level Starting In...\n1";
        yield return(new WaitForSeconds(1));

        SplashLabel.text = "GO!";
        TileManagerService.GetInstance().InitTiles();
        TileManagerService.GetInstance().IsLocked     = false;
        GroundClaimsService.GetInstance().TrackClaims = true;
        OpponentScriptedSpawner.StartSpawning();
        StartCoroutine(UpdateTimer());
        yield return(new WaitForSeconds(1));

        SplashLabel.text = "";
    }
예제 #2
0
 void Awake()
 {
     //720, 1280
     //360, 640
     Screen.SetResolution(360, 640, false);
     Instance = this;
 }
예제 #3
0
    private IEnumerator UpdateTimer()
    {
        string timerMins    = Mathf.Floor(CurrentLevelTimeRemaining / 60).ToString("00");
        string timerSeconds = (CurrentLevelTimeRemaining % 60).ToString("00");

        TimerLabel.text = timerMins + ":" + timerSeconds;
        if (IsLevelOver())
        {
            OpponentScriptedSpawner.StopSpawning();
            Team Winner = GetWinningTeam();
            switch (Winner)
            {
            case Team.Left:
                SplashLabel.color = new Color(0, 0, 1f);
                SplashLabel.text  = "You Win!";
                CompletedChallenges.Add(LoadedChallenge);
                UIManagerService.GetInstance().MarkLevelAsComplete(LoadedChallenge);
                break;

            case Team.Right:
                SplashLabel.color = new Color(1f, 0, 0);
                SplashLabel.text  = "You Lose...";
                break;

            default:
                SplashLabel.color = new Color(0, 0, 0);
                SplashLabel.text  = "Draw";
                break;
            }
            EndLevel();
            yield return(new WaitForSeconds(3));

            TimerLabel.gameObject.SetActive(false);
            SplashLabel.gameObject.SetActive(false);
            TileManagerService.GetInstance().RemoveCurrentTiles();
            GroundClaimsService.GetInstance().ResetCoverage();
            UIManagerService.GetInstance().ShowChallengeMenu();
            LoadDemoMode();
        }
        else
        {
            yield return(new WaitForSeconds(1));

            CurrentLevelTimeRemaining--;
            StartCoroutine(UpdateTimer());
        }
    }