예제 #1
0
        /// <summary>
        /// 本地使用技能同时通知代理
        /// 绕过LogicCommand 本地执行不需要LogicCommand队列
        /// </summary>
        /// <param name="skillData">Skill data.</param>
        static void UseSkill(SkillData skillData)
        {
            Log.Sys("UseSkill: " + skillData.SkillName + " lev " + skillData.Level);
            ObjectManager.objectManager.GetMyPlayer().GetComponent <MyAnimationEvent>().OnSkill(skillData);

            NetDateInterface.FastMoveAndPos();
            NetDateInterface.FastUseSkill(skillData.Id, skillData.Level);
        }
예제 #2
0
        /// <summary>
        /// 和使用普通技能一样
        /// </summary>
        public void PlayerAttack()
        {
            //连击3招
            var meId      = ObjectManager.objectManager.GetMyAttr().GetNetView().GetLocalId();
            var skillInfo = ObjectManager.objectManager.GetMyPlayer().GetComponent <SkillInfoComponent>();

            skillInfo.SetDefaultActive();

            var skillData = skillInfo.GetActiveSkill().skillData;
            var curState  = ObjectManager.objectManager.GetMyPlayer().GetComponent <AIBase>().GetAI().state;

            //无动作技能释放 不用检测
            if (string.IsNullOrEmpty(skillData.AnimationName))
            {
            }
            else
            {
                //当前状态不能使用技能 或者已经在技能状态了不能连续点击
                if (curState != null)
                {
                    var ret = curState.CanChangeState(AIStateEnum.CAST_SKILL);
                    if (!ret)
                    {
                        return;
                    }
                }
            }

            if (curState != null && curState.type == AIStateEnum.DEAD)
            {
                Util.ShowMsg("死亡不能使用技能");
                return;
            }
            //默认技能上次使用频率控制

            MyEventSystem.PushLocalEventStatic(meId, MyEvent.EventType.UseSkill);
            var skillId = skillInfo.GetActiveSkill().skillId;

            /*
             * //如果身上有Buff则调整默认技能的ID
             * if (!NetworkUtil.IsNet())
             * {
             *  ObjectManager.objectManager.GetMyPlayer().GetComponent<MyAnimationEvent>().OnSkill(skillData);
             * }
             *
             * if (skillInfo.GetActiveSkill().skillData.skillConfig.stopMove)
             * {
             *  //短时间限制自己移动
             *  var me = ObjectManager.objectManager.GetMyPlayer();
             *  GameInterface_Skill.AddSkillBuff(me.gameObject, "StopMoveBuff", Vector3.zero);
             * }
             *
             * NetDateInterface.FastMoveAndPos();
             */

            NetDateInterface.FastUseSkill(skillId, skillData.Level);
        }
예제 #3
0
        /// <summary>
        /// 和使用普通技能一样
        /// </summary>
        public void PlayerAttack()
        {
            //连击3招
            var skillId   = ObjectManager.objectManager.GetMyPlayer().GetComponent <SkillInfoComponent> ().GetDefaultSkillId();
            var skillData = Util.GetSkillData(skillId, 1);

            ObjectManager.objectManager.GetMyPlayer().GetComponent <MyAnimationEvent>().OnSkill(skillData);

            NetDateInterface.FastMoveAndPos();
            NetDateInterface.FastUseSkill(skillId, skillData.Level);
        }