public override void OnUse()
 {
     base.OnUse();
     this.ResetVariables();
     this.pathfinding = null;
     this.MovingState = null;
     this.MovingMode  = null;
     this.GravityMode = null;
 }
 public override void Born(ActorRoot owner)
 {
     base.Born(owner);
     this._MaxSpeed   = 6000;
     this.MovingState = new StateMachine();
     this.MovingState.RegisterState <IdleMovmentState>(new IdleMovmentState(this), "IdleMovmentState");
     this.MovingState.RegisterState <AccelerateMovementState>(new AccelerateMovementState(this), "AccelerateMovementState");
     this.MovingState.RegisterState <UniformMovementState>(new UniformMovementState(this), "UniformMovementState");
     this.MovingState.RegisterState <DecelerateMovementState>(new DecelerateMovementState(this), "DecelerateMovementState");
     this.MovingState.ChangeState("IdleMovmentState");
     this.MovingMode = new StateMachine();
     this.MovingMode.RegisterState <AutoMovementMode>(new AutoMovementMode(this), "AutoMovementMode");
     this.MovingMode.RegisterState <DirectionalMovementMode>(new DirectionalMovementMode(this), "DirectionalMovementMode");
     this.MovingMode.RegisterState <HoldonMovementMode>(new HoldonMovementMode(this), "HoldonMovementMode");
     this.MovingMode.ChangeState("HoldonMovementMode");
     this.GravityMode = new GravityMovement(this);
     this.CreateNavSearchAgent();
 }