예제 #1
0
        //TODO:初始化快捷键上面的技能数据,不包含等级等数据
        public SkillFullInfo(int skId, int index)
        {
            var sinfo = ShortCutInfo.CreateBuilder();

            sinfo.Index  = index;
            sinfo.BaseId = skId;
            sinfo.Type   = 0;
            shortInfo    = sinfo.BuildPartial();

            skillData = Util.GetSkillData(skId, 1);
        }
예제 #2
0
        public IEnumerator SetSkillShortCut(int skId, int index)
        {
            var packet = new KBEngine.PacketHolder();
            var b      = CGModifyShortcutsInfo.CreateBuilder();

            b.IdAdd = true;
            var shortInfo = ShortCutInfo.CreateBuilder();

            shortInfo.Index   = index;
            shortInfo.IndexId = index;
            shortInfo.BaseId  = skId;
            shortInfo.Type    = 0;
            b.SetShortCutInfo(shortInfo);

            yield return(StartCoroutine(KBEngine.Bundle.sendSimple(this, b, packet)));

            //var ret = packet.packet.protoBody as GCModifyShortcutsInfo;
            SetShortSkillData(skId, index);
        }
예제 #3
0
        public static void GetShortCuts(KBEngine.Packet packet)
        {
            var au    = GCLoadShortcutsInfo.CreateBuilder();
            var pinfo = ServerData.Instance.playerInfo;

            if (pinfo.HasSkill)
            {
                var defaultSlot = GetShortCutsInfo();
                int ind         = 0;
                foreach (var sk in defaultSlot)
                {
                    if (sk != 0)
                    {
                        var sh = ShortCutInfo.CreateBuilder();
                        sh.Index  = ind;
                        sh.BaseId = sk;
                        au.AddShortCutInfo(sh);
                    }
                    ind++;
                }
            }
            ServerBundle.SendImmediate(au, packet.flowId);
        }
예제 #4
0
        /// <summary>
        /// 默认前4种技能占用 1 2 3 4 的槽
        /// 当有技能设置了槽 则使用该技能占用 特定槽
        /// </summary>
        static void PushSkillShortcutsInfo()
        {
            var au    = GCPushShortcutsInfo.CreateBuilder();
            var pinfo = ServerData.Instance.playerInfo;

            if (pinfo.HasSkill)
            {
                var defaultSlot = GetShortCutsInfo();
                var ind         = 0;
                foreach (var sk in defaultSlot)
                {
                    if (sk != 0)
                    {
                        var sh = ShortCutInfo.CreateBuilder();
                        sh.Index  = ind;
                        sh.BaseId = sk;
                        au.AddShortCutInfo(sh);
                    }
                    ind++;
                }
            }
            ServerBundle.SendImmediatePush(au);
        }