Exemplo n.º 1
0
    public void Working()
    {
        bool time             = CheckTimeToAction(totalSecond);
        bool energy           = CheckEnergyToAction(totalEnergy);
        bool timeOnProjectDay = CheckTimeForProjectDay(totalSecond);

        if (!time)
        {
            notificationController.TimeNotEnoughForWork();
        }
        else if (!energy)
        {
            notificationController.EnergyNotEnoughForWork();
        }
        else if (!timeOnProjectDay)
        {
            notificationController.TimeNotEnoughForWorkOnProjectDay();
        }
        else
        {
            projectController.SecondToWork = totalSecond;

            switch (projectController.ProjectPhase)
            {
            case ProjectPhase.Design:
                if (projectController.HasDesigned)
                {
                    switchScene.DisplayWorkTypingGmae(true);
                }
                else
                {
                    switchScene.DisplayWorkProjectDesign(true);
                }

                break;

            case ProjectPhase.FirstPlayable:
                if (projectController.HasDesigned)
                {
                    switchScene.DisplayWorkTypingGmae(true);
                }
                break;

            case ProjectPhase.Prototype:
                if (projectController.HasDesigned)
                {
                    switchScene.DisplayWorkTypingGmae(true);
                }
                break;

            case ProjectPhase.VerticalSlice:
                if (projectController.HasDesigned)
                {
                    switchScene.DisplayWorkTypingGmae(true);
                }
                break;

            case ProjectPhase.AlphaTest:
                if (projectController.HasDesigned)
                {
                    switchScene.DisplayAlphaTypingGmae(true);
                }
                break;

            case ProjectPhase.BetaTest:
                if (projectController.HasDesigned)
                {
                    switchScene.DisplayBetaTypingGmae(true);
                }
                break;

            case ProjectPhase.Master:
                if (projectController.HasDesigned)
                {
                    int rnd = UnityEngine.Random.Range(0, 3);
                    if (rnd >= 2)
                    {
                        switchScene.DisplayWorkTypingGmae(true);
                    }
                    else if (rnd >= 1)
                    {
                        switchScene.DisplayAlphaTypingGmae(true);
                    }
                    else
                    {
                        switchScene.DisplayBetaTypingGmae(true);
                    }
                }
                break;
            }
        }
    }