using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI; /// /// This is the game state manager on the phone side /// public class GameManager : MonoBehaviour { private GameState currentState; private List players = new List(); public float explanationTime = 4f; private float currentExplanationTime = 0; public InputField roomCodeField; public TextMeshProUGUI roomError; public InputField playerNameField; public TextMeshProUGUI nameError; private void Start() { currentExplanationTime = explanationTime; } public GameState GetCurrentState() { return currentState; } /// /// Send your name and game room to the server /// public void PlayerValidateNameAndServerRoom() { //check if the room exists, if not display an error message //if succeed, then the player to the server //if succeed, change the state and change page currentState = GameState.WaitingForOtherPlayersToJoin; } /// /// Call this only by the first player /// public void StartGame() { } /// /// Dislay on the screen the current prompt ask to you and another player /// Also show all the camera stuff /// /// The prompt to display public void MakeAProposition(Prompt _prompt) { } /// /// Create a proposition from the picture taken and send it to server. /// Then go to next proposition (if any) or the page "WaitingForOtherPlayers" /// public void SubmitProposition() { Proposition temp = new Proposition(); } /// /// Display the voting page /// public void StartToVote() { } /// /// Choose one result and send it to the server /// Then go to the next vote (if any) or to the page "WaitingForOtherPlayers" /// public void Vote() { } /// /// Display the UI of the end screen /// public void DisplayEndScreen() { } /// /// Automatically called when something change in your room /// private void OnRoomUpdate() { } } public enum GameState { EnteringName, WaitingForOtherPlayersToJoin, Explanation, MakeProposition, PropositionsSent, WaitingForOtherPlayers, VotingTime, Ending }