コード例 #1
0
        private void onAgreeAplyFriend(GameEvent e)
        {
            Dictionary <uint, itemFriendData> friendDataList = BaseProxy <FriendProxy> .getInstance().FriendDataList;

            foreach (KeyValuePair <uint, itemFriendData> current in friendDataList)
            {
                bool flag = this.friendDataDic.ContainsKey(current.Key);
                if (flag)
                {
                    itemFriendData itemFriendData = this.friendDataDic[current.Key];
                    itemFriendData.itemFPrefab.set(current.Value);
                }
                else
                {
                    itemFriendData value = current.Value;
                    value.itemFPrefab = new itemFriendPrefab();
                    value.itemFPrefab.init();
                    Transform root;
                    value.itemFPrefab.show(current.Value, out root);
                    value.root = root;
                    this.friendDataDic[current.Key] = value;
                }
                bool flag2 = this.EnemyListDataDic.ContainsKey(current.Key);
                if (flag2)
                {
                    this.EnemyListDataDic[current.Key].itemEListPrefab.UpdatePos(current.Value.map_id);
                }
            }
            this.onShowOnlineFriendsChanged(true);
            this.friendLimit.text = friendDataList.Count.ToString() + "/" + (50u + 50u * ModelBase <PlayerModel> .getInstance().up_lvl);
            this.contains.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, (float)(60 * friendDataList.Count));
        }
コード例 #2
0
		public void init(JSONNode d)
		{
			bool flag = d["tcyb_day"] != null;
			if (flag)
			{
				this.moneyPayed = d["tcyb_day"].AsInt / 10;
				debug.Log("当日充值:" + this.moneyPayed);
			}
			bool flag2 = this.sended;
			if (!flag2)
			{
				bool flag3 = d["1000"] == null;
				if (!flag3)
				{
					d = d["1000"];
					bool flag4 = d["cards"] != null;
					if (flag4)
					{
						debug.Log(" cards :" + d["cards"]);
						JSONArray asArray = d["cards"].AsArray;
						foreach (JSONNode jSONNode in asArray)
						{
							BaseProxy<GiftCardProxy>.getInstance().sendFetchCard(jSONNode.ToString());
							this.sended = true;
						}
					}
				}
			}
		}
コード例 #3
0
ファイル: a3_pet_skin.cs プロジェクト: atom-chen/rongyaojt
        public override void onShowed()
        {
            BaseProxy <A3_PetProxy> .getInstance().GetPets();

            A3_PetModel expr_12 = this.petmodel;

            expr_12.OnExpChange = (Action)Delegate.Combine(expr_12.OnExpChange, new Action(this.OnExpChange));
            A3_PetModel expr_39 = this.petmodel;

            expr_39.OnAutoFeedChange = (Action)Delegate.Remove(expr_39.OnAutoFeedChange, new Action(this.OnAutoBuyChange));
            A3_PetModel expr_60 = this.petmodel;

            expr_60.OnLevelChange = (Action)Delegate.Combine(expr_60.OnLevelChange, new Action(this.OnLevelChange));
            A3_PetModel expr_87 = this.petmodel;

            expr_87.OnStageChange = (Action)Delegate.Combine(expr_87.OnStageChange, new Action(this.OnStageChange));
            this.OnExpChange();
            this.OnStarvationChange();
            this.OnAutoFeedChange();
            this.OnAutoBuyChange();
            this.OnLevelChange();
            this.OnStageChange();
            this.OnPetItemChange(null);
            BaseProxy <BagProxy> .getInstance().addEventListener(BagProxy.EVENT_ITEM_CHANGE, new Action <GameEvent>(this.OnPetItemChange));
        }
コード例 #4
0
        private void changeCaptainPos()
        {
            int count = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList.Count;

            ItemTeamMemberData myTeamData = BaseProxy <TeamProxy> .getInstance().MyTeamData;

            List <ItemTeamData> itemTeamDataList = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList;

            int count2 = this.itemMemberObjList.Count;

            for (int i = 0; i < count; i++)
            {
                for (int j = 0; j < this.itemMemberObjList.Count; j++)
                {
                    bool flag = itemTeamDataList[i].cid == this.itemMemberObjList[j].cid;
                    if (flag)
                    {
                        bool isCaptain = itemTeamDataList[i].isCaptain;
                        if (isCaptain)
                        {
                            a3_currentTeamPanel.ItemMemberObj item = this.itemMemberObjList[j];
                            this.itemMemberObjList.RemoveAt(j);
                            this.itemMemberObjList.Insert(0, item);
                        }
                    }
                }
            }
            for (int k = 0; k < this.itemMemberObjList.Count; k++)
            {
                this.itemMemberObjList[k].root.SetSiblingIndex(k);
            }
        }
コード例 #5
0
            private void onBtnRefuse(GameObject go)
            {
                BaseProxy <FriendProxy> .getInstance().sendRefuseAddFriend(this.cid);

                UnityEngine.Object.Destroy(a3_beRequestFriend.mInstance.beRequestFriendList[this.cid].root.gameObject);
                a3_beRequestFriend.mInstance.beRequestFriendList.Remove(this.cid);
            }
コード例 #6
0
            public itemAward(a3_everydayLogin.itemAwardData iad) : base(iad.trSelf)
            {
                Transform trSelf = iad.trSelf;

                this._root = iad.trSelf;
                this._root.SetParent(iad.parent);
                this._root.localScale = Vector3.one;
                this._toggleImage     = base.getTransformByPath("btnGet/toggleImage");
                Transform transformByPath = base.getTransformByPath("btnGet/parent");

                this.canget_obj = base.getTransformByPath("btnGet/canget");
                this._dayNum    = iad.dayNum;
                this._dayCount  = iad.dayCount;
                this._toggleImage.gameObject.SetActive(iad.isChecked);
                bool flag = this._dayNum == this._dayCount;

                if (flag)
                {
                    this.canget_obj.gameObject.SetActive(true);
                    base.transform.FindChild("btnGet/this").gameObject.SetActive(true);
                    new BaseButton(this.canget_obj.transform, 1, 1).onClick = new Action <GameObject>(this.onBtnGetClick);
                    base.transform.FindChild("icon").gameObject.SetActive(true);
                    base.transform.FindChild("iconh").gameObject.SetActive(false);
                }
                else
                {
                    this.canget_obj.gameObject.SetActive(false);
                    base.transform.FindChild("btnGet/this").gameObject.SetActive(false);
                    base.transform.FindChild("icon").gameObject.SetActive(false);
                    base.transform.FindChild("iconh").gameObject.SetActive(true);
                }
                this._name = iad.name;
                this._num  = iad.awardnum;
                BaseProxy <welfareProxy> .getInstance().addEventListener(welfareProxy.SHOWDAILYRECHARGE, new Action <GameEvent>(this.onShowDaily));
            }
コード例 #7
0
        private void setTeamBuffTxt()
        {
            int count = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList.Count;

            bool flag = count >= 2;

            if (flag)
            {
                this.txtTeambuff.text = "同仇敌忾:攻击+" + count * 6 + "%";
            }
            else
            {
                this.txtTeambuff.text = "同仇敌忾:攻击+0%";
            }
            bool flag2 = BaseProxy <TeamProxy> .getInstance().MyTeamData != null;

            if (flag2)
            {
                bool flag3 = !BaseProxy <TeamProxy> .getInstance().MyTeamData.meIsCaptain;

                if (flag3)
                {
                    this.team_object_change.enabled = false;
                    this.team_object.transform.FindChild("Arrow").gameObject.SetActive(false);
                }
                else
                {
                    this.team_object_change.enabled = true;
                    this.team_object.transform.FindChild("Arrow").gameObject.SetActive(true);
                }
            }
        }
コード例 #8
0
        private void onUpdate_3008(float s)
        {
            this.t += s;
            bool flag = this.t >= 1f;

            if (flag)
            {
                this.time -= 1f;
                bool flag2 = a3_ranking.isshow;
                if (flag2)
                {
                    a3_ranking.isshow.setTime(this.time);
                }
                this.t = 0f;
            }
            bool flag3 = this.time <= 0f;

            if (flag3)
            {
                this.zhanli_frist  = true;
                this.lvl_frist     = true;
                this.chibang_frist = true;
                this.juntuan_frist = true;
                this.summon_frist  = true;
                BaseProxy <a3_rankingProxy> .getInstance().getTime();

                TickMgr.instance.removeTick(this.process_3008);
                this.process_3008 = null;
            }
        }
コード例 #9
0
ファイル: a3_teamPanel.cs プロジェクト: atom-chen/rongyaojt
            private void onBtnWatchClick(GameObject go)
            {
                worldmap.getmapid = false;
                BaseProxy <TeamProxy> .getInstance().SendWatchTeamInfo(this.tid);

                TeamProxy.WatchTeamId_limited = (uint)this.limited_dj;
            }
コード例 #10
0
        private void Demotion(GameObject go)
        {
            bool flag = this.selectedMember != null && this.gos.ContainsKey(this.selectedMember);

            if (flag)
            {
                A3_LegionMember a3_LegionMember = this.gos[this.selectedMember];
                bool            flag2           = a3_LegionMember.cid == (int)ModelBase <PlayerModel> .getInstance().cid;

                if (flag2)
                {
                    flytxt.flyUseContId("clan_7", null, 0);
                }
                else
                {
                    bool flag3 = a3_LegionMember.clanc == 1;
                    if (flag3)
                    {
                        flytxt.flyUseContId("clan_13", null, 0);
                    }
                    else
                    {
                        BaseProxy <A3_LegionProxy> .getInstance().PromotionOrDemotion((uint)a3_LegionMember.cid, 0u);
                    }
                }
            }
        }
コード例 #11
0
ファイル: a3_pkmodel.cs プロジェクト: atom-chen/rongyaojt
        private void onBtnClicks(GameObject go)
        {
            BaseProxy <a3_PkmodelProxy> .getInstance().sendProxy(int.Parse(go.name));

            InterfaceMgr.getInstance().close(InterfaceMgr.A3_PKMODEL);
            NewbieModel.getInstance().hide();
        }
コード例 #12
0
        private void PromoteToBeLeader(GameObject go)
        {
            bool flag = this.selectedMember != null && this.gos.ContainsKey(this.selectedMember);

            if (flag)
            {
                A3_LegionMember a3_LegionMember = this.gos[this.selectedMember];
                bool            flag2           = a3_LegionMember.cid == (int)ModelBase <PlayerModel> .getInstance().cid;

                if (flag2)
                {
                    flytxt.flyUseContId("clan_7", null, 0);
                }
                else
                {
                    bool flag3 = a3_LegionMember.clanc < 3;
                    if (flag3)
                    {
                        flytxt.flyUseContId("clan_15", null, 0);
                    }
                    else
                    {
                        BaseProxy <A3_LegionProxy> .getInstance().SendBeLeader((uint)a3_LegionMember.cid);
                    }
                }
            }
        }
コード例 #13
0
        private void onDeleteFriend(GameEvent e)
        {
            uint @uint = e.data["cid"]._uint;
            bool flag  = friendList._instance.friendDataDic.ContainsKey(@uint);

            if (flag)
            {
                UnityEngine.Object.Destroy(friendList._instance.friendDataDic[@uint].root.gameObject);
                bool flag2 = BaseProxy <FriendProxy> .getInstance().requestFriendListNoAgree.Contains(friendList._instance.friendDataDic[@uint].root.name);

                if (flag2)
                {
                    BaseProxy <FriendProxy> .getInstance().requestFriendListNoAgree.Remove(friendList._instance.friendDataDic[@uint].root.name);
                }
                friendList._instance.friendDataDic.Remove(@uint);
                this.friendLimit.text = friendList._instance.friendDataDic.Count.ToString() + "/" + (50u + 50u * ModelBase <PlayerModel> .getInstance().up_lvl);
                this.contains.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, (float)(60 * friendList._instance.friendDataDic.Count));
            }
            bool flag3 = friendList._instance.EnemyListDataDic.ContainsKey(@uint);

            if (flag3)
            {
                friendList._instance.EnemyListDataDic[@uint].itemEListPrefab.UpdatePos(-1);
            }
        }
コード例 #14
0
        public new void init()
        {
            friendList._instance = this;
            this.root            = toggleGropFriendBase.mTransform.FindChild("mainBody/myFriendsPanel");
            BaseButton baseButton  = new BaseButton(this.root.FindChild("right/bottom/btnClickOnceAddFriend"), 1, 1);
            BaseButton baseButton2 = new BaseButton(this.root.FindChild("right/bottom/btnAddFriend"), 1, 1);

            this.showOnlineFriends = this.root.FindChild("right/bottom/Toggle").GetComponent <Toggle>();
            this.showOnlineFriends.onValueChanged.AddListener(new UnityAction <bool>(this.onShowOnlineFriendsChanged));
            this.personalsPanel = this.root.FindChild("hidPanels/personalsPanel");
            BaseButton baseButton3 = new BaseButton(this.personalsPanel.FindChild("bottom/btnSelectAll"), 1, 1);

            this.btnAdd = new BaseButton(this.personalsPanel.FindChild("bottom/btnAdd"), 1, 1);
            BaseButton baseButton4 = new BaseButton(this.personalsPanel.FindChild("title/btnClose"), 1, 1);

            baseButton4.onClick  = new Action <GameObject>(this.onPersonalPanelClose);
            this.btnAdd.onClick  = new Action <GameObject>(this.onAddAllSelectClick);
            baseButton3.onClick  = new Action <GameObject>(this.onSelectAllClick);
            this.addFriendsPanel = this.root.FindChild("hidPanels/addFriendsPanel");
            BaseButton baseButton5 = new BaseButton(this.addFriendsPanel.transform.FindChild("bottom/btnAdd"), 1, 1);

            this.iptfAFPName = this.addFriendsPanel.transform.FindChild("main/InputField").GetComponent <InputField>();
            BaseButton baseButton6 = new BaseButton(this.addFriendsPanel.transform.FindChild("bottom/btnCancel"), 1, 1);
            BaseButton baseButton7 = new BaseButton(this.addFriendsPanel.transform.FindChild("title/btnClose"), 1, 1);

            this.friendLimit    = this.root.FindChild("right/main/body/firendsCount/count").GetComponent <Text>();
            this.containt       = this.root.FindChild("right/main/body/scroll/contains");
            this.contains       = this.containt.GetComponent <RectTransform>();
            this.addFriend      = this.root.FindChild("hidPanels/personalsPanel/main/scroll/containts");
            baseButton.onClick  = new Action <GameObject>(this.onBtnClickOnceAddFriendClick);
            baseButton2.onClick = new Action <GameObject>(this.onBtnAddFriendClick);
            baseButton5.onClick = new Action <GameObject>(this.onBtnAdd);
            baseButton6.onClick = new Action <GameObject>(this.onBtnAFPClose);
            baseButton7.onClick = new Action <GameObject>(this.onBtnAFPClose);
            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_FRIENDLIST, new Action <GameEvent>(this.onFriendList));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_BLACKLIST, new Action <GameEvent>(this.onBlackList));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_ENEMYLIST, new Action <GameEvent>(this.onEnemyList));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_RECOMMEND, new Action <GameEvent>(this.onRecommendList));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_DELETEFRIEND, new Action <GameEvent>(this.onDeleteFriend));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_RECEIVEADDBLACKLIST, new Action <GameEvent>(this.onReceiveAddBlackList));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_AGREEAPLYRFRIEND, new Action <GameEvent>(this.onAgreeAplyFriend));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_DELETEENEMY, new Action <GameEvent>(this.onDeleteEnemy));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_ENEMYPOSTION, new Action <GameEvent>(this.onEnemyPostion));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_DELETEBLACKLIST, new Action <GameEvent>(this.onDeleteBlackList));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_REMOVENEARYBY, new Action <GameEvent>(this.onRemoveNearybyLeave));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_ADDNEARYBY, new Action <GameEvent>(this.onAddNearbyPeople));

            BaseProxy <FriendProxy> .getInstance().addEventListener(FriendProxy.EVENT_REFRESHNEARYBY, new Action <GameEvent>(this.onFreshNearby));
        }
コード例 #15
0
        public override void onShowed()
        {
            bool flag = ModelBase <PlayerModel> .getInstance().last_time == 0 && BaseProxy <OffLineExpProxy> .getInstance().eqp.Count == 0;

            if (flag)
            {
                base.transform.FindChild("equp/image_con").gameObject.SetActive(true);
            }
            else
            {
                base.transform.FindChild("equp/image_con").gameObject.SetActive(false);
            }
            this.show_eqp();
            for (int i = 0; i < this.lBtn.Count; i++)
            {
                this.lBtn[i].addEvent();
                Text component = this.lBtn[i].transform.FindChild("Text_exp").GetComponent <Text>();
                component.text = "经验+" + this.offLineModel.BaseExp * (i + 1);
            }
            base.onShowed();
            this.vip_getexp_btn();
            BaseProxy <OffLineExpProxy> .getInstance().addEventListener(OffLineExpProxy.EVENT_OFFLINE_EXP_GET, new Action <GameEvent>(this.doGetExp));

            this.OnCostTextChange();
            this.OnTitleChange();
            OffLineModel expr_11B = this.offLineModel;

            expr_11B.OnOffLineTimeChange = (Action)Delegate.Combine(expr_11B.OnOffLineTimeChange, new Action(this.OnTitleChange));
            OffLineModel expr_142 = this.offLineModel;

            expr_142.OnBaseExpChange = (Action)Delegate.Combine(expr_142.OnBaseExpChange, new Action(this.OnCostTextChange));
        }
コード例 #16
0
            private void onBtnOKClick(GameObject go)
            {
                TickMgr.instance.removeTick(this.showTime);
                BaseProxy <TeamProxy> .getInstance().SendAffirmApply(this.m_itd.cid, true);

                UnityEngine.Object.Destroy(this.m_go);
            }
コード例 #17
0
        public void onBtnGetClick(GameObject go)
        {
            bool flag = 7u != this.day_count + 1u;

            if (flag)
            {
                flytxt.instance.fly("日期未到无法领取.", 0, default(Color), null);
            }
            else
            {
                bool flag2 = 7u == this.day_count;
                if (flag2)
                {
                    flytxt.instance.fly("奖励已领取.", 0, default(Color), null);
                }
                else
                {
                    bool flag3 = a3_new_pet.instance != null;
                    if (flag3)
                    {
                        a3_new_pet.instance.openEveryLogin = false;
                    }
                    this.open = false;
                    BaseProxy <welfareProxy> .getInstance().sendWelfare(welfareProxy.ActiveType.accumulateLogin, 4294967295u);
                }
            }
        }
コード例 #18
0
ファイル: BattleProxy.cs プロジェクト: atom-chen/rongyaojt
        private void on_single_skill_res(Variant msgData)
        {
            debug.Log("UUUUUUU" + msgData.dump());
            uint     @uint = msgData["to_iid"]._uint;
            uint     uint2 = msgData["frm_iid"]._uint;
            BaseRole role  = RoleMgr._instance.getRole(@uint);
            BaseRole role2 = RoleMgr._instance.getRole(uint2);
            bool     flag  = !msgData.ContainsKey("states");

            if (!flag)
            {
                bool flag2 = role != null && role.m_isMain;
                if (flag2)
                {
                    Variant variant = msgData["states"];
                    bool    flag3   = msgData["sid"];
                    if (flag3)
                    {
                        int type = msgData["sid"];
                        FightText.play(FightText.BUFF_TEXT, role.getHeadPos(), 0, false, type);
                    }
                    ModelBase <A3_BuffModel> .getInstance().addBuffList(variant);

                    bool flag4 = variant["id"] == 10000;
                    if (flag4)
                    {
                        BaseProxy <A3_ActiveProxy> .getInstance().dispatchEvent(GameEvent.Create(A3_ActiveProxy.EVENT_ONBLESS, this, variant, false));
                    }
                }
                else
                {
                    ModelBase <A3_BuffModel> .getInstance().addOtherBuff(role, msgData["states"]["id"]);
                }
                bool flag5 = msgData.ContainsKey("states");
                if (flag5)
                {
                    SXML   sXML    = XMLMgr.instance.GetSXML("skill.state", "id==" + msgData["states"]["id"]);
                    string @string = sXML.getString("effect");
                    bool   flag6   = role2 is MonsterRole && (role2 as MonsterRole).issummon && @uint == uint2;
                    if (flag6)
                    {
                        role2.PlaySkill(msgData["sid"]);
                    }
                    bool flag7 = @string != "null";
                    if (flag7)
                    {
                        float      @float     = sXML.getFloat("last");
                        GameObject original   = Resources.Load <GameObject>(@string);
                        GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original);
                        gameObject.transform.SetParent(role.m_curModel, false);
                        UnityEngine.Object.Destroy(gameObject, @float);
                        bool flag8 = sXML.getFloat("head") > 0f;
                        if (flag8)
                        {
                            gameObject.transform.localPosition = new Vector3(0f, role.headOffset_half.y / 2f + sXML.getFloat("head"), 0f);
                        }
                    }
                }
            }
        }
コード例 #19
0
        public LvlUpAwardPanel(Transform trans) : base(trans)
        {
            this.root           = trans;
            this.lvlUpAwardsDic = new Dictionary <uint, awardCenterItem4zhuan>();
            this.itemsParent    = this.root.FindChild("awardItems/content");
            List <WelfareModel.itemWelfareData> levelReward = ModelBase <WelfareModel> .getInstance().getLevelReward();

            foreach (WelfareModel.itemWelfareData current in levelReward)
            {
                WelfareModel.itemWelfareData iwd = current;
                iwd.desc = this.strDesc;
                a3_ItemData itemDataById = ModelBase <a3_BagModel> .getInstance().getItemDataById(current.itemId);

                GameObject gameObject = IconImageMgr.getInstance().creatItemAwardCenterIcon(itemDataById);
                gameObject.name = "itemWelfare";
                gameObject.transform.SetParent(this.itemsParent);
                gameObject.transform.localScale = Vector3.one;
                awardCenterItem4zhuan value = new awardCenterItem4zhuan(gameObject.transform, iwd);
                uint id = current.itemId;
                new BaseButton(gameObject.transform.FindChild("icon"), 1, 1).onClick = delegate(GameObject oo)
                {
                    bool flag = a3_awardCenter.instan;
                    if (flag)
                    {
                        a3_awardCenter.instan.showtip(id);
                    }
                };
                this.lvlUpAwardsDic.Add(current.id, value);
            }
            this.itemsParent.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, (float)(100 * (this.lvlUpAwardsDic.Count + 2)));
            BaseProxy <welfareProxy> .getInstance().addEventListener(welfareProxy.UPLEVELAWARD, new Action <GameEvent>(this.onUpLevelAward));
        }
コード例 #20
0
        public PayPanel(Transform trans) : base(trans)
        {
            this.root = trans;
            this.consumptionAwardsDic = new Dictionary <uint, awardCenterItem4Consumption>();
            this.itemsParent          = this.root.FindChild("awardItems/content");
            List <WelfareModel.itemWelfareData> cumulateConsumption = ModelBase <WelfareModel> .getInstance().getCumulateConsumption();

            foreach (WelfareModel.itemWelfareData current in cumulateConsumption)
            {
                WelfareModel.itemWelfareData iwd = current;
                iwd.desc = this.strDesc;
                a3_ItemData itemDataById = ModelBase <a3_BagModel> .getInstance().getItemDataById(current.itemId);

                iwd.awardName = itemDataById.item_name;
                GameObject gameObject = IconImageMgr.getInstance().creatItemAwardCenterIcon(itemDataById);
                gameObject.name = "itemWelfare";
                gameObject.transform.SetParent(this.itemsParent);
                gameObject.transform.localScale = Vector3.one;
                uint id = current.itemId;
                new BaseButton(gameObject.transform.FindChild("icon"), 1, 1).onClick = delegate(GameObject oo)
                {
                    bool flag = a3_awardCenter.instan;
                    if (flag)
                    {
                        a3_awardCenter.instan.showtip(id);
                    }
                };
                awardCenterItem4Consumption value = new awardCenterItem4Consumption(gameObject.transform, iwd);
                this.consumptionAwardsDic.Add(current.id, value);
            }
            this.itemsParent.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, (float)(100 * (this.consumptionAwardsDic.Count + 2)));
            BaseProxy <welfareProxy> .getInstance().addEventListener(welfareProxy.ACCUMULATECONSUMPTION, new Action <GameEvent>(this.onAccumulateConsumption));
        }
コード例 #21
0
        private void onChangeTeamInfo(GameEvent e)
        {
            bool meIsCaptain = BaseProxy <TeamProxy> .getInstance().MyTeamData.meIsCaptain;

            if (meIsCaptain)
            {
                this.togInvite.gameObject.SetActive(true);
                this.togJoin.gameObject.SetActive(true);
                bool flag = e.data.ContainsKey("memb_inv") && this.togInvite.isOn != BaseProxy <TeamProxy> .getInstance().MyTeamData.membInv;

                if (flag)
                {
                    this.togInvite.isOn = BaseProxy <TeamProxy> .getInstance().MyTeamData.membInv;
                }
                bool flag2 = e.data.ContainsKey("dir_join") && this.togJoin.isOn != BaseProxy <TeamProxy> .getInstance().MyTeamData.dirJoin;

                if (flag2)
                {
                    this.togJoin.isOn = BaseProxy <TeamProxy> .getInstance().MyTeamData.dirJoin;
                }
            }
            else
            {
                bool membInv = BaseProxy <TeamProxy> .getInstance().MyTeamData.membInv;

                int count = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList.Count;

                for (int i = count; i < this.itemMemberObjList.Count; i++)
                {
                    this.itemMemberObjList[i].ClearInfo(membInv);
                }
            }
        }
コード例 #22
0
        public override void onShowed()
        {
            base.onShowed();
            BaseProxy <A3_LegionProxy> .getInstance().addEventListener(15u, new Action <GameEvent>(this.RefreshDiary));

            BaseProxy <A3_LegionProxy> .getInstance().SendGetDiary();
        }
コード例 #23
0
        private void NoticeOnlineStateChange()
        {
            int count = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList.Count;

            List <ItemTeamData> itemTeamDataList = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList;

            int count2 = this.itemMemberObjList.Count;

            for (int i = 0; i < count; i++)
            {
                for (int j = 0; j < count2; j++)
                {
                    bool flag = itemTeamDataList[i].cid == this.itemMemberObjList[j].cid;
                    if (flag)
                    {
                        this.itemMemberObjList[j].SetInfo(itemTeamDataList[i], BaseProxy <TeamProxy> .getInstance().MyTeamData.meIsCaptain);
                        a3_currentTeamPanel.ItemMemberObj item = this.itemMemberObjList[j];
                        this.itemMemberObjList.RemoveAt(j);
                        this.itemMemberObjList.Insert(i, item);
                        this.itemMemberObjList[i].root.SetSiblingIndex(i);
                    }
                }
            }
            this.setTeamBuffTxt();
        }
コード例 #24
0
        private void onBtnCancleClick(GameObject go)
        {
            BaseProxy <TeamProxy> .getInstance().SendAffirmInvite(this.m_itd.cid, this.m_itd.teamId, false);

            TickMgr.instance.removeTick(this.showTime);
            InterfaceMgr.getInstance().close(InterfaceMgr.A3_TEAMINVITEDPANEL);
        }
コード例 #25
0
        public void useItemByTpid(uint tpid, int num)
        {
            a3_ItemData itemDataById = this.getItemDataById(tpid);
            bool        flag         = itemDataById.use_type < 0;

            if (flag)
            {
                flytxt.instance.fly("该物品不能使用!", 0, default(Color), null);
            }
            else
            {
                int  itemNumByTpid = this.getItemNumByTpid(tpid);
                bool flag2         = itemNumByTpid < num;
                if (flag2)
                {
                    flytxt.instance.fly("物品数量不足!", 0, default(Color), null);
                }
                else
                {
                    List <a3_BagItemData> list = new List <a3_BagItemData>();
                    int num2 = 999999;
                    foreach (a3_BagItemData current in this.Items.Values)
                    {
                        bool flag3 = current.tpid == tpid;
                        if (flag3)
                        {
                            bool flag4 = current.num < num2;
                            if (flag4)
                            {
                                num2 = current.num;
                                list.Insert(0, current);
                            }
                            else
                            {
                                list.Add(current);
                            }
                        }
                    }
                    int num3 = num;
                    foreach (a3_BagItemData current2 in list)
                    {
                        bool flag5 = current2.num > num3;
                        if (flag5)
                        {
                            BaseProxy <BagProxy> .getInstance().sendUseItems(current2.id, num3);

                            break;
                        }
                        BaseProxy <BagProxy> .getInstance().sendUseItems(current2.id, current2.num);

                        num3 = num - current2.num;
                    }
                    A3_BeStronger expr_17D = A3_BeStronger.Instance;
                    if (expr_17D != null)
                    {
                        expr_17D.CheckUpItem();
                    }
                }
            }
        }
コード例 #26
0
        private void onUpdateEnmeyPostion(float s)
        {
            bool flag = itemEnemyListPrefab.txtPos == null || itemEnemyListPrefab.txtTimer == null;

            if (!flag)
            {
                this.times += s;
                bool flag2 = this.times >= 1f;
                if (flag2)
                {
                    this.i--;
                    bool flag3 = this.i <= 0;
                    if (flag3)
                    {
                        this.i = 0;
                        bool flag4 = !BaseProxy <FriendProxy> .getInstance().FriendDataList.ContainsKey(this.cid);

                        if (flag4)
                        {
                            itemEnemyListPrefab.txtPos.text = "未知";
                        }
                        itemEnemyListPrefab.txtTimer.text = "";
                        this.isCdNow = false;
                        TickMgr.instance.removeTick(this.postionTime);
                        this.postionTime = null;
                    }
                    else
                    {
                        this.isCdNow = true;
                        itemEnemyListPrefab.txtTimer.text = "(" + this.i + ")";
                    }
                    this.times = 0f;
                }
            }
        }
コード例 #27
0
ファイル: a3_pet_skin.cs プロジェクト: atom-chen/rongyaojt
        private void OnFeed(GameObject go)
        {
            int itemNumByTpid = ModelBase <a3_BagModel> .getInstance().getItemNumByTpid(this.feedid);

            bool flag = itemNumByTpid > 0;

            if (flag)
            {
                bool flag2 = itemNumByTpid == 1;
                if (flag2)
                {
                    bool flag3 = !ModelBase <A3_PetModel> .getInstance().Auto_buy;

                    if (flag3)
                    {
                    }
                }
                BaseProxy <A3_PetProxy> .getInstance().Feed();
            }
            else
            {
                a3_store.itm_tpid = this.feedid;
                InterfaceMgr.getInstance().open(InterfaceMgr.A3_STORE, null, false);
            }
        }
コード例 #28
0
        public override void init()
        {
            a3_hudun._instance        = this;
            this.btnClose             = new BaseButton(base.getTransformByPath("btn_close"), 1, 1);
            this.btnClose.onClick     = new Action <GameObject>(this.OnCLoseClick);
            this.btnUpLevel           = new BaseButton(base.getTransformByPath("ig_bg1/qianghua"), 1, 1);
            this.btnUpLevel.onClick   = new Action <GameObject>(this.UpLevel);
            this.btnAddEnergy         = new BaseButton(base.getTransformByPath("ig_bg1/chongneng"), 1, 1);
            this.btnAddEnergy.onClick = new Action <GameObject>(this.AddEnergy);
            new BaseButton(base.getTransformByPath("ig_bg1/help"), 1, 1).onClick        = new Action <GameObject>(this.onHelp);
            new BaseButton(base.getTransformByPath("ig_bg1/tishi/close"), 1, 1).onClick = new Action <GameObject>(this.close_tishi);
            this.huDunLevel = base.getComponentByPath <Text>("ig_bg1/top/topImage/Text");
            this.huDunCount = base.getComponentByPath <Text>("ig_bg1/top/shuzhi");
            this.mjCount    = base.getComponentByPath <Text>("ig_bg1/mjText/count");
            this.isAuto     = base.getComponentByPath <Toggle>("ig_bg1/Toggle");
            this.bar        = base.getComponentByPath <Image>("ig_bg1/bar/bar_n");
            this.isAuto.onValueChanged.AddListener(new UnityAction <bool>(this.add_isAuto));
            this.HudunModel = ModelBase <HudunModel> .getInstance();

            this.playerModel = ModelBase <PlayerModel> .getInstance();

            this.hudunProxy = BaseProxy <A3_HudunProxy> .getInstance();

            this.bagModel = ModelBase <a3_BagModel> .getInstance();

            this.hudunProxy.sendinfo(0);
            base.transform.FindChild("ig_bg_bg").gameObject.SetActive(false);
            this.updata_hd(this.HudunModel.NowCount);
            base.init();
        }
コード例 #29
0
 private void onThisClick(bool b)
 {
     if (b)
     {
         BaseProxy <ChangeLineProxy> .getInstance().mSelectedLine = this._line;
     }
 }
コード例 #30
0
        private void onRecommendList(GameEvent e)
        {
            int num = 0;

            this.RecommendListDataDic.Clear();
            float num2 = 60f;
            List <itemFriendData> recommendDataList = BaseProxy <FriendProxy> .getInstance().RecommendDataList;

            recommendDataList.Sort(new Comparison <itemFriendData>(this.SortItemFriendData));
            foreach (itemFriendData current in recommendDataList)
            {
                num++;
                itemFriendData itemFriendData = current;
                itemFriendData.itemECListPrefab = new itemRecommendListPrefab();
                itemFriendData.itemECListPrefab.init();
                Transform root;
                itemFriendData.itemECListPrefab.show(current, out root);
                itemFriendData.root = root;
                this.RecommendListDataDic[current.cid] = itemFriendData;
                bool flag = num % 2 == 0;
                if (flag)
                {
                    itemFriendData.itemECListPrefab.root.transform.FindChild("bg2").gameObject.SetActive(false);
                }
                bool flag2 = num2 == 0f;
                if (flag2)
                {
                    num2 = itemFriendData.itemECListPrefab.root.transform.FindChild("Toggle/Background").GetComponent <RectTransform>().sizeDelta.y;
                }
            }
            this.btnAdd.transform.GetComponent <Button>().interactable = true;
            RectTransform component = recommendList._instance.containt.GetComponent <RectTransform>();

            component.sizeDelta = new Vector2(component.sizeDelta.x, num2 * (float)this.RecommendListDataDic.Count);
        }