public void DrawLogic(GameScene scene, SpriteBatch spriteBatch, Matrix view, Matrix projection, GameObjectDrawMode drawMode = GameObjectDrawMode.All) { //Console.WriteLine($"Drawing, Position: {this.Position}"); if ((drawMode & GameObjectDrawMode.Model) > 0) { Draw(scene, view, projection); } if ((drawMode & GameObjectDrawMode.SpriteBatch) > 0) { Draw2D(spriteBatch); } foreach (GameObject obj in this.ChildObjects) { obj.DrawLogic(scene, spriteBatch, view, projection, drawMode); } }
/// <summary> /// Calls <seealso cref="Draw"/> /// After that draws all <see cref="ChildObjects"/> /// </summary> /// <param name="scene"></param> /// <param name="spriteBatch"></param> public void DrawLogic(GameScene scene, SpriteBatch spriteBatch, GameObjectDrawMode drawMode = GameObjectDrawMode.All) { DrawLogic(scene, spriteBatch, scene.GetViewMatrix(), scene.GetProjectionMatrix(), drawMode); }