putting debug logs everywhere

This commit is contained in:
Fangh 2024-01-29 23:32:30 +01:00
parent 7431de67ae
commit 61bdd410fe
5 changed files with 14 additions and 1552 deletions

File diff suppressed because it is too large Load Diff

View File

@ -7329,8 +7329,8 @@ MonoBehaviour:
m_fontMaterials: [] m_fontMaterials: []
m_fontColor32: m_fontColor32:
serializedVersion: 2 serializedVersion: 2
rgba: 4278254847 rgba: 4294967295
m_fontColor: {r: 1, g: 0.98659146, b: 0, a: 1} m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0 m_enableVertexGradient: 0
m_colorMode: 3 m_colorMode: 3
m_fontColorGradient: m_fontColorGradient:

View File

@ -354,6 +354,7 @@ private void OnNewGameState()
{ {
if (BeforeStart.activeInHierarchy) if (BeforeStart.activeInHierarchy)
{ {
Debug.Log("It's photo time !", this);
BeforeStart.SetActive(false); BeforeStart.SetActive(false);
TakePicture.SetActive(true); TakePicture.SetActive(true);
endOfViewDate = DateTime.Now.AddSeconds(60); endOfViewDate = DateTime.Now.AddSeconds(60);
@ -364,22 +365,24 @@ private void OnNewGameState()
{ {
if (TakePicture.activeInHierarchy || WaitingOtherPlayers.activeInHierarchy) if (TakePicture.activeInHierarchy || WaitingOtherPlayers.activeInHierarchy)
{ {
Debug.Log("It's voting time !", this);
WaitingOtherPlayers.SetActive(false); WaitingOtherPlayers.SetActive(false);
TakePicture.SetActive(false); TakePicture.SetActive(false);
VotePicture.SetActive(true); VotePicture.SetActive(true);
Debug.Log("It's voting time !", this);
myOnlineRoom.Child("currentQuestionId").ValueChanged += OnCurrentQuestionChanged; myOnlineRoom.Child("currentQuestionId").ValueChanged += OnCurrentQuestionChanged;
} }
break; break;
} }
case (int)GameState.Score: case (int)GameState.Score:
{ {
if (TakePicture.activeInHierarchy) if (VotePicture.activeInHierarchy || WaitingOtherPlayers.activeInHierarchy)
{ {
Debug.Log("it's scoring time !", this);
myOnlineRoom.Child("currentQuestionId").ValueChanged -= OnCurrentQuestionChanged;
VotePicture.SetActive(false); VotePicture.SetActive(false);
WaitingOtherPlayers.SetActive(false); WaitingOtherPlayers.SetActive(false);
EndGame.SetActive(true); EndGame.SetActive(true);
myOnlineRoom.Child("currentQuestionId").ValueChanged -= OnCurrentQuestionChanged;
} }
break; break;
} }

View File

@ -77,6 +77,7 @@ private void Update()
private void SendRoomState(GameState _newState) private void SendRoomState(GameState _newState)
{ {
Debug.Log($"sending to RTDB that we are now in the {_newState} state", this);
realtimeDB.Child("rooms").Child(myRoom.code).Child("currentState").SetValueAsync((int)_newState); realtimeDB.Child("rooms").Child(myRoom.code).Child("currentState").SetValueAsync((int)_newState);
} }
@ -288,7 +289,7 @@ private void OnNewGameStateStarted()
break; break;
case (int)GameState.Score: case (int)GameState.Score:
//something Debug.Log("It's score time !");
break; break;
default: default:

View File

@ -119,7 +119,7 @@ void ShowQuestion()
/// <param name="_questionRef"></param> /// <param name="_questionRef"></param>
private void OnQuestionChanged(object sender, ValueChangedEventArgs _questionRef) private void OnQuestionChanged(object sender, ValueChangedEventArgs _questionRef)
{ {
Debug.Log("a question value has changed, maybe someone has voted", this); //Debug.Log("a question value has changed, maybe someone has voted", this);
string JSON = _questionRef.Snapshot.GetRawJsonValue(); string JSON = _questionRef.Snapshot.GetRawJsonValue();
Question question = Newtonsoft.Json.JsonConvert.DeserializeObject<Question>(JSON); Question question = Newtonsoft.Json.JsonConvert.DeserializeObject<Question>(JSON);
@ -127,7 +127,7 @@ private void OnQuestionChanged(object sender, ValueChangedEventArgs _questionRef
if (question.index != currentQuestion.index) if (question.index != currentQuestion.index)
return; return;
Debug.Log($"someone has voted for {question.index}", this); //Debug.Log($"someone has voted for {question.index}", this);
currentQuestion.propositions = question.propositions; currentQuestion.propositions = question.propositions;
UpdateVoters(); UpdateVoters();