Answer the question
In order to leave comments, you need to log in
How to make the button Ready for the Lobby?
I need to make a ready button for the lobby
, that is, we create a room (I already have it, I use photon if anything) and players join there.
I want this lobby to have a ready button, and how to do it so that if all players press this button, then game starts?
And also how to implement the display of the number of players ready and in general how many of them are in the room?
Answer the question
In order to leave comments, you need to log in
Do something like this honestly xs is it right
When you click on the button, make additions to the variable for example 1 (when the button is pressed, it’s not ready for the example of subtraction)
Displays, I think you know how to do it
And so on until the number of ready players is number of players in the room or max number of players in the room example:
public void Gotov(byte Go)
{
Go++;
}
public void NeGotov(byte NoGo)
{
NoGo--;
}
public void Play()
{
if(Go == MaxPlayerRoom)
{
//код запуска игры
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question