1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using UnityEngine;
- using UnityEngine.UI;
- using System.Collections;
- using System.Collections.Generic;
- public class BuyVIPPanel : PopUpPanel
- {
- public Text info;
- public Price price;
- private BuyItemData data;
- void Awake()
- {
-
- }
- // Use this for initialization
- void Start ()
- {
- data = GetData();
- info.text = Language.GetStr("BuyVIP", "buyInfo");
- price.SetPrice(data.GetCurrency(), data.GetPrice());
- }
- public void Confirm()
- {
- Close();
- }
- private static VIPItemData itemData;
- public static VIPItemData GetData()
- {
- if(itemData == null)
- {
- itemData = new VIPItemData("VIP4", 199);
- }
- return itemData;
- }
- private static BuyVIPPanel currentPanel;
- public static BuyVIPPanel Show()
- {
- Toast.MakeText(Language.GetStr("Public", "noFunction"));
- return null;
- if(currentPanel != null)
- return currentPanel;
-
- GameObject prefab = Resources.Load<GameObject>("Prefabs/UI/Shop/BuyVIPPanel");
- GameObject panelObj = Instantiate<GameObject>(prefab);
- PopUpManager.AddToMainCanvas(panelObj);
- currentPanel = panelObj.GetComponent<BuyVIPPanel>();
-
- return currentPanel;
- }
- public static void BuySuccess(string id)
- {
- VIPItemData data = GetData();
- if(data.GetItemId() == id)
- {
- Toast.MakeText(Language.GetStr("BuyVIP", "bought"));
- }
- }
- }
|