/// <summary>
        /// 释放引导技能 guidState : 1 按下,2 改变 ,3 抬起
        /// </summary>
        private void ToCastGuideSkill(SkillData skillData, int guidState)
        {
            SkillRPCNet skillRPC = m_Context.GetObject <SkillRPCNet>();

            if (skillData.ByteBuffer == null || skillRPC == null)
            {
                return;
            }

            uint entityId = (uint)m_ISpacecraftSkillProperty.EntityId();
            uint skillId  = (uint)skillData.Id;

            switch (guidState)
            {
            case 1:     //按下
            {
                Leyoutech.Utility.DebugUtility.Log("引导技能", " 按下");


                GuideSkill guideSkill = new GuideSkill();
                guideSkill.GuideSkill_          = new global::Crucis.Protocol.SkillSelectTargetInfo();
                guideSkill.GuideSkill_.CasterId = (uint)m_ISpacecraftSkillProperty.EntityId();
                guideSkill.GuideSkill_.SkillId  = (uint)skillData.Id;
                Vector3 direction = Vector3.zero;
                guideSkill.GuideSkill_.TargetList.Add(m_ISpacecraftSkillProperty.GetPerceptronTarget().GetCurrentTargetInfos(false, out direction, true, skillData.BaseData.Value.TagercalculationType));
                if (guideSkill.GuideSkill_.TargetList.Count == 0)
                {
                    Leyoutech.Utility.DebugUtility.Log(" 引导技能", "------%%%%%%%----按下 :Null ");
                }

                for (int i = 0; i < guideSkill.GuideSkill_.TargetList.Count; i++)
                {
                    Leyoutech.Utility.DebugUtility.Log(" 引导技能", "------%%%%%%%----按下 :" + guideSkill.GuideSkill_.TargetList[i].TargetId);
                }


                MainCameraComponent mainCamComponent = m_Context.GetObject <MainCameraComponent>();
                float d = skillData.BaseData.Value.MaxDistance;        // * SceneController.SKILL_PRECISION;
                Crucis.Protocol.Vec4 vec4 = GetCameraQuaternion(mainCamComponent, direction, d);
                guideSkill.GuideSkill_.Quat = vec4;
                skillRPC.CreatListenerCastGuideSkill(entityId, skillId);
                skillRPC.CastGuideSkillWright(entityId, skillId, guideSkill);
            }
            break;

            case 2:    //目标改变
            {
                Leyoutech.Utility.DebugUtility.Log(" 引导技能", "目标改变");

                GuideSkill guideSkill = new GuideSkill();
                guideSkill.ChangeTarget          = new global::Crucis.Protocol.ChangeGuideSkillTargetInfo();
                guideSkill.ChangeTarget.CasterId = (uint)m_ISpacecraftSkillProperty.EntityId();
                guideSkill.ChangeTarget.SkillId  = (uint)skillData.Id;
                Vector3 direction = Vector3.zero;
                guideSkill.ChangeTarget.TargetList.Add(m_ISpacecraftSkillProperty.GetPerceptronTarget().GetCurrentTargetInfos(false, out direction, false));

                if (guideSkill.ChangeTarget.TargetList.Count == 0)
                {
                    Leyoutech.Utility.DebugUtility.Log(" 引导技能", "------%%%%%%%----目标改变 :Null ");
                }

                for (int i = 0; i < guideSkill.ChangeTarget.TargetList.Count; i++)
                {
                    Leyoutech.Utility.DebugUtility.Log(" 引导技能", "------%%%%%%%----目标改变 :" + guideSkill.ChangeTarget.TargetList[i].TargetId);
                }


                MainCameraComponent mainCamComponent = m_Context.GetObject <MainCameraComponent>();
                float d = skillData.BaseData.Value.MaxDistance;        // * SceneController.SKILL_PRECISION;
                Crucis.Protocol.Vec4 vec4 = GetCameraQuaternion(mainCamComponent, direction, d);
                guideSkill.ChangeTarget.Quat = vec4;
                skillRPC.CastGuideSkillWright(entityId, skillId, guideSkill);
            }
            break;

            case 3:    //抬起
            {
                Leyoutech.Utility.DebugUtility.Log("引导技能", " 抬起");

                GuideSkill guideSkill = new GuideSkill();
                guideSkill.GuideEnd          = new global::Crucis.Protocol.GuideSkillEnd();
                guideSkill.GuideEnd.CasterId = (uint)m_ISpacecraftSkillProperty.EntityId();
                guideSkill.GuideEnd.SkillId  = (uint)skillData.Id;
                skillRPC.CastGuideSkillWright(entityId, skillId, guideSkill);
            }
            break;

            default:
                break;
            }
        }
Beispiel #2
0
    /// <summary>
    /// 引导技能流写入
    /// </summary>
    /// <param name="entityId"></param>
    /// <param name="skill_id_"></param>
    /// <param name="request"></param>
    public void CastGuideSkillWright(uint entityId, uint skill_id_, GuideSkill request)
    {
        Leyoutech.Utility.DebugUtility.Log("SkillRPCNet", "引导技能流写入" + this.GetHashCode());

        m_CastGuideSkillStream?.Wright(request);
    }