Ejemplo n.º 1
0
    void Update()
    {
        if (inGameDBController.GetWinnerPID().Equals(-1))
        {
            timer += Time.deltaTime;
            if (timer >= timerRefreshRate)
            {
                timer = 0f;
                StartCoroutine(inGameDBController.FetchCurrentPlayerTurnCo());
                StartCoroutine(inGameDBController.FetchPlayerLocationsCo());
                StartCoroutine(inGameDBController.FetchWinnderPID());

                for (int i = 0; i < players.Count; i++)
                {
                    players[i].location = inGameDBController.GetPlayerLocation(i);
                    players[i].MoveModel(inGameDBController.GetPlayerLocation(i));
                }

                if (GetIsLocalPlayerTurn())
                {
                    if (!turnHasBegun)
                    {
                        BeginTurn();
                    }

                    if (GetIsLPOnBuildingEntrance())
                    {
                        StartCoroutine(taskController.UpdateBuildingTaskQuantityLabels(inGameDBController.GetTaskData()));
                    }
                }
            }
        }
        else
        {
            inGameDBController.FetchWinnerPlayerName();
            orientationController.SetWinnerLabel(inGameDBController.GetWinnerName());
            orientationController.ShowWinnerDisplayPanel();
        }
    }