Exemplo n.º 1
0
    void SendLastTurnDataRPC(Vector2[] movements, int ballId)
    {
        if (movements == null)
        {
            return;
        }

        Player player = PlayerManager.Instance.GetPlayer(ActualTurn);

        if (player == null)
        {
        }

        RemotePlayer remotePlayer = player as RemotePlayer;

        if (remotePlayer == null)
        {
            remotePlayer = PlayerManager.Instance.GetPlayer(NotActualTurn) as RemotePlayer;
            if (remotePlayer == null)
            {
            }
        }

        remotePlayer.SetLastMovements(movements, ballId);

        if (movements.Length > 1)
        {
            StartCoroutine(MoveCoroutine(movements));
        }
        else if (movements.Length > 0)
        {
            Phase1Move(movements[0], ballId);
        }
    }