示例#1
0
 public void StopMoveForSkill()
 {
     if (!Singleton <PvpManager> .Instance.IsInPvp)
     {
         if (this.isMoving && this.navAgent != null)
         {
             this.navAgent.StopMove();
         }
     }
     else if ((this.self.isHero || this.self.isPlayer) && this.isMoving)
     {
         StopMove data = new StopMove
         {
             rotate = this.self.transform.eulerAngles.y,
             unitId = this.self.unique_id,
             pos    = MoveController.Vector3ToSVector3(this.self.transform.position),
             tick   = UnitsSnapReporter.Instance.SyncTicks
         };
         if (this.self.IsMaster)
         {
             PvpEvent.SendStopMove(SerializeHelper.Serialize <StopMove>(data));
         }
     }
     this.curMoveState = EMoveState.MoveState_Idle;
 }
示例#2
0
    private void MoveNext()
    {
        if (_folowingMove.IsMoving)
        {
            return;
        }

        MapPosition nextPosition = TryGetNextPosition(_currentPosition);

        if (nextPosition.Equals(_currentPosition))
        {
            StopMove?.Invoke();
            return;
        }

        _currentPosition = nextPosition;
        Vector3 scenePosition = _navigator.ToScenePosition(_currentPosition);

        _folowingMove.Move(scenePosition);

        StartMoveNext?.Invoke();
    }
示例#3
0
 public void StopMove()
 {
     if (!Singleton <PvpManager> .Instance.IsInPvp)
     {
         if (this.isMoving && this.navAgent != null)
         {
             this.navAgent.StopMove();
         }
     }
     else if ((this.self.isHero || this.self.isPlayer) && this.isMoving)
     {
         StopMove stopMove = new StopMove();
         stopMove.rotate = this.self.transform.eulerAngles.y;
         stopMove.unitId = this.self.unique_id;
         stopMove.pos    = MoveController.Vector3ToSVector3(this.self.transform.position);
         stopMove.tick   = UnitsSnapReporter.Instance.SyncTicks;
         if (this.self.IsMaster)
         {
         }
     }
     this.curMoveState = EMoveState.MoveState_Idle;
 }
示例#4
0
 protected void OnStopMove()
 {
     StopMove?.Invoke();
 }