Beispiel #1
0
    public override void BeginPhase()
    {
        base.BeginPhase();
        SpawnLevel();
        SpawnCharacterControllers();
        timer            = GameManager.instance.currentLevelInfo.waitToStart;
        currentPlayPhase = PlayPhases.waitToBegin;
        GamePhaseUIBehavior_Play castUI = (GamePhaseUIBehavior_Play)phaseUI;

        castUI.ShowPopUpWindow(GamePhaseUIBehavior_Play.PopUpWindow.PopUpTypes.Ready);
    }
Beispiel #2
0
    public override void FixedUpdatePhase()
    {
        base.FixedUpdatePhase();
        switch (currentPlayPhase)
        {
        case PlayPhases.waitToBegin:
        {
            timer -= Time.deltaTime;
            if (timer <= 0f)
            {
                timer            = GameManager.instance.currentLevelInfo.duration;
                currentPlayPhase = PlayPhases.inProgress;
                GamePhaseUIBehavior_Play castUI = (GamePhaseUIBehavior_Play)phaseUI;
                castUI.ShowPopUpWindow(GamePhaseUIBehavior_Play.PopUpWindow.PopUpTypes.Start);
                SetAnalogStickVisibility(true);
            }
        }
        break;

        case PlayPhases.inProgress:
        {
            timer -= Time.deltaTime;
            if (OnCharacterUpdate != null)
            {
                OnCharacterUpdate();
            }

            if (CheckWinState())
            {
                currentPlayPhase = PlayPhases.end;
                InputManager.instance.SetAnalogUIListener(false);
                GamePhaseUIBehavior_Play castUI = (GamePhaseUIBehavior_Play)phaseUI;
                castUI.ShowPopUpWindow(GamePhaseUIBehavior_Play.PopUpWindow.PopUpTypes.Finish);
                foreach (GameObject p in players)
                {
                    p.GetComponent <CharacterMovementController>().EndCharacterMovement();
                }
            }
        }
        break;

        case PlayPhases.end:
        {
        }
        break;
        }
    }