Exemplo n.º 1
0
    private ShopOneBase get_one(string str)
    {
        ShopOneBase base2 = null;

        if (this.mList.TryGetValue(str, out base2))
        {
        }
        return(base2);
    }
Exemplo n.º 2
0
    private ShopOneBase GetShop(string path)
    {
        object[]   args  = new object[] { path };
        GameObject child = Object.Instantiate <GameObject>(ResourceManager.Load <GameObject>(Utils.FormatString("UIPanel/ShopUI/{0}", args)));

        child.SetParentNormal(this.mScrollRect.get_content().transform);
        ShopOneBase component = child.GetComponent <ShopOneBase>();

        this.mShopItemList.Add(component);
        return(component);
    }
Exemplo n.º 3
0
    private void InitUI()
    {
        this.shops.Clear();
        int num   = 0;
        int count = this.mShopItemList.Count;

        while (num < count)
        {
            if (this.mShopItemList[num] != null)
            {
                Object.Destroy(this.mShopItemList[num].gameObject);
            }
            num++;
        }
        this.mShopItemList.Clear();
        if (this.mTransfer.type == ShopSingleProxy.SingleType.eDiamond)
        {
            this.shops.Add("ShopOneStageDiscount");
            this.shops.Add("ShopOneDiamond");
        }
        float y    = 100f;
        int   num4 = 0;
        int   num5 = this.shops.Count;

        while (num4 < num5)
        {
            Func <bool> func = null;
            if ((!this.mOpenCondition.TryGetValue(this.shops[num4], out func) || (func == null)) || func())
            {
                ShopOneBase shop = this.GetShop(this.shops[num4]);
                shop.Init();
                shop.mRectTransform.anchoredPosition = new Vector2(0f, -y);
                y += shop.mRectTransform.sizeDelta.y;
            }
            num4++;
        }
        if (y > this.window.sizeDelta.y)
        {
            y += 200f;
            this.mScrollRect.movementType = ScrollRect.MovementType.Elastic;
        }
        else
        {
            this.mScrollRect.movementType = ScrollRect.MovementType.Clamped;
        }
        this.mScrollRect.get_content().sizeDelta = new Vector2(this.mScrollRect.get_content().sizeDelta.x, y);
    }
Exemplo n.º 4
0
    private void InitUI()
    {
        this.uppos = -70f + PlatformHelper.GetFringeHeight();
        float uppos = this.uppos;
        float y     = -uppos;
        int   num3  = 0;
        int   count = this.openlist.Count;

        while (num3 < count)
        {
            Func <bool> func = null;
            if ((this.mOpenCondition.TryGetValue(this.openlist[num3], out func) && (func != null)) && !func())
            {
                ShopOneBase base2 = this.get_one(this.openlist[num3]);
                if (base2 != null)
                {
                    base2.gameObject.SetActive(false);
                }
            }
            else
            {
                ShopOneBase shop = this.GetShop(this.openlist[num3]);
                shop.gameObject.SetActive(true);
                shop.Init();
                shop.mRectTransform.anchoredPosition = new Vector3(0f, uppos, 0f);
                uppos -= shop.mRectTransform.sizeDelta.y;
                y     += shop.mRectTransform.sizeDelta.y;
            }
            num3++;
        }
        this.UpdateNet();
        y += 200f;
        this.mScrollRect.get_content().sizeDelta = new Vector2(this.mScrollRect.get_content().sizeDelta.x, y);
        this.maxcontenty = y - this.windowt.sizeDelta.y;
        this.maxcontenty = MathDxx.Clamp(this.maxcontenty, 0f, this.maxcontenty);
        this.Goto(0, false);
    }