(fix): explanation page is working

This commit is contained in:
Morgan - 6 Freedom 2024-01-28 00:06:23 +01:00
parent b37a06faab
commit 8c5e7767d0
4 changed files with 15 additions and 12 deletions

View File

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1 m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0} m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 705507994} m_Sun: {fileID: 705507994}
m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1} m_IndirectSpecularColor: {r: 0.18018535, g: 0.22559482, b: 0.30677685, a: 1}
m_UseRadianceAmbientProbe: 0 m_UseRadianceAmbientProbe: 0
--- !u!157 &3 --- !u!157 &3
LightmapSettings: LightmapSettings:
@ -1376,8 +1376,8 @@ MonoBehaviour:
- {fileID: 2137991537} - {fileID: 2137991537}
- {fileID: 340074661} - {fileID: 340074661}
promptList: {fileID: 0} promptList: {fileID: 0}
explanationPage: {fileID: 0} explanationPage: {fileID: 45150984}
counter: {fileID: 0} counter: {fileID: 1798182259}
waitingForPropositionsPage: {fileID: 1730465902} waitingForPropositionsPage: {fileID: 1730465902}
waitingForPropositionsLabels: waitingForPropositionsLabels:
- {fileID: 972471162} - {fileID: 972471162}

View File

@ -20,7 +20,7 @@ public Room(string _code)
players = new Dictionary<string, Player>(); players = new Dictionary<string, Player>();
questions = new Dictionary<string, Question>(); questions = new Dictionary<string, Question>();
currentQuestion = 0; currentQuestion = 0;
currentState = 0; currentState = 1; //default by PC
} }
public List<Player> GetPlayerList() public List<Player> GetPlayerList()

View File

@ -133,7 +133,7 @@ public void PlayerValidateNameAndServerRoom(string _name, string _code)
List<Player> list = new List<Player>(); List<Player> list = new List<Player>();
list.Add(currentPlayer); list.Add(currentPlayer);
UpdateDisplayedListUser(list) ; UpdateDisplayedListUser(list);
}); });
} }
}); });
@ -222,7 +222,7 @@ public void StartGame()
Debug.LogException(ex); Debug.LogException(ex);
} }
} }
/// <summary> /// <summary>
@ -303,7 +303,7 @@ private void UpdateDisplayedListUser(List<Player> players)
listPlayersUI.text += "\n" + players[i].name; listPlayersUI.text += "\n" + players[i].name;
} }
} }
private void CheckIfIAmTheFirst(List<Player> players) private void CheckIfIAmTheFirst(List<Player> players)
{ {
if (players.Count > 1) if (players.Count > 1)
@ -312,7 +312,7 @@ private void CheckIfIAmTheFirst(List<Player> players)
} }
else else
{ {
} }
} }
@ -334,8 +334,7 @@ public enum GameState
PropositionsSent = 4, PropositionsSent = 4,
MakeVote = 5, MakeVote = 5,
VoteSent = 6, VoteSent = 6,
Score = 7, Score = 7
Ending = 8
} }

View File

@ -57,6 +57,10 @@ private void Awake()
private void Start() private void Start()
{ {
explanationPage.SetActive(false);
waitingForPropositionsPage.SetActive(false);
waitingForPlayersPage.SetActive(true);
propositionCurrentTime = propositionTime; propositionCurrentTime = propositionTime;
votingCurrentTime = votingTime; votingCurrentTime = votingTime;
ResetAllPlayerLabels(); ResetAllPlayerLabels();
@ -70,7 +74,7 @@ private void Update()
if (myRoom.currentState == (int)GameState.Explanation && endOfExplanationDate != DateTime.MinValue) if (myRoom.currentState == (int)GameState.Explanation && endOfExplanationDate != DateTime.MinValue)
{ {
TimeSpan duration = endOfExplanationDate - DateTime.Now; TimeSpan duration = endOfExplanationDate - DateTime.Now;
counter.text = duration.TotalSeconds.ToString("D1"); counter.text = ((int)duration.TotalSeconds).ToString("D1");
if (duration.TotalMilliseconds <= 0) if (duration.TotalMilliseconds <= 0)
{ {
@ -335,7 +339,7 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs value)
case (int)GameState.Explanation: case (int)GameState.Explanation:
waitingForPlayersPage.SetActive(false); waitingForPlayersPage.SetActive(false);
explanationPage.SetActive(true); explanationPage.SetActive(true);
endOfExplanationDate = DateTime.Now.AddSeconds(30); endOfExplanationDate = DateTime.Now.AddSeconds(3);
break; break;
case (int)GameState.MakeProposition: case (int)GameState.MakeProposition:
HostStartGame(); HostStartGame();