2025-08-30 03:09:13 +00:00
|
|
|
|
using BansheeGz.BGDatabase;
|
2025-08-27 21:08:17 +00:00
|
|
|
|
using CodeJay.Enum;
|
|
|
|
|
|
using DG.Tweening;
|
2025-08-30 03:09:13 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using TMPro;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using UnityEngine.UI;
|
2025-08-27 21:08:17 +00:00
|
|
|
|
|
|
|
|
|
|
public class ResultPopup : PopupBase
|
|
|
|
|
|
{
|
2025-08-30 03:09:13 +00:00
|
|
|
|
public GameObject[] gos_bankrupt; // 0 상대 파산, 1 내가 파산
|
|
|
|
|
|
public GameObject[] gos_result; // 0 승리, 1 패배
|
|
|
|
|
|
public TextMeshProUGUI t_Cal;
|
|
|
|
|
|
[SerializeField] private TextMeshProUGUI GoldTMP;
|
|
|
|
|
|
public TextMeshProUGUI t_enemygold, t_mygold;
|
|
|
|
|
|
|
|
|
|
|
|
[SerializeField] private TextMeshProUGUI ButtonlabelTMP;
|
|
|
|
|
|
[SerializeField] private TextMeshProUGUI DetailTMP;
|
2025-08-27 21:08:17 +00:00
|
|
|
|
[SerializeField] private GameObject DetailButtonGO;
|
|
|
|
|
|
|
|
|
|
|
|
[SerializeField] private GameObject[] NormalGameObjects;
|
|
|
|
|
|
[SerializeField] private GameObject[] ClearChallengeObjects;
|
|
|
|
|
|
[SerializeField] private GameObject GetHeartPanel;
|
|
|
|
|
|
[SerializeField] private GameObject ForcedMoveButtonGO;
|
|
|
|
|
|
|
2025-08-30 03:09:13 +00:00
|
|
|
|
[SerializeField] private TextMeshProUGUI NextGameButtonTMP;
|
2025-08-27 21:08:17 +00:00
|
|
|
|
|
|
|
|
|
|
private CanvasGroup canvasGroup;
|
|
|
|
|
|
|
|
|
|
|
|
private bool _appliedButtonEffect = false;
|
|
|
|
|
|
private bool _gameResult = false;
|
|
|
|
|
|
private long _resultTotalGold = 0;
|
|
|
|
|
|
private bool _isDetail = false;
|
2025-08-30 03:09:13 +00:00
|
|
|
|
List<ResultxInfoData> list_xinfo = new List<ResultxInfoData>
|
|
|
|
|
|
{
|
|
|
|
|
|
new ResultxInfoData{ type = EScoreMutiplyType.Gobak, name = "고박" },
|
|
|
|
|
|
new ResultxInfoData{ type = EScoreMutiplyType.Meongbak, name = "멍박" },
|
|
|
|
|
|
new ResultxInfoData{ type = EScoreMutiplyType.Peebak, name = "피박" },
|
|
|
|
|
|
new ResultxInfoData{ type = EScoreMutiplyType.Gwhangbak, name = "광박" },
|
|
|
|
|
|
new ResultxInfoData{ type = EScoreMutiplyType.Shake, name = "흔듦" },
|
|
|
|
|
|
new ResultxInfoData{ type = EScoreMutiplyType.Nagari, name = "나가리" },
|
|
|
|
|
|
new ResultxInfoData{ type = EScoreMutiplyType.ClickedFromResultPopup, name = "기타" },
|
|
|
|
|
|
};
|
2025-08-27 21:08:17 +00:00
|
|
|
|
|
|
|
|
|
|
protected override void Awake()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.Awake();
|
|
|
|
|
|
canvasGroup = this.GetComponent<CanvasGroup>();
|
|
|
|
|
|
|
|
|
|
|
|
if (GameManager.Instance != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Event.RegistEvent(EEventType.MoveToStore_Heart_DuringGame, this.MoveToStore_Heart_DuringGameCallback);
|
|
|
|
|
|
GameManager.Event.RegistEvent(EEventType.OnReturnToGameFromStore, this.OnReturnToGameFromStoreCallback);
|
|
|
|
|
|
|
|
|
|
|
|
GameManager.ADS.OnCompletedInterstitialAd += OnCompletedInterstitialAd;
|
|
|
|
|
|
GameManager.ADS.OnCompletedRewardedAd += OnCompletedRewardedAd;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnDestroy()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GameManager.Instance != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Event.RemoveEvent(EEventType.MoveToStore_Heart_DuringGame, this.MoveToStore_Heart_DuringGameCallback);
|
|
|
|
|
|
GameManager.Event.RemoveEvent(EEventType.OnReturnToGameFromStore, this.OnReturnToGameFromStoreCallback);
|
|
|
|
|
|
|
|
|
|
|
|
GameManager.ADS.OnCompletedInterstitialAd -= OnCompletedInterstitialAd;
|
|
|
|
|
|
GameManager.ADS.OnCompletedRewardedAd -= OnCompletedRewardedAd;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void MoveToStore_Heart_DuringGameCallback()
|
|
|
|
|
|
{
|
|
|
|
|
|
canvasGroup.alpha = 0;
|
|
|
|
|
|
canvasGroup.blocksRaycasts = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnReturnToGameFromStoreCallback()
|
|
|
|
|
|
{
|
|
|
|
|
|
canvasGroup.alpha = 1;
|
|
|
|
|
|
canvasGroup.blocksRaycasts = true;
|
|
|
|
|
|
canvasGroup.blocksRaycasts = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetData(bool gameResult, int fixedScore = 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
_gameResult = gameResult;
|
2025-08-30 03:09:13 +00:00
|
|
|
|
DSUtil.InActivateGameObjects(gos_bankrupt);
|
2025-08-27 21:08:17 +00:00
|
|
|
|
GoldTMP.enabled = true;
|
|
|
|
|
|
DetailTMP.enabled = false;
|
|
|
|
|
|
DetailButtonGO.SetActive(true);
|
|
|
|
|
|
|
|
|
|
|
|
DetailTMP.text = GamePanel.Instance.GetDetailString(_gameResult);
|
|
|
|
|
|
|
|
|
|
|
|
if (GamePanel.Instance.IsChallengeMode)
|
|
|
|
|
|
{
|
|
|
|
|
|
NextGameButtonTMP.text = "데이트 하기";
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
NextGameButtonTMP.text = "다음 레벨 도전";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (gameResult)
|
|
|
|
|
|
{
|
|
|
|
|
|
ButtonlabelTMP.text = "다음판 <size=40><color=yellow>2배</color></size>";
|
|
|
|
|
|
|
|
|
|
|
|
if (fixedScore <= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
int score = GamePanel.Instance.GetTotalScore(true, false);
|
|
|
|
|
|
int goNumer = GamePanel.Instance.Player_Go;
|
|
|
|
|
|
string str = $"{score}점";
|
|
|
|
|
|
int multiply = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (goNumer == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
str += " + 1고(1점) ";
|
|
|
|
|
|
score += 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (goNumer == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
str += " + 2고(2점) ";
|
|
|
|
|
|
score += 2;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (goNumer >= 3)
|
|
|
|
|
|
{
|
|
|
|
|
|
multiply += goNumer - 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var multipleType = GamePanel.Instance.GetAndUpdateScoreMultiplyType(gameResult);
|
|
|
|
|
|
|
|
|
|
|
|
if (multipleType != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
for (int i = 0; i < multipleType.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (multiply <= 0)
|
|
|
|
|
|
multiply = 1;
|
|
|
|
|
|
|
|
|
|
|
|
if (multipleType[i] == EScoreMutiplyType.Shake)
|
|
|
|
|
|
multiply *= CodeJay.CodeJayUtility.Utility.GetScoreMultiplyValue(multipleType[i]) * GamePanel.Instance.Player_Bell;
|
|
|
|
|
|
else
|
|
|
|
|
|
multiply *= CodeJay.CodeJayUtility.Utility.GetScoreMultiplyValue(multipleType[i]);
|
2025-08-30 03:09:13 +00:00
|
|
|
|
|
|
|
|
|
|
list_xinfo.Find(f=>f.type == multipleType[i]).mul = multiply;
|
2025-08-27 21:08:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (multiply > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (goNumer >= 3)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (multiply > goNumer - 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
int withoutGoMultiply = multiply / (goNumer - 1);
|
2025-08-30 03:09:13 +00:00
|
|
|
|
t_Cal.text = str + $" x {withoutGoMultiply}배\n= 총 {score * multiply}점\n";
|
2025-08-27 21:08:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2025-08-30 03:09:13 +00:00
|
|
|
|
t_Cal.text = str + $" x {goNumer}고(x{goNumer - 1})\n= 총 {score * multiply}점\n";
|
2025-08-27 21:08:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2025-08-30 03:09:13 +00:00
|
|
|
|
t_Cal.text = str + $" x {multiply}배\n= 총 {score * multiply}점\n";
|
2025-08-27 21:08:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_resultTotalGold = score * multiply * GamePanel.Instance.Stake;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2025-08-30 03:09:13 +00:00
|
|
|
|
t_Cal.text = str + $" =\n총 {score}점\n";
|
2025-08-27 21:08:17 +00:00
|
|
|
|
_resultTotalGold = score * GamePanel.Instance.Stake;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
_resultTotalGold = GamePanel.Instance.Stake * fixedScore;
|
2025-08-30 03:09:13 +00:00
|
|
|
|
t_Cal.text = $"{fixedScore}점 =\n총 {fixedScore}점\n";
|
2025-08-27 21:08:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-30 03:09:13 +00:00
|
|
|
|
t_Cal.text += $"x {GamePanel.Instance.Stake}냥";
|
|
|
|
|
|
|
2025-08-27 21:08:17 +00:00
|
|
|
|
if (GamePanel.Instance.IsChallengeMode)
|
|
|
|
|
|
{
|
2025-08-29 13:01:17 +00:00
|
|
|
|
long reamainingAIMoney = GameManager.DB.GetReaminingTargetCondition(true);
|
2025-08-27 21:08:17 +00:00
|
|
|
|
|
2025-08-29 13:01:17 +00:00
|
|
|
|
if (GameManager.DB.AddCurrentChallengeCondition(_resultTotalGold, true))
|
2025-08-27 21:08:17 +00:00
|
|
|
|
{
|
|
|
|
|
|
_resultTotalGold = reamainingAIMoney;
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Win_2);
|
2025-08-30 03:09:13 +00:00
|
|
|
|
DSUtil.InActivateGameObjects(gos_bankrupt, 0);
|
|
|
|
|
|
gos_bankrupt[0].GetComponent<RectTransform>().DOScale(1f, 1f).From(3f).SetEase(Ease.InExpo);
|
|
|
|
|
|
gos_bankrupt[0].GetComponent<Image>().DOFade(1f, 1f).From(0f).SetEase(Ease.InExpo);
|
2025-08-27 21:08:17 +00:00
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < NormalGameObjects.Length; i++)
|
|
|
|
|
|
NormalGameObjects[i].SetActive(false);
|
|
|
|
|
|
for (int i = 0; i < ClearChallengeObjects.Length; i++)
|
|
|
|
|
|
ClearChallengeObjects[i].SetActive(true);
|
|
|
|
|
|
|
|
|
|
|
|
GetHeartPanel.SetActive(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Win);
|
2025-08-30 03:09:13 +00:00
|
|
|
|
DSUtil.InActivateGameObjects(gos_result, 0);
|
2025-08-27 21:08:17 +00:00
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < NormalGameObjects.Length; i++)
|
|
|
|
|
|
NormalGameObjects[i].SetActive(true);
|
|
|
|
|
|
for (int i = 0; i < ClearChallengeObjects.Length; i++)
|
|
|
|
|
|
ClearChallengeObjects[i].SetActive(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ForcedMoveButtonGO.SetActive(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
long reamainingAIMoney = GameManager.DB.GetRemainigNormalGameAIGold();
|
|
|
|
|
|
|
|
|
|
|
|
if (GameManager.DB.AddNormalGameProgress(_resultTotalGold))
|
|
|
|
|
|
{
|
|
|
|
|
|
_resultTotalGold = reamainingAIMoney;
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Win_2);
|
2025-08-30 03:09:13 +00:00
|
|
|
|
DSUtil.InActivateGameObjects(gos_bankrupt, 0);
|
|
|
|
|
|
gos_bankrupt[0].GetComponent<RectTransform>().DOScale(1f, 1f).From(3f).SetEase(Ease.InExpo);
|
|
|
|
|
|
gos_bankrupt[0].GetComponent<Image>().DOFade(1f, 1f).From(0f).SetEase(Ease.InExpo);
|
2025-08-27 21:08:17 +00:00
|
|
|
|
GetHeartPanel.SetActive(true);
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < NormalGameObjects.Length; i++)
|
|
|
|
|
|
NormalGameObjects[i].SetActive(false);
|
|
|
|
|
|
for (int i = 0; i < ClearChallengeObjects.Length; i++)
|
|
|
|
|
|
ClearChallengeObjects[i].SetActive(true);
|
|
|
|
|
|
|
|
|
|
|
|
GameManager.DB.AddHeart(1, this.name);
|
|
|
|
|
|
|
|
|
|
|
|
ForcedMoveButtonGO.SetActive(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Win);
|
2025-08-30 03:09:13 +00:00
|
|
|
|
DSUtil.InActivateGameObjects(gos_result, 0);
|
2025-08-27 21:08:17 +00:00
|
|
|
|
GetHeartPanel.SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < NormalGameObjects.Length; i++)
|
|
|
|
|
|
NormalGameObjects[i].SetActive(true);
|
|
|
|
|
|
for (int i = 0; i < ClearChallengeObjects.Length; i++)
|
|
|
|
|
|
ClearChallengeObjects[i].SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
ForcedMoveButtonGO.SetActive(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GoldTMP.text = "+" + CodeJay.CodeJayUtility.Converter.MoneyToString(_resultTotalGold);
|
|
|
|
|
|
GameManager.DB.AddGold(_resultTotalGold, this.name);
|
|
|
|
|
|
|
|
|
|
|
|
//ForcedMoveButtonGO.SetActive(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
// <20>й<EFBFBD>
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GetHeartPanel.SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Lose);
|
2025-08-30 03:09:13 +00:00
|
|
|
|
DSUtil.InActivateGameObjects(gos_result, 1);
|
2025-08-27 21:08:17 +00:00
|
|
|
|
ButtonlabelTMP.text = "이번판 무효";
|
|
|
|
|
|
/* <size=40><color=yellow><3E><>ȿ</color></size>*/
|
|
|
|
|
|
|
|
|
|
|
|
if (fixedScore <= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
int score = GamePanel.Instance.GetTotalScore(false, false);
|
|
|
|
|
|
int goNumer = GamePanel.Instance.AI_Go;
|
|
|
|
|
|
int multiply = 0;
|
|
|
|
|
|
string str = $"{score}점";
|
|
|
|
|
|
|
|
|
|
|
|
if (goNumer == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
str += " + 1고(1점) ";
|
|
|
|
|
|
score += 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (goNumer == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
str += " + 2고(2점) ";
|
|
|
|
|
|
score += 2;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (goNumer >= 3)
|
|
|
|
|
|
{
|
|
|
|
|
|
multiply += goNumer - 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var multipleType = GamePanel.Instance.GetAndUpdateScoreMultiplyType(gameResult);
|
|
|
|
|
|
|
|
|
|
|
|
if (multipleType != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
for (int i = 0; i < multipleType.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (multiply <= 0)
|
|
|
|
|
|
multiply = 1;
|
|
|
|
|
|
|
|
|
|
|
|
if (multipleType[i] == EScoreMutiplyType.Shake)
|
|
|
|
|
|
multiply *= CodeJay.CodeJayUtility.Utility.GetScoreMultiplyValue(multipleType[i]) * GamePanel.Instance.AI_Bell;
|
|
|
|
|
|
else
|
|
|
|
|
|
multiply *= CodeJay.CodeJayUtility.Utility.GetScoreMultiplyValue(multipleType[i]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (multiply > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (goNumer >= 3)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (multiply > goNumer - 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
int withoutGoMultiply = multiply / (goNumer - 1);
|
2025-08-30 03:09:13 +00:00
|
|
|
|
t_Cal.text = str + $" x {withoutGoMultiply}배 =\n총 {score * multiply}점";
|
2025-08-27 21:08:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2025-08-30 03:09:13 +00:00
|
|
|
|
t_Cal.text = str + $" x {goNumer}고(x{goNumer - 1}) =\n총 {score * multiply}점";
|
2025-08-27 21:08:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
2025-08-30 03:09:13 +00:00
|
|
|
|
t_Cal.text = str + $" x {multiply}배 =\n총 {score * multiply}점";
|
2025-08-27 21:08:17 +00:00
|
|
|
|
_resultTotalGold = score * multiply * GamePanel.Instance.Stake;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2025-08-30 03:09:13 +00:00
|
|
|
|
t_Cal.text = str + $" =\n총 {score}점";
|
2025-08-27 21:08:17 +00:00
|
|
|
|
_resultTotalGold = score * GamePanel.Instance.Stake;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
_resultTotalGold = GamePanel.Instance.Stake * fixedScore;
|
2025-08-30 03:09:13 +00:00
|
|
|
|
t_Cal.text = $"{fixedScore}점 =\n총 {fixedScore}점";
|
2025-08-27 21:08:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GoldTMP.text = "-" + CodeJay.CodeJayUtility.Converter.MoneyToString(_resultTotalGold);
|
|
|
|
|
|
GameManager.DB.SubGold(_resultTotalGold, this.name);
|
|
|
|
|
|
GameManager.DB.AddGoldToAI(GamePanel.Instance.IsChallengeMode, _resultTotalGold);
|
|
|
|
|
|
|
|
|
|
|
|
if (GameManager.DB.Gold <= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Sound.ReserveSFX(ESFXType.Stamp, 0.6f);
|
2025-08-30 03:09:13 +00:00
|
|
|
|
DSUtil.InActivateGameObjects(gos_bankrupt, 1);
|
|
|
|
|
|
gos_bankrupt[1].GetComponent<RectTransform>().DOScale(1f, 1f).From(3f).SetEase(Ease.InExpo);
|
|
|
|
|
|
gos_bankrupt[1].GetComponent<Image>().DOFade(1f, 1f).From(0f).SetEase(Ease.InExpo);
|
2025-08-27 21:08:17 +00:00
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < NormalGameObjects.Length; i++)
|
|
|
|
|
|
NormalGameObjects[i].SetActive(false);
|
|
|
|
|
|
for (int i = 0; i < ClearChallengeObjects.Length; i++)
|
|
|
|
|
|
ClearChallengeObjects[i].SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
ForcedMoveButtonGO.SetActive(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
ForcedMoveButtonGO.SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < NormalGameObjects.Length; i++)
|
|
|
|
|
|
NormalGameObjects[i].SetActive(true);
|
|
|
|
|
|
for (int i = 0; i < ClearChallengeObjects.Length; i++)
|
|
|
|
|
|
ClearChallengeObjects[i].SetActive(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-30 03:09:13 +00:00
|
|
|
|
t_enemygold.text = CodeJay.CodeJayUtility.Converter.MoneyToString(GameManager.DB.GetRemainigNormalGameAIGold());
|
|
|
|
|
|
t_mygold.text = CodeJay.CodeJayUtility.Converter.MoneyToString(GameManager.DB.Gold);
|
|
|
|
|
|
|
2025-08-27 21:08:17 +00:00
|
|
|
|
GameManager.Event.InvokeEvent(EEventType.OnSynchronizeGold);
|
|
|
|
|
|
GameManager.Event.InvokeEvent(EEventType.OnGameEnd);
|
|
|
|
|
|
GameManager.DB.SaveDatas();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void WinWithFirstBbug(long resultGold)
|
|
|
|
|
|
{
|
|
|
|
|
|
GoldTMP.enabled = true;
|
|
|
|
|
|
DetailTMP.enabled = false;
|
|
|
|
|
|
DetailButtonGO.SetActive(false);
|
|
|
|
|
|
ForcedMoveButtonGO.SetActive(false);
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Win);
|
|
|
|
|
|
|
2025-08-30 03:09:13 +00:00
|
|
|
|
DSUtil.InActivateGameObjects(gos_result, 0);
|
2025-08-27 21:08:17 +00:00
|
|
|
|
|
|
|
|
|
|
_resultTotalGold = resultGold;
|
2025-08-30 03:09:13 +00:00
|
|
|
|
t_Cal.text = "7점 = 총 7점";
|
2025-08-27 21:08:17 +00:00
|
|
|
|
|
|
|
|
|
|
GoldTMP.text = "+" + CodeJay.CodeJayUtility.Converter.MoneyToString(_resultTotalGold);
|
|
|
|
|
|
|
|
|
|
|
|
if (GamePanel.Instance.IsChallengeMode)
|
|
|
|
|
|
{
|
|
|
|
|
|
GetHeartPanel.SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ŭ<><C5AC><EFBFBD><EFBFBD> <20>ߴٸ<DFB4>
|
2025-08-29 13:01:17 +00:00
|
|
|
|
if (GameManager.DB.AddCurrentChallengeCondition(_resultTotalGold, true))
|
2025-08-27 21:08:17 +00:00
|
|
|
|
{
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Win_2);
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < NormalGameObjects.Length; i++)
|
|
|
|
|
|
NormalGameObjects[i].SetActive(false);
|
|
|
|
|
|
for (int i = 0; i < ClearChallengeObjects.Length; i++)
|
|
|
|
|
|
ClearChallengeObjects[i].SetActive(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Win);
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < NormalGameObjects.Length; i++)
|
|
|
|
|
|
NormalGameObjects[i].SetActive(true);
|
|
|
|
|
|
for (int i = 0; i < ClearChallengeObjects.Length; i++)
|
|
|
|
|
|
ClearChallengeObjects[i].SetActive(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GameManager.DB.AddNormalGameProgress(_resultTotalGold))
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Win_2);
|
|
|
|
|
|
GetHeartPanel.SetActive(true);
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < NormalGameObjects.Length; i++)
|
|
|
|
|
|
NormalGameObjects[i].SetActive(false);
|
|
|
|
|
|
for (int i = 0; i < ClearChallengeObjects.Length; i++)
|
|
|
|
|
|
ClearChallengeObjects[i].SetActive(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Win);
|
|
|
|
|
|
GetHeartPanel.SetActive(false);
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < NormalGameObjects.Length; i++)
|
|
|
|
|
|
NormalGameObjects[i].SetActive(true);
|
|
|
|
|
|
for (int i = 0; i < ClearChallengeObjects.Length; i++)
|
|
|
|
|
|
ClearChallengeObjects[i].SetActive(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GameManager.Event.InvokeEvent(EEventType.OnSynchronizeGold);
|
|
|
|
|
|
GameManager.Event.InvokeEvent(EEventType.OnGameEnd);
|
|
|
|
|
|
GameManager.DB.SaveDatas();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ClickHome()
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|
|
|
|
|
if (GamePanel.Instance.IsChallengeMode)
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Event.InvokeEvent(EEventType.OnReturnToHunting);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Event.InvokeEvent(EEventType.OnReturnToHome);
|
|
|
|
|
|
}
|
|
|
|
|
|
GameManager.UI.HideTopPopup();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ClickNext()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GamePanel.Instance.IsChallengeMode)
|
|
|
|
|
|
{
|
|
|
|
|
|
BGId huntingDataID = GameManager.BGDatabase.GetLastUnolockHuntingDataID();
|
|
|
|
|
|
BGId huntingListDataID = GameManager.BGDatabase.GetLastUnolockHuntingListDataID();
|
|
|
|
|
|
if (huntingDataID != BGId.Empty && huntingListDataID != BGId.Empty)
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|
|
|
|
|
GameManager.Event.InvokeEvent(EEventType.OnReturnToHunting);
|
|
|
|
|
|
GameManager.Event.InvokeEvent(EEventType.OnClickFullView, huntingDataID, huntingListDataID);
|
|
|
|
|
|
|
|
|
|
|
|
GameManager.UI.HideTopPopup();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*if (GameManager.DB.Heart > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.DB.SubHeart(1);
|
|
|
|
|
|
GameManager.DB.SaveDatas();
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|
|
|
|
|
GamePanel.Instance.StartNextGame();
|
|
|
|
|
|
GameManager.UI.HideTopPopup();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.UI.ShowNStackPopup(EPopupType.HeartChargePopup);
|
|
|
|
|
|
}*/
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|
|
|
|
|
GamePanel.Instance.StartNextGame();
|
|
|
|
|
|
GameManager.UI.HideTopPopup();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ClickNextGame()
|
|
|
|
|
|
{
|
|
|
|
|
|
// Show Ad
|
|
|
|
|
|
if (CheckShowInterstitialAD())
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (GamePanel.Instance.IsChallengeMode)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GameManager.DB.Heart > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.DB.SubHeart(1, this.name);
|
|
|
|
|
|
GameManager.DB.SaveDatas();
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|
|
|
|
|
GamePanel.Instance.StartNextGame();
|
|
|
|
|
|
GameManager.UI.HideTopPopup();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.UI.ShowNStackPopup(EPopupType.HeartChargePopup);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|
|
|
|
|
GamePanel.Instance.StartNextGame();
|
|
|
|
|
|
GameManager.UI.HideTopPopup();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ClickHeart()
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|
|
|
|
|
|
|
|
|
|
|
if (_appliedButtonEffect)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
// 두배
|
|
|
|
|
|
if (_gameResult)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GamePanel.Instance.IsChallengeMode)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GameManager.DB.Heart > 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
_appliedButtonEffect = true;
|
|
|
|
|
|
GameManager.DB.SubHeart(1, this.name);
|
|
|
|
|
|
GamePanel.Instance.AddMultiplyType(EScoreMutiplyType.ClickedFromResultPopup);
|
|
|
|
|
|
|
|
|
|
|
|
this.ClickNextGame();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.UI.ShowNStackPopup(EPopupType.DoubleHeartWarningPopup);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GameManager.DB.Heart > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
_appliedButtonEffect = true;
|
|
|
|
|
|
GameManager.DB.SubHeart(1, this.name);
|
|
|
|
|
|
GamePanel.Instance.AddMultiplyType(EScoreMutiplyType.ClickedFromResultPopup);
|
|
|
|
|
|
|
|
|
|
|
|
this.ClickNextGame();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.UI.ShowNStackPopup(EPopupType.HeartChargePopup);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else // 무효
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GameManager.DB.Heart > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.DB.AddGold(_resultTotalGold, this.name);
|
|
|
|
|
|
GameManager.DB.SubHeart(1, this.name);
|
|
|
|
|
|
_appliedButtonEffect = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.UI.ShowNStackPopup(EPopupType.HeartChargePopup);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ClickAdButton()
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|
|
|
|
|
|
|
|
|
|
|
if (_appliedButtonEffect)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GamePanel.Instance.IsChallengeMode)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GameManager.DB.Heart <= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.UI.ShowNStackPopup(EPopupType.HeartChargePopup);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.ADS.ShowResultRewardedAd(this.name);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.ADS.ShowResultRewardedAd(this.name);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void AdCallback(bool result)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (result)
|
|
|
|
|
|
{
|
|
|
|
|
|
_appliedButtonEffect = true;
|
|
|
|
|
|
|
|
|
|
|
|
if (_gameResult)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GamePanel.Instance.IsChallengeMode)
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.DB.SubHeart(1, this.name);
|
|
|
|
|
|
GameManager.DB.SaveDatas();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GamePanel.Instance.AddMultiplyType(EScoreMutiplyType.ClickedFromResultPopup);
|
|
|
|
|
|
|
|
|
|
|
|
GamePanel.Instance.StartNextGame();
|
|
|
|
|
|
GameManager.UI.HideTopPopup();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.DB.AddGold(_resultTotalGold, this.name);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void DetailToggle()
|
|
|
|
|
|
{
|
|
|
|
|
|
_isDetail = !_isDetail;
|
|
|
|
|
|
DetailTMP.enabled = _isDetail;
|
|
|
|
|
|
|
|
|
|
|
|
if (_isDetail)
|
|
|
|
|
|
{
|
|
|
|
|
|
GoldTMP.enabled = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GoldTMP.enabled = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ClickNextLevel()
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|
|
|
|
|
|
|
|
|
|
|
// Show Ad
|
|
|
|
|
|
if (CheckShowInterstitialAD())
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// <20>ӽ÷<D3BD> <20>ٷ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
this.ClickNextLevelCallback(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void ClickNextLevelCallback(bool result)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (result)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.ClickNext();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ClickForcedMoveToHome()
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|
|
|
|
|
if (GamePanel.Instance.IsChallengeMode)
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Event.InvokeEvent(EEventType.OnReturnToHunting);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.Event.InvokeEvent(EEventType.OnReturnToHome);
|
|
|
|
|
|
}
|
|
|
|
|
|
GameManager.UI.HideTopPopup();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private bool CheckShowInterstitialAD()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GamePanel.Instance.IsChallengeMode == false && GameManager.DB.InterstitialADCount <= CodeJay.Defines.Constants.INTERSTITIAL_AD_CYCLE)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GameManager.DB.InterstitialADCount <= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 광고 실행하기
|
|
|
|
|
|
GameManager.ADS.ShowInterstitialAd();
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnCompletedRewardedAd(bool isCompleted, string name)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GamePanel.Instance.IsChallengeMode == false && GameManager.DB.InterstitialADCount <= CodeJay.Defines.Constants.INTERSTITIAL_AD_CYCLE)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GameManager.DB.InterstitialADCount <= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.DB.ResetInterstitialADCount();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (name == this.name)
|
|
|
|
|
|
{
|
|
|
|
|
|
AdCallback(isCompleted);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnCompletedInterstitialAd(bool isCompleted)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(isCompleted == true || GameManager.DB.IsRemoveADS == true)
|
|
|
|
|
|
{
|
|
|
|
|
|
GameManager.DB.ResetInterstitialADCount();
|
|
|
|
|
|
|
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|
|
|
|
|
GamePanel.Instance.StartNextGame();
|
|
|
|
|
|
GameManager.UI.HideTopPopup();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-08-30 03:09:13 +00:00
|
|
|
|
|
|
|
|
|
|
public class ResultxInfoData
|
|
|
|
|
|
{
|
|
|
|
|
|
public EScoreMutiplyType type;
|
|
|
|
|
|
public string name;
|
|
|
|
|
|
public int mul = 0;
|
|
|
|
|
|
}
|