Class VoteText
- Namespace
- Unity.Multiplayer.Core
The words a vote overlay shows, engine-free: the tally line, where the local player stands, why a start was refused and how a vote ended. The one home of that wording, so a game's own UI can say the same thing.
public static class VoteText
- Inheritance
-
VoteText
- Inherited Members
Methods
CanVote(VoteChoice)
True while the local player may still press Yes or No: once they have voted the buttons are done.
public static bool CanVote(VoteChoice choice)
Parameters
choiceVoteChoice
Returns
Ended(string, VoteEnding)
A toast for a vote titled title that ended ending.
public static string Ended(string title, VoteEnding ending)
Parameters
titlestringendingVoteEnding
Returns
Ended(VoteResult)
A toast for how a vote ended: "Vote passed: Kick Bob", "Vote failed: Reset the level".
public static string Ended(VoteResult result)
Parameters
resultVoteResult
Returns
Refused(VoteRefusal, int)
The sentence a refused starter is told, when the kind gave no reason of its own.
public static string Refused(VoteRefusal refusal, int cooldownSecondsLeft = 0)
Parameters
refusalVoteRefusalcooldownSecondsLeftint
Returns
Standing(VoteChoice)
How the local player stands: "Your vote", "You voted Yes", "You voted No", or why they can't vote.
public static string Standing(VoteChoice choice)
Parameters
choiceVoteChoice
Returns
Tally(VoteStatus)
"Yes 1 · No 0 · needs 2 of 3 · 12 s".
public static string Tally(VoteStatus status)
Parameters
statusVoteStatus