Skip to content

Commit

Permalink
Merge pull request #130 from SeoulTechTCPGame/develop-Fix#127
Browse files Browse the repository at this point in the history
Develop fix#127
  • Loading branch information
seong0929 committed Oct 25, 2023
2 parents 9d67aed + c7c52de commit 8328d25
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Assets/Scenes/PlayScene/LocalPlay.unity
Original file line number Diff line number Diff line change
Expand Up @@ -1894,6 +1894,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0ec56fa80ca464d4fa1c41bf59b34f5f, type: 3}
m_Name:
m_EditorClassIdentifier:
Winner: 2
IsGameOver: 0
IsExpeled: 0
Turn: 0
--- !u!114 &1308903715
MonoBehaviour:
Expand Down Expand Up @@ -1932,6 +1935,7 @@ MonoBehaviour:
ReplayButton: {fileID: 249710004}
ReStartButton: {fileID: 1676435791}
ToHomeButton: {fileID: 1541049475}
ExpelButton: {fileID: 2111712690}
maxTime: 60
RequestedPawnCoord: {x: 0, y: 0}
--- !u!224 &1376844211 stripped
Expand Down
17 changes: 17 additions & 0 deletions Assets/Scenes/PlayScene/Script/MatchManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using static Enums;

/*
Expand Down Expand Up @@ -53,6 +54,12 @@ public class MatchManager : MonoBehaviour

private void Awake() // 이벤트 할당, PlayerButton의 사용자 할당, _gameLogic 받기
{
if(IsGameObjectsNull() == false)
{
Debug.LogError("MatchManager - Awake: One of the public GameObjects is null.");
SceneManager.LoadScene("Home");
return;
}
SetEvents();
_gameLogic = FindObjectOfType<GameLogic>();
}
Expand Down Expand Up @@ -171,6 +178,16 @@ private void InitAiMode() // 유저가 Player1인지 Player2인지 설정 필요
}
#endregion

private bool IsGameObjectsNull()
{
// Check if public GameObjects are null
if (Board == null || LowerButtons == null || UpperButtons == null || WinState == null || LowerTimer == null || UpperTimer == null || MyProfile == null || TheirProfile == null || MyEmotes == null || TheirEmotePanel == null || ReplayButton == null || ReStartButton == null || ToHomeButton == null || ExpelButton == null)
{
Debug.LogError("MatchManager - IsGameObjectsNull: One of the public GameObjects is null.");
return false;
}
return true;
}
private void OrientBoard() // 유저가 Player2인경우 보드판을 뒤집는다.
{
if(_user == EPlayer.Player2)
Expand Down

0 comments on commit 8328d25

Please sign in to comment.