Example #1
0
    void StartShowDiscountPanel()
    {
        if (!isShowDiscounts)
        {
            return;
        }

        bool isShow = false;

        for (GameCity.Benefit_Gift index = GameCity.Benefit_Gift.Benefit_68; index < GameCity.Benefit_Gift.Benefit_Max; index++)
        {
            bool isbuy = GameKind.HasFlag((int)index, GameMain.hall_.GetPlayerData().discountsGift);
            isShow = !isbuy;
        }

        if (isShow)
        {
            ShowDiscount();
        }
    }
Example #2
0
    void ShowDiscount()
    {
        AssetBundle bundle = AssetBundleManager.GetAssetBundle(GameDefine.HallAssetbundleName);

        if (bundle == null)
        {
            return;
        }

        if (discountobj == null)
        {
            UnityEngine.Object obj0 = (GameObject)bundle.LoadAsset("Activity_discounts");
            discountobj = (GameObject)GameMain.instantiate(obj0);
            discountobj.transform.SetParent(CanvasObj.transform, false);

            InitDiscount();
            InitDiscountCloseButton();
            PlayAnimatorByIndex(1);
        }

        discountobj.SetActive(true);

        GameObject buttonBG = discountobj.transform.Find("ImageBG").Find("LeftButton").
                              Find("ImageViewport").Find("Content").gameObject;

        for (GameCity.Benefit_Gift index = GameCity.Benefit_Gift.Benefit_68; index < GameCity.Benefit_Gift.Benefit_Max; index++)
        {
            bool isbuy = GameKind.HasFlag((int)index, GameMain.hall_.GetPlayerData().discountsGift);
            if (isbuy)
            {
                string name   = "Button_" + ((int)index + 1).ToString();
                Image  button = buttonBG.transform.Find(name).gameObject.GetComponent <Image>();
                button.sprite = buyIcon;
            }
        }

        isStartShow = false;
    }