Ejemplo n.º 1
0
        /// <summary>
        /// 选择召唤师技能的协议
        /// </summary>
        /// <param name="response"></param>
        private void HandleRoomSelectHeroSkillS2C(BufferEntity response)
        {
            RoomSelectHeroSkillS2C s2cMSG = ProtobufHelper.FromBytes <RoomSelectHeroSkillS2C>(response.proto);

            if (s2cMSG.GridID == 0)
            {
                rolesDIC[s2cMSG.RolesID].transform.Find("Hero_SkillA").GetComponent <Image>().sprite
                    = ResManager.Instance.LoadGeneralSkill(s2cMSG.SkillID);

                if (RoomCtrl.Instance.CheckIsSelfRoles(s2cMSG.RolesID))
                {
                    SkillA.sprite = ResManager.Instance.LoadGeneralSkill(s2cMSG.SkillID);
                    SkillInfo.gameObject.SetActive(false);
                }
            }
            else
            {
                rolesDIC[s2cMSG.RolesID].transform.Find("Hero_SkillB").GetComponent <Image>().sprite
                    = ResManager.Instance.LoadGeneralSkill(s2cMSG.SkillID);

                if (RoomCtrl.Instance.CheckIsSelfRoles(s2cMSG.RolesID))
                {
                    SkillB.sprite = ResManager.Instance.LoadGeneralSkill(s2cMSG.SkillID);
                    //关闭技能选择面板
                    SkillInfo.gameObject.SetActive(false);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 选择英雄
        /// </summary>
        /// <param name="request"></param>
        private void HandleRoomSelectHeroSkillC2S(BufferEntity request)
        {
            RoomSelectHeroSkillC2S c2sMSG = ProtobufHelper.FromBytes <RoomSelectHeroSkillC2S>(request.proto);
            RoomSelectHeroSkillS2C s2cMSG = new RoomSelectHeroSkillS2C();

            s2cMSG.SkillID = c2sMSG.SkillID;
            s2cMSG.GridID  = c2sMSG.GridID;
            PlayerEntity p = PlayerManager.GetPlayerEntityFromSession(request.session);

            s2cMSG.RolesID = p.rolesInfo.RolesID;

            //缓存角色技能
            p.roomEntity.UpdateSKill(s2cMSG.RolesID, s2cMSG.SkillID, s2cMSG.GridID);

            p.roomEntity.Broadcast(request.messageID, s2cMSG);
        }