public override void Initialize()
    {
        //IL_0272: Unknown result type (might be due to invalid IL or missing references)
        base.Initialize();
        texModel_ = Utility.Find(base._transform, "TEX_MODEL");
        texModelRenderTexture_      = UIModelRenderTexture.Get(texModel_);
        texModelTexture_            = texModel_.GetComponent <UITexture>();
        texInnerModel_              = Utility.Find(base._transform, "TEX_INNER_MODEL");
        texInnerModelRenderTexture_ = UIModelRenderTexture.Get(texInnerModel_);
        texInnerModelTexture_       = texInnerModel_.GetComponent <UITexture>();
        glowModel_ = Utility.Find(base._transform, "LIB_00000003");
        LoginBonus loginBonus = (LoginBonus)GameSection.GetEventData();

        if (loginBonus != null)
        {
            SetLabelText((Enum)UI.LBL_LOGIN_DAYS, loginBonus.name);
            if (loginBonus.reward.Count > 0)
            {
                reward = loginBonus.reward[0];
                SetLabelText((Enum)UI.LBL_GET_ITEM, reward.name);
                if (reward.type == 5)
                {
                    uint itemId = (uint)reward.itemId;
                    texModelRenderTexture_.InitSkillItem(texModelTexture_, itemId, true, false, 45f);
                    texInnerModelRenderTexture_.InitSkillItemSymbol(texInnerModelTexture_, itemId, true, 17f);
                    isModel = true;
                }
                else if (reward.type == 4)
                {
                    SetRenderEquipModel((Enum)UI.TEX_MODEL, (uint)reward.itemId, -1, -1, reward.GetScale());
                    texModelTexture_.width  = 300;
                    texModelTexture_.height = 300;
                    isModel = true;
                }
                else if (reward.type == 1 || reward.type == 2)
                {
                    uint itemModelID = GetItemModelID((REWARD_TYPE)reward.type, reward.itemId);
                    texModelRenderTexture_.InitItem(texModelTexture_, itemModelID, true);
                    isModel = true;
                }
                else if (reward.type == 3 && IsDispItem3D(reward.itemId))
                {
                    uint itemModelID2 = GetItemModelID((REWARD_TYPE)reward.type, reward.itemId);
                    texModelRenderTexture_.InitItem(texModelTexture_, itemModelID2, true);
                    isModel = true;
                }
                if (!isModel)
                {
                    this.StartCoroutine("LoadIcon");
                }
                float rotateSpeed = 35f;
                texModelRenderTexture_.SetRotateSpeed(rotateSpeed);
                texInnerModelRenderTexture_.SetRotateSpeed(rotateSpeed);
            }
        }
    }
Пример #2
0
    public override void Initialize()
    {
        base.Initialize();
        MonoBehaviourSingleton <AccountManager> .I.DisplayLogInBonusSection();

        texModel_ = Utility.Find(base._transform, "TEX_MODEL");
        texModelRenderTexture_      = UIModelRenderTexture.Get(texModel_);
        texModelTexture_            = texModel_.GetComponent <UITexture>();
        texInnerModel_              = Utility.Find(base._transform, "TEX_INNER_MODEL");
        texInnerModelRenderTexture_ = UIModelRenderTexture.Get(texInnerModel_);
        texInnerModelTexture_       = texInnerModel_.GetComponent <UITexture>();
        glowModel_ = Utility.Find(base._transform, "LIB_00000003");
        LoginBonus loginBonus = MonoBehaviourSingleton <AccountManager> .I.logInBonus.Find((LoginBonus obj) => obj.type == 0);

        if (loginBonus != null)
        {
            MonoBehaviourSingleton <AccountManager> .I.logInBonus.Remove(loginBonus);

            SetLabelText((Enum)UI.LBL_LOGIN_DAYS, loginBonus.total.ToString());
            if (loginBonus.reward.Count > 0)
            {
                LoginBonus.LoginBonusReward loginBonusReward = loginBonus.reward[0];
                SetLabelText((Enum)UI.LBL_GET_ITEM, loginBonusReward.name);
                float rotateSpeed = 35f;
                if (loginBonusReward.type == 5)
                {
                    uint itemId = (uint)loginBonusReward.itemId;
                    texModelRenderTexture_.InitSkillItem(texModelTexture_, itemId, true, false, 45f);
                    texInnerModelRenderTexture_.InitSkillItemSymbol(texInnerModelTexture_, itemId, true, 17f);
                }
                else
                {
                    uint itemModelID = GetItemModelID((REWARD_TYPE)loginBonusReward.type, loginBonusReward.itemId);
                    texModelRenderTexture_.InitItem(texModelTexture_, itemModelID, true);
                }
                texModelRenderTexture_.SetRotateSpeed(rotateSpeed);
                texInnerModelRenderTexture_.SetRotateSpeed(rotateSpeed);
            }
        }
    }
