Merge pull request #78 from Degulleo/DO-78-싱글-플레이일-때-항복-무승부-재대결-처리
DO-78 [Feat] 싱글플레이 무승부 항복 재대결 처리 수정
This commit is contained in:
commit
6238c826a4
@ -40,35 +40,59 @@ public class GameUIController : MonoBehaviour
|
||||
|
||||
public void OnClickSurrenderButton()
|
||||
{
|
||||
GameManager.Instance.panelManager.OpenConfirmPanel("항복 하시겠습니까?", () =>
|
||||
if (GameManager.Instance.CheckIsSinglePlay())
|
||||
{
|
||||
_multiplayManager.RequestSurrender();
|
||||
});
|
||||
GameManager.Instance.SurrenderSinglePlay();
|
||||
}
|
||||
else
|
||||
{
|
||||
GameManager.Instance.panelManager.OpenConfirmPanel("항복 하시겠습니까?", () =>
|
||||
{
|
||||
_multiplayManager.RequestSurrender();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void OnClickDrawRequestButton()
|
||||
{
|
||||
if (GameManager.Instance.GetRequestDrawChance())
|
||||
if (GameManager.Instance.CheckIsSinglePlay())
|
||||
{
|
||||
GameManager.Instance.panelManager.OpenConfirmPanel("무승부 신청을 하시겠습니까?", () =>
|
||||
{
|
||||
_multiplayManager.RequestDraw();
|
||||
});
|
||||
GameManager.Instance.SetRequestDrawChanceFalse();
|
||||
GameManager.Instance.DrawSinglePlay();
|
||||
}
|
||||
else
|
||||
{
|
||||
GameManager.Instance.panelManager.OpenConfirmPanel("무승부 요청이 제한돼있습니다.",()=>{});
|
||||
if (GameManager.Instance.GetRequestDrawChance())
|
||||
{
|
||||
GameManager.Instance.panelManager.OpenConfirmPanel("무승부 신청을 하시겠습니까?", () =>
|
||||
{
|
||||
_multiplayManager.RequestDraw();
|
||||
});
|
||||
GameManager.Instance.SetRequestDrawChanceFalse();
|
||||
}
|
||||
else
|
||||
{
|
||||
GameManager.Instance.panelManager.OpenConfirmPanel("무승부 요청이 제한돼있습니다.",()=>{});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnClickRevengeRequestButton()
|
||||
{
|
||||
if (GameManager.Instance.CheckIsSinglePlay())
|
||||
{
|
||||
GameManager.Instance.panelManager.OpenConfirmPanel("상대방이 방을 나갔습니다.",() =>
|
||||
{
|
||||
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
GameManager.Instance.panelManager.OpenConfirmPanel("재대결 신청을\n하시겠습니까?", () =>
|
||||
{
|
||||
GameManager.Instance.panelManager.OpenLoadingPanel(true, true, false, false);
|
||||
_multiplayManager.RequestRevengeRequest();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void OnClickSettingsButton()
|
||||
|
@ -784,7 +784,7 @@ GameObject:
|
||||
- component: {fileID: 4247753812167816150}
|
||||
- component: {fileID: 1548693011522092544}
|
||||
m_Layer: 5
|
||||
m_Name: Retry Button
|
||||
m_Name: Draw Button
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
@ -476,6 +476,7 @@ public partial class GameLogic : IDisposable
|
||||
// 기존 멀티플레이 상태 초기화
|
||||
MultiPlayManager = null;
|
||||
_roomId = null;
|
||||
GameType = Enums.GameType.SinglePlay;
|
||||
|
||||
// 싱글 플레이 상태로 변경
|
||||
InitializeSinglePlayMode();
|
||||
|
@ -131,4 +131,25 @@ public class GameManager : Singleton<GameManager>
|
||||
if (_gameLogic == null) return;
|
||||
_gameLogic.RequestDrawChance = false;
|
||||
}
|
||||
|
||||
public bool CheckIsSinglePlay()
|
||||
{
|
||||
if (_gameLogic == null) return false;
|
||||
return _gameLogic.GameType == Enums.GameType.SinglePlay;
|
||||
}
|
||||
|
||||
public void SurrenderSinglePlay()
|
||||
{
|
||||
if(_gameLogic == null) return;
|
||||
panelManager.OpenEffectPanel(Enums.GameResult.Lose);
|
||||
_gameLogic.EndGame(Enums.GameResult.Lose);
|
||||
}
|
||||
|
||||
public void DrawSinglePlay()
|
||||
{
|
||||
if(_gameLogic == null) return;
|
||||
panelManager.OpenEffectPanel(Enums.GameResult.Draw);
|
||||
_gameLogic.EndGame(Enums.GameResult.Draw);
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user