| | |
| | | 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)
|
| | | {
|
| | |
| | | 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()
|
| | |
| | | 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;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | 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)
|
| | | {
|
| | |
| | | {
|
| | | State = E_ActorState.AutoRun;
|
| | | Run();
|
| | | _time = 0;
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | MoveToPosition(m_TargetPos);
|
| | | }
|
| | |
|
| | | _time += Time.deltaTime;
|
| | | if (_time > .5f)
|
| | | {
|
| | | m_StartMove = false;
|
| | | m_MoveToFinalPos = true;
|
| | | }
|
| | |
|
| | | }
|
| | | else if (m_MoveToFinalPos)
|
| | | {
|
| | |
| | | {
|
| | | // 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)
|
| | | {
|
| | |
| | | {
|
| | | // 判断队伍
|
| | | 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;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | _hero.LockTarget = this;
|
| | | _hero.SelectTarget = this;
|
| | | SelectTarget = this;
|
| | | }
|
| | |
|
| | | public void OnSelect()
|