Пример #3
0
    private IEnumerator DoInitialize()
    {
        bool connect = false;

        lb = null;
        if (GameSection.GetEventData() != null)
        {
            Protocol.Send <LoginBonusConfirmModel.RequestSendForm, LoginBonusConfirmModel>(post_data: new LoginBonusConfirmModel.RequestSendForm
            {
                loginBonusId = (int)GameSection.GetEventData()
            }, url : LoginBonusConfirmModel.URL, call_back : (Action <LoginBonusConfirmModel>) delegate(LoginBonusConfirmModel ret)
            {
                if (ret.Error == Error.None)
                {
                    if (ret != null && ret.result != null && ret.result.Count > 0)
                    {
                        ((_003CDoInitialize_003Ec__Iterator8D) /*Error near IL_0071: stateMachine*/)._003C_003Ef__this.lb = ret.result[0];
                    }
                    ((_003CDoInitialize_003Ec__Iterator8D) /*Error near IL_0071: stateMachine*/)._003Cconnect_003E__0 = true;
                }
            }, get_param: string.Empty);
            while (!connect)
            {
                yield return((object)null);
            }
        }
        if (!connect)
        {
            lb = MonoBehaviourSingleton <AccountManager> .I.logInBonus[0];
            MonoBehaviourSingleton <AccountManager> .I.logInBonus.Remove(lb);
        }
        if (lb == null)
        {
            base.Initialize();
            while (MonoBehaviourSingleton <GameSceneManager> .I.isChangeing)
            {
                yield return((object)null);
            }
            GameSection.BackSection();
        }
        else
        {
            arrayNow = 0;
            int i = 0;
            for (int count = lb.next.Count; i < count; i++)
            {
                if (lb.next[i].count == lb.nowCount)
                {
                    arrayNow = i;
                    break;
                }
                if (lb.next[i].count > lb.nowCount)
                {
                    arrayNow = i;
                    break;
                }
            }
            int logbo_column_num = 1 + (lb.next.Count - 1) / 5;
            int logbo_now_column = 1 + arrayNow / 5;
            if (logbo_column_num > 3)
            {
                if (logbo_now_column > logbo_column_num - 2)
                {
                    logbo_now_column = logbo_column_num - 2;
                }
                startScrPos = scrollStartHeight + iconHeight * (float)(logbo_now_column - 1);
                isFirst     = true;
            }
            else
            {
                isFirst = false;
            }
            SetPickUp();
            float rotateSpeed = 35f;
            if (pickUpReward.type == 5)
            {
                uint modelID3 = (uint)pickUpReward.itemId;
                texModelRenderTexture_.InitSkillItem(texModelTexture_, modelID3, true, false, 45f);
                texInnerModelRenderTexture_.InitSkillItemSymbol(texInnerModelTexture_, modelID3, true, 17f);
                isModel = true;
            }
            else if (pickUpReward.type == 4)
            {
                SetRenderEquipModel((Enum)UI.TEX_MODEL, (uint)pickUpReward.itemId, -1, -1, pickUpReward.GetScale());
                isModel = true;
            }
            else if (pickUpReward.type == 1 || pickUpReward.type == 2)
            {
                uint modelID = GetItemModelID((REWARD_TYPE)pickUpReward.type, pickUpReward.itemId);
                texModelRenderTexture_.InitItem(texModelTexture_, modelID, true);
                isModel = true;
            }
            else if (pickUpReward.type == 3 && IsDispItem3D(pickUpReward.itemId))
            {
                uint modelID2 = GetItemModelID((REWARD_TYPE)pickUpReward.type, pickUpReward.itemId);
                texModelRenderTexture_.InitItem(texModelTexture_, modelID2, true);
                isModel = true;
            }
            texModelRenderTexture_.SetRotateSpeed(rotateSpeed);
            texInnerModelRenderTexture_.SetRotateSpeed(rotateSpeed);
            LoadingQueue loadingQueue = new LoadingQueue(this);
            string       topImgName   = ResourceName.GetLoginBonusTopImage(lb.loginBonusId);
            topImageLoadObj = loadingQueue.Load(RESOURCE_CATEGORY.LOGINBONUS_IMAGE, topImgName, false);
            if (loadingQueue.IsLoading())
            {
                yield return((object)loadingQueue.Wait());
            }
            base.Initialize();
        }
    }