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; }
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(); }
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; }
protected void OnStopMove() { StopMove?.Invoke(); }