public void PlayerVoted(Player player, Vote.Options option) { PlayerVoteStatusUI playerVoteStatus; if (playerStatusDictionary.TryGetValue(player, out playerVoteStatus)) { playerVoteStatus.SetVote(option); } }
public void ExecuteAction(Vote.Options option) { if (option == Vote.Options.Yes && yesAction != null) { yesAction(); } else if (option == Vote.Options.No && noAction != null) { noAction(); } }
public void SetVote(Vote.Options option) { if (option == Vote.Options.Yes) { yesImage.SetActive(true); waitingImage.SetActive(false); noImage.SetActive(false); } else if (option == Vote.Options.No) { yesImage.SetActive(false); waitingImage.SetActive(false); noImage.SetActive(true); } }
public void PlayerVoteFor(Player player, Vote.Options option) { currentVote.AddVote(player, option); RpcPlayerVoteFor(player.gameObject, (byte)option); if (currentVote.Ended) { var result = currentVote.GetResult(); if (result == Vote.Options.Yes) { RpcVotePassed(); } else if (result == Vote.Options.No) { RpcVoteFailed(); } TargetOnVoteResult(currentVote.Owner.connectionToClient, (byte)currentVote.GetResult()); currentVote = null; } }
public CommandPlayerVoteFor(Vote.Options option) { this.caller = Player.LocalPlayer; this.option = option; }
public CommandPlayerVoteFor(Player caller, Vote.Options option) { this.caller = caller; this.option = option; }
public void CmdPlayerVoteFor(GameObject caller, Vote.Options voteData) { Instance.ExecuteServerCommandWithoutUndo(new CommandPlayerVoteFor(caller.GetComponent <Player>(), voteData), true); }