少年修仙传客户端代码仓库
client_Hale
2019-02-28 67751728cc944d5e5a1af677cfeaa5a59f8fb68a
6282 【前端】【2.0】封魔之地的飞跃功能 同步
3个文件已修改
84 ■■■■ 已修改文件
Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB414_tagMCMoveByType.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GA_Player.cs 70 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/MapEditor/Game/TransferGroup.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB414_tagMCMoveByType.cs
@@ -8,5 +8,13 @@
        {
            return;
        }
        var _player = GAMgr.Instance.GetBySID(package.ID) as GA_Player;
        if (_player == null)
        {
            return;
        }
        _player.StartFly(package.PosX, package.PosY);
    }
}
Fight/GameActor/GA_Player.cs
@@ -172,8 +172,7 @@
        ActorInfo.Hp = m_H0434.HP;
        ActorInfo.MaxHp = m_H0434.MaxHP;
        if ((package != null && package.socketType == ServerType.CrossSever && CrossServerUtility.IsCrossServerOneVsOne())
          || this is GA_PVPClientPlayer)
        if ((package != null && package.socketType == ServerType.CrossSever && CrossServerUtility.IsCrossServerOneVsOne()))
        {
            if (s_OnRefreshLife != null)
            {
@@ -308,11 +307,37 @@
        m_H0434 = null;
        m_OffLineSkillList = null;
        m_DoFly = false;
        base.OnUnit();
    }
    public override void Destroy()
    {
    }
    private bool m_DoFly = false;
    private Vector3 m_FlyTarget = Vector3.zero;
    private Vector3 m_StartPos;
    private float m_InCreaseTime;
    public void StartFly(float x, float y)
    {
        x = (x - GA_Hero.MapOffset.x) * .5f;
        y = (y - GA_Hero.MapOffset.z) * .5f;
        m_InCreaseTime = 0;
        m_StartPos = Pos;
        m_FlyTarget = new Vector3(x, 50, y);
        RaycastHit _hit;
        var _ray = new Ray(m_FlyTarget, Vector3.down);
        if (Physics.Raycast(_ray, out _hit, 100, LayerUtility.WalkbleMask))
        {
            m_FlyTarget = _hit.point;
            m_DoFly = true;
            Play(GAStaticDefine.State_Fly);
            Idle();
            OnHorse(0);
            StopMoveToPosition();
        }
    }
    protected override void OnUpdate()
@@ -322,6 +347,21 @@
        if (m_CmdManager != null)
        {
            m_CmdManager.Update();
        }
        if (m_DoFly)
        {
            Forward = MathUtility.ForwardXZ(m_FlyTarget, Pos);
            m_InCreaseTime += .5f * Time.deltaTime;
            Pos = Vector3.Lerp(m_StartPos, m_FlyTarget, m_InCreaseTime);
            var _distance = MathUtility.DistanceSqrtXZ(Pos, m_FlyTarget);
            if (_distance < 0.05f)
            {
                Pos = m_FlyTarget;
                IdleImmediate();
                StopPathFind();
                m_DoFly = false;
            }
        }
    }
@@ -336,6 +376,7 @@
    private Vector3 m_TargetPos;
    private bool m_MoveToFinalPos;
    private Vector3 _dir;
    private float _time = 0;
    public void MoveToPosition(Vector3 pos, float angle, float speed, bool startOrStop)
    {
@@ -348,6 +389,7 @@
        {
            State = E_ActorState.AutoRun;
            Run();
            _time = 0;
        }
        else
        {
@@ -400,6 +442,14 @@
            {
                MoveToPosition(m_TargetPos);
            }
            _time += Time.deltaTime;
            if (_time > .5f)
            {
                m_StartMove = false;
                m_MoveToFinalPos = true;
            }
        }
        else if (m_MoveToFinalPos)
        {
@@ -654,7 +704,7 @@
    {
        // Debug.LogFormat("{0} 血量改变: {1}", ServerInstID, value);
        GA_Hero _hero = PlayerDatas.Instance.hero;
        if (_hero != null && (_hero.SelectTarget == this || CrossServerUtility.IsCrossServer()))
        if (_hero != null && (SelectTarget == this || CrossServerUtility.IsCrossServer()))
        {
            if (s_OnRefreshLife != null)
            {
@@ -694,24 +744,24 @@
        {
            // 判断队伍
            if (ActorInfo.teamID != 0
             && _hero.ActorInfo.teamID != 0
             && ActorInfo.teamID == _hero.ActorInfo.teamID)
             && ActorInfo.teamID != 0
             && ActorInfo.teamID == ActorInfo.teamID)
            {
                return false;
            }
            // 判断阵营
            if (ActorInfo.faction != 0
             && _hero.ActorInfo.faction != 0
             && ActorInfo.faction == _hero.ActorInfo.faction)
             && ActorInfo.faction != 0
             && ActorInfo.faction == ActorInfo.faction)
            {
                return false;
            }
            // 判断仙盟
            if (ActorInfo.familyID != 0
             && _hero.ActorInfo.familyID != 0
             && ActorInfo.familyID == _hero.ActorInfo.familyID)
             && ActorInfo.familyID != 0
             && ActorInfo.familyID == ActorInfo.familyID)
            {
                return false;
            }
@@ -764,7 +814,7 @@
        }
        _hero.LockTarget = this;
        _hero.SelectTarget = this;
        SelectTarget = this;
    }
    public void OnSelect()
Fight/Stage/MapEditor/Game/TransferGroup.cs
@@ -30,7 +30,6 @@
    }
    private float m_InCreaseTime;
    private float m_MoveTime = 2;
    private Vector3 m_StartPos;
    private bool isPositive = true;
@@ -110,12 +109,12 @@
            case 2:// 执行坐标改变
                _p = m_Data.transferPoints[targetPoint];
                _hero.Forward = MathUtility.ForwardXZ(_p.position, _hero.Pos);
                m_InCreaseTime += 1f / m_MoveTime * Time.deltaTime;
                m_InCreaseTime += .5f * Time.deltaTime;
                _hero.Pos = Vector3.Lerp(m_StartPos, _p.position, m_InCreaseTime);
                _distance = MathUtility.DistanceSqrtXZ(_hero.Pos, _p.position);
                if (_distance < 0.05f)
                {
                    _hero.Pos = _p.position;
                    _hero.PrevPos = _hero.Pos = _p.position;
                    _hero.IdleImmediate();
                    _hero.StopPathFind();
@@ -138,7 +137,6 @@
                    }
                    else
                    {
                        m_Step = 3;
                        GA_Hero.s_MapSwitching = false;
                    }