public virtual void Update(int millisecondsSinceLastUpdate) { if (MotionEngine != null) { MotionEngine.Update(millisecondsSinceLastUpdate); WorldPosition += MotionEngine.Delta; } }
public override void Update(GameTime gameTime) { base.Update(gameTime); MotionEngine.Update(gameTime); Collider.Update(gameTime); ClosestInteractable = world.GetNearestInteractable(this, new Padding(10, 5)); }
protected override void DoInteract(GameObject with, GameTime gameTime) { Vector2 v = with.Velocity; v.Normalize(); engine.GoalVelocity = with.Velocity; //toMove.Position += v * 0.1f; engine.Update(gameTime); //IsInteracting = false; }
public override void Update(GameTime gameTime) { base.Update(gameTime); MotionEngine.Update(gameTime); Collider.Update(gameTime); if (BehaviourObserver.HasScript) { BehaviourObserver.Script.Update(gameTime); } }
public virtual void Update(int millisecondsSinceLastUpdate) { if (MotionEngine != null) { MotionEngine.Update(millisecondsSinceLastUpdate); } if (MotionEngine != null) { WorldPosition += MotionEngine.Delta; } if (Active) { CheckForAndHandleInput(millisecondsSinceLastUpdate); } }
public virtual void Update(int millisecondsSinceLastUpdate) { if ((!Paused) && (MotionEngine != null)) { MotionEngine.Update(millisecondsSinceLastUpdate); WorldPosition += MotionEngine.Delta; if (_lifeCycleState == LifeCycleStateValue.Exiting) { Tint = Color.Lerp(Color.White, Color.Transparent, _motionEngine.Progress); Scale = 1.0f + (_motionEngine.Progress / 2.0f); if (_motionEngine.Progress == 1.0f) { UpdateLifeCycleState(LifeCycleStateValue.ReadyForRemoval); } } } }
public void Update(int millisecondsSinceLastUpdate) { if (ReturningToPreviousLocation) { _motionEngine.Target = _startPosition; MotionEngine.Update(millisecondsSinceLastUpdate); if ((WorldPosition == _startPosition) || (Vector2.DistanceSquared(WorldPosition, _startPosition) < MotionEngine.Delta.LengthSquared())) { WorldPosition = _startPosition; ReturningToPreviousLocation = false; } else { WorldPosition += MotionEngine.Delta; } } }
void Update() { // 更新框架 MotionEngine.Update(); }