private void AddCell(string txt)
    {
        var cell = Instantiate(cmpCellPrefab, scrollContent.transform);
        CmpLongButtonUiController longButtonController = cell.GetComponent <CmpLongButtonUiController>();
        var longElement = postponedElements["CategoryLongButton"];

        longButtonController.SetLocalization(longElement);
        longButtonController.SetMainText(txt);
    }
Esempio n. 2
0
 public void FillShortCategories(List <CmpShortCategoryModel> shortCategories)
 {
     ClearScrollContent();
     foreach (var cat in shortCategories)
     {
         var cell = Instantiate(cmpCellPrefab, scrollContent.transform);
         CmpLongButtonUiController longButtonController = cell.GetComponent <CmpLongButtonUiController>();
         longButtonController.SetMainText(cat.name);
     }
     ScrollAppear(0);
 }
 private void AddVendors(List <CmpVendorModel> vendors)
 {
     foreach (CmpVendorModel vendor in vendors)
     {
         bool isAccepted            = CmpPmSaveAndExitVariablesContext.IsVendorAcceptedAnywhere(vendor.vendorId) || vendor.accepted;
         bool enableCustomTextLabel = vendor.vendorType != null && vendor.vendorType.Equals("CUSTOM");
         CmpLongButtonUiController longController = AddCell(vendor.name, enableCustomTextLabel);
         longController.SetGroupState(isAccepted);
         CmpLongButtonController btn = longController.gameObject.AddComponent <CmpLongButtonController>();
         btn.SetButtonRef(longController.GetButton());
         btn.SetOnClickAction(delegate { InstantiateVendorDetailsPrefab(vendor); });
     }
 }
Esempio n. 4
0
 public override void FillView()
 {
     ClearScrollContent();
     if (CmpLocalizationMapper.shortCategories != null)
     {
         foreach (var cat in CmpLocalizationMapper.shortCategories)
         {
             var cell = Instantiate(cmpCellPrefab, scrollContent.transform);
             CmpLongButtonUiController longButtonController = cell.GetComponent <CmpLongButtonUiController>();
             var longElement = postponedElements["CategoryButtons"];
             longButtonController.SetLocalization(longElement);
             longButtonController.SetMainText(cat.name);
         }
     }
     ScrollAppear(-800f);
 }
    private void SetCellOnClickAction(CmpLongButtonUiController longController, CmpCategoryBaseModel model)
    {
        CmpLongButtonTextChangeController catController = longController.gameObject.GetComponent <CmpLongButtonTextChangeController>();

        catController.SetOnClickAction(delegate { InstantiateVendorDetailsPrefab(model); });
    }