SHARE
TWEET

Untitled

a guest May 27th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void InitAndFill(ClientSalePackageDefinition spd)
  2.     {
  3.         mApp = AppManager.Instance.GetFirstApp(AppType.UNITY_CLIENT);
  4.         StoreWinController store = Main.Instance.WinManager.HomeWin.StoreWin;
  5.  
  6.         // resize parent height: this is a very hacky way...
  7.         SalePackageHeight.sizeDelta = new Vector2(SalePackageHeight.sizeDelta.x,
  8.                                                   NumRowHave * store.InfiniteScrollSaleSlotHeight.rect.height + TitleHeight);
  9.  
  10.         if(spd.Type == HomeSharedConstants.SalePackageType.GEMS_SALE && FooterPrefab != null)
  11.         {
  12.             if (mFooter == null)
  13.             {
  14.                 mFooter = GameObjectPool.GetPool(GameObjectPool.Category.HOME, FooterPrefab, null).GetOne().GetComponent<RectTransform>();
  15.                
  16.                 mFooter.SetParent(SalePackageHeight);
  17.                 mFooter.anchorMax = new Vector2(1, 0);
  18.                 mFooter.anchorMin = new Vector2(0, 0);
  19.                 mFooter.anchoredPosition = new Vector2(0, 0);
  20.                 mFooter.sizeDelta = new Vector2(0, FooterHeight);
  21.             }
  22.             mFooter.gameObject.SetActive(true);
  23.         }
  24.  
  25.         // init based on the sale slot type
  26.         for (int i = 0; i < Sales.Length; ++i)
  27.         {
  28.             if (i < spd.SaleDefinitions.Length)
  29.             {
  30.                 if (spd.SaleDefinitions[i] != null)
  31.                 {
  32.                     if (spd.Type == HomeSharedConstants.SalePackageType.DAILY_DEAL
  33.                         && spd.SaleDefinitions[i].Id == HomeSharedConstants.DAILY_DEAL_LOCKED_SLOT_PLACEHOLDER)
  34.                     {
  35.                         Sales[i].Init(spd, null, SaleBtnController.SaleSlotType.LOCKED, i);
  36.                     }
  37.                     else
  38.                     {
  39.                         Sales[i].Init(spd, spd.SaleDefinitions[i], SaleBtnController.SaleSlotType.NORMAL, i);
  40.                     }
  41.                 }
  42.                 else
  43.                 {
  44.                     Sales[i].Init(spd, null, SaleBtnController.SaleSlotType.EMPTY, i);
  45.                     BhgCore.Logger.LogWarning($"SalePackage {spd.Title.Value} shows empty sale slot at slot index {i}!");
  46.                 }
  47.             }
  48.             else
  49.             {
  50.                 Sales[i].Init(spd, null, SaleBtnController.SaleSlotType.EMPTY, i);
  51.                 BhgCore.Logger.LogWarning($"SalePackage {spd.Title.Value} shows empty sale slot at slot index {i}!");
  52.             }
  53.         }
  54.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top