85 lines
2.8 KiB
C#
85 lines
2.8 KiB
C#
using CodeJay.Enum;
|
|
using TMPro;
|
|
using UnityEngine.UI;
|
|
|
|
public class PreviewUIPopup : PopupBase
|
|
{
|
|
public Image i_ai;
|
|
public TextMeshProUGUI[] texts; // 0 소지금, 1 레벨, 2 0점 X 0배, 3 고, 4 흔듦, 5 뻑
|
|
public TextMeshProUGUI[] texts_mission; // 0 메인 미션, 1 서브 미션
|
|
public TextMeshProUGUI[] texts_cardcount; // 0 광, 1 열끗, 2 띠, 3 피
|
|
public MissionOpenPopup_Main m_MissionOpenPopup_Main;
|
|
public MissionOpenPopup_Sub m_MissionOpenPopup_Sub;
|
|
|
|
public override void ShowPopup(int drawOrder)
|
|
{
|
|
base.ShowPopup(drawOrder);
|
|
GameManager.Sound.PlaySFX(ESFXType.Open_Popup);
|
|
GameManager.ADS.HideBanner();
|
|
|
|
i_ai.sprite = DB_HuntingData.GetEntity((GameManager.DB.GetUnlockTargetIndex(true) << 1) - 1).DBF_HuntingImage;
|
|
i_ai.preserveAspect = true;
|
|
texts[0].text = GamePanel.Instance.AIGoldTMP.text;
|
|
texts[1].text = $"Lv.{GameManager.DB.NormalGameLevel}";
|
|
Set_Point();
|
|
texts[3].text = GamePanel.Instance.AI_Go.ToString();
|
|
texts[4].text = GamePanel.Instance.AI_Bell.ToString();
|
|
texts[5].text = GamePanel.Instance.AI_Bbug.ToString();
|
|
|
|
m_MissionOpenPopup_Main.gameObject.SetActive(true);
|
|
m_MissionOpenPopup_Sub.gameObject.SetActive(true);
|
|
}
|
|
|
|
void Set_Point()
|
|
{
|
|
int score = GamePanel.Instance.GetTotalScore(false, false);
|
|
int goNumer = GamePanel.Instance.AI_Go;
|
|
int multiply = 1;
|
|
string str = $"{score}점";
|
|
|
|
if (goNumer == 1)
|
|
{
|
|
str += " + 1고(1점) ";
|
|
score += 1;
|
|
}
|
|
else if (goNumer == 2)
|
|
{
|
|
str += " + 2고(2점) ";
|
|
score += 2;
|
|
}
|
|
else if (goNumer >= 3)
|
|
{
|
|
GamePanel.Instance.AddMultiplyType(EScoreMutiplyType.Go);
|
|
}
|
|
|
|
|
|
var multipleType = GamePanel.Instance.GetAndUpdateScoreMultiplyType(false);
|
|
|
|
if (multipleType != null)
|
|
{
|
|
for (int i = 0; i < multipleType.Count; i++)
|
|
{
|
|
if (multiply <= 0)
|
|
multiply = 1;
|
|
|
|
var val = CodeJay.CodeJayUtility.Utility.GetScoreMultiplyValue(multipleType[i]);
|
|
if (multipleType[i] == EScoreMutiplyType.Shake)
|
|
val *= GamePanel.Instance.Player_Bell;
|
|
else if (multipleType[i] == EScoreMutiplyType.ClickedFromResultPopup)
|
|
val *= GamePanel.Instance.Player_Milgi;
|
|
else if (multipleType[i] == EScoreMutiplyType.Go)
|
|
val *= goNumer - 2;
|
|
multiply *= val;
|
|
}
|
|
}
|
|
|
|
texts[2].text = str + $" x {multiply}배";
|
|
}
|
|
|
|
public void ClickCancel()
|
|
{
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|
GameManager.UI.HideTopPopup();
|
|
GameManager.ADS.ShowBanner();
|
|
}
|
|
} |