Exemplo n.º 1
0
 public void SetStore(List <ReChargeData> list)
 {
     while (table.transform.childCount > 0)
     {
         DestroyImmediate(table.transform.GetChild(0).gameObject);
     }
     viewList = new List <RechargeView>();
     if (list != null)
     {
         for (int i = 0; i < list.Count; i++)
         {
             GameObject obj = Instantiate(itemPrefab);
             obj.SetActive(true);
             RechargeView v = obj.GetComponent <RechargeView>();
             v.InitData(this, list[i], i);
             v.gameObject.name         = list[i].id.ToString();
             v.transform.parent        = table.transform;
             v.transform.localPosition = Vector3.zero;
             v.transform.localScale    = Vector3.one;
             viewList.Add(v);
         }
         //始终两行
         int col = viewList.Count / 2;
         if (viewList.Count % 2 > 0)
         {
             col++;
         }
         table.columns = col;
         table.Reposition();
         scroll.ResetPosition();
     }
 }
Exemplo n.º 2
0
    void OnClickAds(GameObject go)
    {
        Announcement ads = GameManager.Instance.ListAnnouncement.Find(a => a.show == Announcement.Scene.lobby && a.type == Announcement.Type.Advertisement);

        if (ads != null && GameManager.Setting.Platform.EnableRecharge)
        {
            RechargeView.Create();
        }
    }
Exemplo n.º 3
0
    public void RechargePurchase(RechargeView v)
    {
        C2sSprotoType.recharge_buy b = new C2sSprotoType.recharge_buy();
        b.csv_id = v.data.id;
        b.num    = 1;
        List <C2sSprotoType.recharge_buy> list = new List <C2sSprotoType.recharge_buy>();

        list.Add(b);
        NetworkManager.Instance.RechargePurchase(list);
    }
Exemplo n.º 4
0
 void OnClickRecharge(GameObject go)
 {
     RechargeView.Create();
 }
Exemplo n.º 5
0
 private void OnClickButtonRecharge(GameObject targetObject)
 {
     RechargeView.Create();
 }
Exemplo n.º 6
0
 public void BuyClick(RechargeView v)
 {
     RechargeMgr.Instance.RechargePurchase(v);
 }
Exemplo n.º 7
0
 public static void MessageRecharge(string message)
 {
     if (GameManager.Setting.Platform.EnableRecharge)
     {
         NotificationView.ShowConfirm("Thông báo", message + "\n\nẤn \"Đồng ý\" để chuyển đến trang nạp tiền", delegate() { RechargeView.Create(); }, null);
     }
     else
     {
         NotificationView.ShowMessage(message);
     }
 }