70 lines
1.9 KiB
C#
70 lines
1.9 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class ChristmasSockPrize : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private Text snowManNameText;
|
|
|
|
[SerializeField]
|
|
private Text cookieManNameText;
|
|
|
|
[SerializeField]
|
|
private Text prizeDescriptionText;
|
|
|
|
[SerializeField]
|
|
private Text closeText;
|
|
|
|
[SerializeField]
|
|
private GameManager.ItemType[] prizeItemType;
|
|
|
|
[SerializeField]
|
|
private int[] prizeGameId;
|
|
|
|
private bool isClose;
|
|
|
|
private void Start()
|
|
{
|
|
closeText.enabled = false;
|
|
FScriptsHandler.Instance.m_PlayerMain.firstPersonController.frezzePosition = true;
|
|
FScriptsHandler.Instance.m_PlayerMain.firstPersonController.frezzeRotation = true;
|
|
}
|
|
|
|
public void Setup(int prizeIndex, int prizeIndex2)
|
|
{
|
|
prizeDescriptionText.text = LanguageManager.Instance.GetText("REWARD_CHRISTMAS");
|
|
GameManager.PlayerData.CFloats cFloats = new GameManager.PlayerData.CFloats();
|
|
cFloats.amount = 1;
|
|
cFloats.ID = prizeGameId[prizeIndex];
|
|
cFloats.wear = 100;
|
|
cFloats.buyPrice = 0f;
|
|
cFloats.uniqueId = GameManager.GetUniqueNumber();
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFloats.Add(cFloats);
|
|
GameManager.PlayerData.CBaits cBaits = new GameManager.PlayerData.CBaits();
|
|
cBaits.amount = 1;
|
|
cBaits.ID = prizeGameId[prizeIndex2];
|
|
cBaits.wear = 100;
|
|
cBaits.amount = 50;
|
|
cBaits.buyPrice = 0f;
|
|
cBaits.uniqueId = GameManager.GetUniqueNumber();
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerBaits.Add(cBaits);
|
|
snowManNameText.text = GameManager.Instance.GetGameItemName(prizeItemType[prizeIndex], prizeGameId[prizeIndex]);
|
|
cookieManNameText.text = GameManager.Instance.GetGameItemName(prizeItemType[prizeIndex2], prizeGameId[prizeIndex2]);
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (isClose && Input.anyKeyDown)
|
|
{
|
|
FScriptsHandler.Instance.m_PlayerMain.firstPersonController.UnFrezzeLook();
|
|
Object.Destroy(base.gameObject);
|
|
}
|
|
}
|
|
|
|
public void ShowClose()
|
|
{
|
|
isClose = true;
|
|
closeText.enabled = true;
|
|
}
|
|
}
|