void RollRPC(int pawnID, int roll) { var pawn = Pawns.Get(pawnID); if (Pawns.IsLocal(pawn)) { Core.Dice.Interactable = false; } else { Core.Dice.Value = roll; } if (PhotonNetwork.IsMasterClient) { if (pawn != Pawns[PawnIndex]) { Debug.LogWarning("Pawn: " + pawn.name + " Threw dice when it wasn't their turn, ignoring"); return; } if (InTurn) { Debug.LogWarning("Pawn: " + pawn.name + " Threw dice mid-turn, ignoring"); return; } photonView.RPC(nameof(TurnStart), RpcTarget.All, pawn.ID, pawn.Progress, roll); } }
void TurnInitiation(int pawnID) { var pawn = Pawns.Get(pawnID); Core.Dice.Interactable = Pawns.IsLocal(pawn); if (OnTurnInitiation != null) { OnTurnInitiation(pawn); } }