Exemple #1
0
 void Start()
 {
     dfState      = DFStates.BEFORE_GAME;
     playersInfos = PlayersManager.instance.playersList;
     dragonsActions.Enable();
     AssignControllerToPlayer();
 }
Exemple #2
0
    void Update()
    {
        switch (dfState)
        {
        case DFStates.BEFORE_GAME:
            if (!playersInitialized)
            {
                InitializePlayers();
            }
            switch (countDown.GetComponent <Countdown>().cdState)
            {
            case Countdown.COUNTDOWN_STATES.BEFORE_CD:
                countDown.GetComponent <Countdown>().cdState = Countdown.COUNTDOWN_STATES.IN_CD;
                break;

            case Countdown.COUNTDOWN_STATES.AFTER_CD:
                StartMusic();
                dfState = DFStates.IN_GAME;
                ToggleFishableZone(true);
                break;
            }
            break;

        case DFStates.IN_GAME:
            timeLeft -= Time.deltaTime;
            UpdateTimerDisplay();
            if (timeLeft < 0)
            {
                timeLeft = 0;
                dfState  = DFStates.AFTER_GAME;
                EndGame();
            }
            break;

        case DFStates.AFTER_GAME:
            if (vthasPlayed == false)
            {
                SoundManager.instance.PlaySound("Victory_Complete");
                vthasPlayed = true;
            }
            break;
        }
    }