private void ShowPromotion(DataDailyGift data)
 {
     for (int i = 0; i < data.values.Length; i++)
     {
         string   day    = "";
         string[] values = Utility.Convert.ConvertMoneyAndShortCut(data.values[i]);
         if (data.chainIndex == i)
         {
             day = "Hôm nay";
         }
         else
         {
             day = "Ngày " + (i + 1);
         }
         int index = -1;
         if (i == 0)
         {
             index = i;
         }
         else if (i < data.values.Length - 1)
         {
             index = 1;
         }
         else
         {
             index = 2;
         }
         PromotionPresenter presenter = new PromotionPresenter(day, values[0], values[1], index, delegate()
         {
             API.Client.APIGeneric.GetDailyGift();
             GameObject.Destroy(gameObject);
         });
         PromotionView view = presenter.View as PromotionView;
         view.gameObject.name         = "day " + i;
         view.transform.parent        = tableGift.transform;
         view.transform.localScale    = Vector3.one;
         view.transform.localPosition = Vector2.zero;
         if (i < data.chainIndex)
         {
             view.ShowActive();
         }
         else if (i > data.chainIndex)
         {
             if (i == data.values.Length - 1)
             {
                 view.ShowActive();
             }
             else
             {
                 view.ShowDeactive();
             }
         }
         else
         {
             view.ShowAnmation(true);
         }
     }
     tableGift.Reposition();
 }
Beispiel #2
0
 void Dispatcher_onDailyGift(DataDailyGift obj)
 {
     this.dailyGift = obj;
     PuMain.Setting.Threading.QueueOnMainThread(() =>
     {
         ExecuteFuntion(.5f, () =>
         {
             DialogService.Instance.ShowDialog(new DialogPromotion(obj));
         });
     });
 }
 public DialogPromotion(DataDailyGift gift)
     : base()
 {
     this.gift = gift;
 }