/// <summary> /// Allows the game component to update itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> public override void Update(GameTime gameTime) { // base first because base handles collision events which might dispose "this" base.Update(gameTime); if (isDisposed) { return; } // Update AI AI.UpdateAI(gameTime); if (FxSound != null) { if (Player.GetDistanceToPlayer(game, GlobalPosition, 0) <= 200) { if (!FxSound.Loop) { FxSound.Loop = true; } } else if (FxSound.Loop) { FxSound.Loop = false; } } }
/// <summary> /// Allows the game component to update itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> public override void Update(GameTime gameTime) { // base first because base handles collision events which might dispose "this" base.Update(gameTime); AIStates.UpdateAI(gameTime); }
/// <summary> /// Allows the game component to update itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> public override void Update(GameTime gameTime) { // base first because base handles collision events which might dispose "this" base.Update(gameTime); if (isDisposed) { return; } // Update AI AI.UpdateAI(gameTime); }