Shegotwet/Assets/Scripts/Game/LuckyGameObj.cs

31 lines
738 B
C#
Raw Normal View History

2025-09-12 19:39:24 +00:00
using GUPS.AntiCheat.Protected;
using UnityEngine;
2025-09-12 19:51:36 +00:00
using UnityEngine.UI;
2025-09-12 19:39:24 +00:00
public class LuckyGameObj : MonoBehaviour
{
2025-09-12 19:51:36 +00:00
public Image m_image;
public GameObject go_effect;
2025-09-12 19:39:24 +00:00
ProtectedInt32 m_Amount;
public void Init(Vector3 pos)
{
2025-09-12 19:51:36 +00:00
m_image.enabled = true;
go_effect.SetActive(false);
2025-09-12 19:39:24 +00:00
m_Amount = 1; m_Amount.Obfuscate();
transform.localPosition = pos;
}
private void OnCollisionEnter2D(Collision2D collision)
{
if (collision == null) return;
if (collision.collider.tag == "Player")
{ // 재화 획득
LobbyUI.Ins.m_Game_Lucky.Add_Amount(m_Amount);
2025-09-12 19:51:36 +00:00
m_image.enabled = false;
go_effect.SetActive(true);
2025-09-12 19:39:24 +00:00
}
}
}