Esempio n. 1
0
    private void AddScrollCell(int index, GrowthPlanListPush.Items info, int typeId)
    {
        Transform       transform       = this.m_awardlist.get_transform().FindChild("GrowUpPlanItem" + index);
        int             buttonState     = GrowUpPlanUI.GetButtonState(info.hasGetPrize, info.canGetFlag);
        ChengChangJiHua chengChangJiHua = DataReader <ChengChangJiHua> .Get(info.roleLv);

        GrowUpPlanDataUnite itemData = new GrowUpPlanDataUnite
        {
            typeId    = typeId,
            itemId    = chengChangJiHua.ItemId,
            count     = chengChangJiHua.ItemNum,
            condition = info.roleLv,
            state     = buttonState
        };

        if (transform != null)
        {
            transform.get_gameObject().SetActive(true);
            transform.GetComponent <GrowUpPlanItem>().UpdateItem(itemData);
        }
        else
        {
            GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("GrowUpPlanItem");
            instantiate2Prefab.get_transform().SetParent(this.m_awardlist.get_transform(), false);
            instantiate2Prefab.set_name("GrowUpPlanItem" + index);
            instantiate2Prefab.get_gameObject().SetActive(true);
            instantiate2Prefab.GetComponent <GrowUpPlanItem>().UpdateItem(itemData);
        }
    }
Esempio n. 2
0
 private GrowthPlanListPush DataSort(GrowthPlanListPush down)
 {
     down.item.Sort(delegate(GrowthPlanListPush.Items a, GrowthPlanListPush.Items b)
     {
         int buttonState  = GrowUpPlanUI.GetButtonState(a.hasGetPrize, a.canGetFlag);
         int buttonState2 = GrowUpPlanUI.GetButtonState(b.hasGetPrize, b.canGetFlag);
         int result       = 0;
         if (buttonState != buttonState2)
         {
             if (buttonState == 2)
             {
                 result = -1;
             }
             else if (buttonState == 1 && buttonState2 != 2)
             {
                 result = -1;
             }
         }
         else
         {
             result = a.roleLv.CompareTo(b.roleLv);
         }
         return(result);
     });
     return(down);
 }
Esempio n. 3
0
 private void Awake()
 {
     GrowUpPlanUI.Instance = this;
     base.AwakeBase(BindingContext.BindingContextMode.MonoBinding, false);
     this.textVipLevel         = base.FindTransform("ImageVip").get_transform().FindChild("TextVipLevel").GetComponent <Text>();
     this.textBuyDiamond       = base.FindTransform("BtnBuy").get_transform().FindChild("TextDiamond").GetComponent <Text>();
     this.m_awardlist          = base.FindTransform("Content").FindChild("Grid").GetComponent <GridLayoutGroup>();
     this.buyBtn               = base.FindTransform("BtnBuy").GetComponent <ButtonCustom>();
     this.buyBtn.onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickBtnBuy);
     this.UpdateBuyBtn(true);
 }