DO-78 [Feat] 싱글플레이 무승부 항복 재대결 처리 수정
This commit is contained in:
parent
a06f9809de
commit
d0eaf16c3a
@ -40,35 +40,59 @@ public class GameUIController : MonoBehaviour
|
|||||||
|
|
||||||
public void OnClickSurrenderButton()
|
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()
|
public void OnClickDrawRequestButton()
|
||||||
{
|
{
|
||||||
if (GameManager.Instance.GetRequestDrawChance())
|
if (GameManager.Instance.CheckIsSinglePlay())
|
||||||
{
|
{
|
||||||
GameManager.Instance.panelManager.OpenConfirmPanel("무승부 신청을 하시겠습니까?", () =>
|
GameManager.Instance.DrawSinglePlay();
|
||||||
{
|
|
||||||
_multiplayManager.RequestDraw();
|
|
||||||
});
|
|
||||||
GameManager.Instance.SetRequestDrawChanceFalse();
|
|
||||||
}
|
}
|
||||||
else
|
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()
|
public void OnClickRevengeRequestButton()
|
||||||
{
|
{
|
||||||
|
if (GameManager.Instance.CheckIsSinglePlay())
|
||||||
|
{
|
||||||
|
GameManager.Instance.panelManager.OpenConfirmPanel("상대방이 방을 나갔습니다.",() =>
|
||||||
|
{
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
GameManager.Instance.panelManager.OpenConfirmPanel("재대결 신청을\n하시겠습니까?", () =>
|
GameManager.Instance.panelManager.OpenConfirmPanel("재대결 신청을\n하시겠습니까?", () =>
|
||||||
{
|
{
|
||||||
GameManager.Instance.panelManager.OpenLoadingPanel(true, true, false, false);
|
GameManager.Instance.panelManager.OpenLoadingPanel(true, true, false, false);
|
||||||
_multiplayManager.RequestRevengeRequest();
|
_multiplayManager.RequestRevengeRequest();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnClickSettingsButton()
|
public void OnClickSettingsButton()
|
||||||
|
@ -784,7 +784,7 @@ GameObject:
|
|||||||
- component: {fileID: 4247753812167816150}
|
- component: {fileID: 4247753812167816150}
|
||||||
- component: {fileID: 1548693011522092544}
|
- component: {fileID: 1548693011522092544}
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: Retry Button
|
m_Name: Draw Button
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
|
@ -473,6 +473,7 @@ public partial class GameLogic : IDisposable
|
|||||||
// 기존 멀티플레이 상태 초기화
|
// 기존 멀티플레이 상태 초기화
|
||||||
MultiPlayManager = null;
|
MultiPlayManager = null;
|
||||||
_roomId = null;
|
_roomId = null;
|
||||||
|
GameType = Enums.GameType.SinglePlay;
|
||||||
|
|
||||||
// 싱글 플레이 상태로 변경
|
// 싱글 플레이 상태로 변경
|
||||||
InitializeSinglePlayMode();
|
InitializeSinglePlayMode();
|
||||||
|
@ -131,4 +131,25 @@ public class GameManager : Singleton<GameManager>
|
|||||||
if (_gameLogic == null) return;
|
if (_gameLogic == null) return;
|
||||||
_gameLogic.RequestDrawChance = false;
|
_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