획득 재화 표시
This commit is contained in:
parent
281a50f723
commit
6294ec79a9
File diff suppressed because it is too large
Load Diff
|
|
@ -1,12 +1,15 @@
|
||||||
using GUPS.AntiCheat.Protected;
|
using GUPS.AntiCheat.Protected;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.ResourceManagement.AsyncOperations;
|
using UnityEngine.ResourceManagement.AsyncOperations;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
public class Game_Mini : MonoBehaviour
|
public class Game_Mini : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
public TextMeshProUGUI[] texts_money; // 0 하트, 1 챗코인, 2 가챠 코인
|
||||||
public Image i_girl, i_girlsd;
|
public Image i_girl, i_girlsd;
|
||||||
public MiniGameItemCard[] items;
|
public MiniGameItemCard[] items;
|
||||||
public Slider slider_hp;
|
public Slider slider_hp;
|
||||||
|
|
@ -21,6 +24,8 @@ public class Game_Mini : MonoBehaviour
|
||||||
ProtectedInt32 m_HP;
|
ProtectedInt32 m_HP;
|
||||||
bool bStartGame;
|
bool bStartGame;
|
||||||
float PcPosLimit;
|
float PcPosLimit;
|
||||||
|
Dictionary<eMiniGameObtacleType, ProtectedInt32> dic_Money = new Dictionary<eMiniGameObtacleType, ProtectedInt32>();
|
||||||
|
Dictionary<eMiniGameObtacleType, TextMeshProUGUI> dic_MoneyText = new Dictionary<eMiniGameObtacleType, TextMeshProUGUI>();
|
||||||
|
|
||||||
Dictionary<eMiniGameObtacleType, int> dic_weight = new Dictionary<eMiniGameObtacleType, int>();
|
Dictionary<eMiniGameObtacleType, int> dic_weight = new Dictionary<eMiniGameObtacleType, int>();
|
||||||
List<MiniGameObtacle> list_MiniGameObtacle = new List<MiniGameObtacle>();
|
List<MiniGameObtacle> list_MiniGameObtacle = new List<MiniGameObtacle>();
|
||||||
|
|
@ -28,6 +33,9 @@ public class Game_Mini : MonoBehaviour
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
PcPosLimit = (Screen.width >> 1) - 70f;
|
PcPosLimit = (Screen.width >> 1) - 70f;
|
||||||
|
dic_MoneyText.Add(eMiniGameObtacleType.AlbumOpen, texts_money[0]);
|
||||||
|
dic_MoneyText.Add(eMiniGameObtacleType.ChatCoin, texts_money[1]);
|
||||||
|
dic_MoneyText.Add(eMiniGameObtacleType.GachaCoin, texts_money[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Set()
|
public void Set()
|
||||||
|
|
@ -44,6 +52,16 @@ public class Game_Mini : MonoBehaviour
|
||||||
|
|
||||||
gameObject.SetActive(true);
|
gameObject.SetActive(true);
|
||||||
|
|
||||||
|
for (int i = 0; i < dic_Money.Keys.ToList().Count; i++)
|
||||||
|
{
|
||||||
|
var key = dic_Money.Keys.ToList()[i];
|
||||||
|
dic_Money[key] = 0;
|
||||||
|
dic_Money[key].Obfuscate();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < texts_money.Length; i++)
|
||||||
|
texts_money[i].text = "0";
|
||||||
|
|
||||||
tf_pc.anchoredPosition = new Vector2(0f, 325f);
|
tf_pc.anchoredPosition = new Vector2(0f, 325f);
|
||||||
|
|
||||||
DSUtil.InActivateGameObjects(gos_hiteffect);
|
DSUtil.InActivateGameObjects(gos_hiteffect);
|
||||||
|
|
@ -127,19 +145,38 @@ public class Game_Mini : MonoBehaviour
|
||||||
}
|
}
|
||||||
|
|
||||||
Coroutine cohit;
|
Coroutine cohit;
|
||||||
public void Hit()
|
public void Hit(eMiniGameObtacleType type, int val)
|
||||||
{
|
{
|
||||||
if (cohit != null) StopCoroutine(cohit);
|
if (cohit != null) StopCoroutine(cohit);
|
||||||
cohit = StartCoroutine(Co_Hit());
|
cohit = StartCoroutine(Co_Hit(type, val));
|
||||||
}
|
}
|
||||||
IEnumerator Co_Hit()
|
IEnumerator Co_Hit(eMiniGameObtacleType type, int val)
|
||||||
{
|
{
|
||||||
--m_HP;
|
switch (type)
|
||||||
m_HP.Obfuscate();
|
{
|
||||||
slider_hp.value = m_HP / table_GlobalValue.Ins.Get_Float("MiniGameHP");
|
case eMiniGameObtacleType.White:
|
||||||
if (m_HP <= 0) GameOver();
|
case eMiniGameObtacleType.Red:
|
||||||
|
m_HP -= val;
|
||||||
|
m_HP.Obfuscate();
|
||||||
|
slider_hp.value = m_HP / table_GlobalValue.Ins.Get_Float("MiniGameHP");
|
||||||
|
if (m_HP <= 0) GameOver();
|
||||||
|
i_girl.sprite = m_Handle2.Result;
|
||||||
|
break;
|
||||||
|
case eMiniGameObtacleType.HpHeal:
|
||||||
|
m_HP += val;
|
||||||
|
m_HP.Obfuscate();
|
||||||
|
slider_hp.value = m_HP / table_GlobalValue.Ins.Get_Float("MiniGameHP");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (!dic_Money.ContainsKey(type))
|
||||||
|
dic_Money.Add(type, 0);
|
||||||
|
dic_Money[type] += val;
|
||||||
|
dic_Money[type].Obfuscate();
|
||||||
|
if (dic_MoneyText.ContainsKey(type))
|
||||||
|
dic_MoneyText[type].text = dic_Money[type].ToString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
i_girl.sprite = m_Handle2.Result;
|
|
||||||
yield return new WaitForSeconds(0.5f);
|
yield return new WaitForSeconds(0.5f);
|
||||||
i_girl.sprite = m_Handle1.Result;
|
i_girl.sprite = m_Handle1.Result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@ public class MiniGameObtacle : MonoBehaviour
|
||||||
if (collision.tag.Equals("Player"))
|
if (collision.tag.Equals("Player"))
|
||||||
{
|
{
|
||||||
Off(true);
|
Off(true);
|
||||||
|
LobbyUI.Ins.m_Game_Mini.Hit(m_Type, m_Dmg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue