Exemplo n.º 1
0
 public void SetReward(ushort rewardID, CFriendRecruit.RewardState state)
 {
     CFriendRecruit.RecruitReward reward = this.GetReward(rewardID);
     if (reward == null)
     {
         this.RewardList.Add(new CFriendRecruit.RecruitReward(rewardID, state));
     }
     else
     {
         reward.state = state;
     }
     Singleton <EventRouter> .GetInstance().BroadCastEvent("FRDataChange");
 }
Exemplo n.º 2
0
 public void SetZhaoMuZheRewardData(COMDT_FRIEND_INFO friendData, ushort rewardID, CFriendRecruit.RewardState state)
 {
     CFriendRecruit.RecruitData zhaoMuZhe = this.GetZhaoMuZhe(friendData.stUin.ullUid, friendData.stUin.dwLogicWorldId);
     if (zhaoMuZhe != null)
     {
         zhaoMuZhe.SetReward(rewardID, state);
     }
     else
     {
         CFriendRecruit.RecruitData validRecruitData = this.GetValidRecruitData();
         if (validRecruitData != null)
         {
             validRecruitData.userInfo = friendData;
             validRecruitData.SetReward(rewardID, state);
         }
     }
 }
Exemplo n.º 3
0
 public RecruitReward(ushort rewardId, CFriendRecruit.RewardState state)
 {
     this.rewardID = rewardId;
     this.state    = state;
     this.cfg      = Singleton <CFriendContoller> .get_instance().model.friendRecruit.GetCfgReward(rewardId);
 }
        public void Show_Award(GameObject node, ulong ullUid, uint dwLogicWorldId, COM_RECRUITMENT_TYPE type, ushort rewardID, ResRecruitmentReward cfg, CFriendRecruit.RewardState state, CUIFormScript formScript, bool bShowLevelNum = true)
        {
            Image          component  = node.transform.FindChild("box/icon").GetComponent <Image>();
            CUIEventScript component2 = component.GetComponent <CUIEventScript>();

            component2.m_onDownEventParams.tagUInt            = (uint)rewardID;
            component2.m_onDownEventParams.commonUInt64Param1 = ullUid;
            component2.m_onDownEventParams.taskId             = dwLogicWorldId;
            component2.m_onDownEventParams.weakGuideId        = (uint)((byte)type);
            if (cfg == null)
            {
                return;
            }
            component.SetSprite(CUIUtility.s_Sprite_Dynamic_Icon_Dir + cfg.szIcon, formScript, true, false, false, false);
            if (bShowLevelNum)
            {
                Text component3 = node.transform.FindChild("box/num").GetComponent <Text>();
                if (cfg.dwLevel == 1u)
                {
                    component3.set_text(Singleton <CTextManager> .instance.GetText("Recruit_Login"));
                }
                else
                {
                    component3.set_text(string.Format("Lv.{0}", cfg.dwLevel));
                }
            }
            bool  bActive    = state == CFriendRecruit.RewardState.Getted;
            Image component4 = node.transform.FindChild("box/mark").GetComponent <Image>();

            component4.gameObject.CustomSetActive(bActive);
            GameObject obj = Utility.FindChild(node, "BaoShi");

            obj.CustomSetActive(state == CFriendRecruit.RewardState.Getted || state == CFriendRecruit.RewardState.Keling);
            bool       flag       = state == CFriendRecruit.RewardState.Keling;
            GameObject gameObject = node.transform.FindChild("box/effect").gameObject;

            gameObject.CustomSetActive(flag);
            node.transform.FindChild("box").GetComponent <Animation>().enabled = flag;
        }
Exemplo n.º 5
0
        public void Show_Award(GameObject node, ulong ullUid, uint dwLogicWorldId, COM_RECRUITMENT_TYPE type, ushort rewardID, CFriendRecruit.RewardState state, CUIFormScript formScript, bool bShowLevelNum = true)
        {
            Image          component  = node.transform.FindChild("box/icon").GetComponent <Image>();
            CUIEventScript component2 = component.GetComponent <CUIEventScript>();

            component2.m_onDownEventParams.tagUInt            = (uint)rewardID;
            component2.m_onDownEventParams.commonUInt64Param1 = ullUid;
            component2.m_onDownEventParams.taskId             = dwLogicWorldId;
            component2.m_onDownEventParams.weakGuideId        = (uint)type;
            CFriendRecruit friendRecruit = Singleton <CFriendContoller> .get_instance().model.friendRecruit;

            ResRecruitmentReward cfgReward = friendRecruit.GetCfgReward(rewardID);

            if (cfgReward == null)
            {
                return;
            }
            component.SetSprite(CUIUtility.s_Sprite_Dynamic_Icon_Dir + cfgReward.szIcon, formScript, true, false, false, false);
            if (bShowLevelNum)
            {
                Text component3 = node.transform.FindChild("box/num").GetComponent <Text>();
                component3.text = cfgReward.dwLevel.ToString();
            }
            bool  flag       = state == CFriendRecruit.RewardState.Getted;
            Image component4 = node.transform.FindChild("box/mark").GetComponent <Image>();

            component4.gameObject.CustomSetActive(flag);
            Transform transform = node.transform.FindChild("icon");

            if (transform != null)
            {
                this.ShowBar(transform.gameObject, flag);
            }
            bool       flag2      = state == CFriendRecruit.RewardState.Keling;
            GameObject gameObject = node.transform.FindChild("box/effect").gameObject;

            gameObject.CustomSetActive(flag2);
            node.transform.FindChild("box").GetComponent <Animation>().enabled = flag2;
        }