123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using UnityEngine;
- using System.Collections;
- using TMPro;
- using ICTS.Localization;
- public class GameOverScreenTitle : MonoBehaviour
- {
- public TextMeshProUGUI title;
- public GameObject WithGetWeapon;
- public GameObject Continue;
- void Start()
- {
- WithGetWeapon.SetActive(false);
- Continue.SetActive(false);
- }
- public void ResetButtons()
- {
- WithGetWeapon.SetActive(false);
- Continue.SetActive(true);
- }
- public void OnActive(bool active = false)
- {
- if (PlayerPrefs.GetInt("Coupone")==1)
- {
- MenuManager._instance.CouponeMessage.Show();
- return;
- }
- var curLEvel = LevelsManager.Instance.GetIndexCurLevel();
- curLEvel++;
- Debug.Log("Finish Game " + curLEvel);
- if(MenuManager._instance.Finish)
- {
- Debug.Log("Finish " + LevelsManager.Instance.CurrentLevelIndex);
- title.text = string.Format(Localization.instance.Get("scoreSummary.title.finished"), curLEvel-1);
- if (LevelsManager.Instance.CurrentLevelIndex > 2)
- {
- if (InventoryManager.Instance.GetItemCount(InventoryItem.specialwave) <= 1)
- {
- Continue.SetActive(false);
- WithGetWeapon.SetActive(true);
- }
- else
- {
- WithGetWeapon.SetActive(false);
- Continue.SetActive(true);
- }
- }
- else
- {
- WithGetWeapon.SetActive(false);
- Continue.SetActive(true);
- }
- }
- else
- {
- title.text = string.Format(Localization.instance.Get("scoreSummary.title.nofinished"), curLEvel);
- if (LevelsManager.Instance.CurrentLevelIndex > 2)
- {
- if(InventoryManager.Instance.GetItemCount(InventoryItem.specialwave)<=1)
- {
- Continue.SetActive(false);
- Debug.Log(InventoryManager.Instance.GetItemCount(InventoryItem.specialwave));
- WithGetWeapon.SetActive(true);
- }
- else
- {
- WithGetWeapon.SetActive(false);
- Continue.SetActive(true);
- }
- }
- else
- {
- WithGetWeapon.SetActive(false);
- Continue.SetActive(true);
- }
- }
- //MenuManager._instance.Finish = false;
- }
- }
|