Exemplo n.º 1
0
    //Actualiza el número de vueltas que ha dado un jugador concreto, comrpueba si ha terminado la carrera
    //y actualiza el contador de vueltas en la UI
    public void ChangeCurrentLap(PlayerInfo player, int currentLap)
    {
        if (this.ID == player.ID)
        {
            currentLap      = Mathf.Clamp(currentLap, 0, polePositionManager.numLaps);
            this.CurrentLap = currentLap;
            polePositionManager.CheckPlayerFinished(this);
        }

        if (this.isLocalPlayer)
        {
            uiManager.UpdateLapProgress(this.CurrentLap);
        }
    }