wip: floor texture
This commit is contained in:
44
Systems/Rendering/FloorRenderSystem.cs
Normal file
44
Systems/Rendering/FloorRenderSystem.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using BakeryGame.Components.Common;
|
||||
using BakeryGame.Components.Environment;
|
||||
using BakeryGame.Components.Player;
|
||||
using Raylib_cs;
|
||||
using Scellecs.Morpeh;
|
||||
|
||||
namespace BakeryGame.Systems.Rendering;
|
||||
|
||||
public class FloorRenderSystem:ISystem
|
||||
{
|
||||
private Filter _floor;
|
||||
private Filter _camera;
|
||||
|
||||
public FloorRenderSystem(World world)
|
||||
{
|
||||
World = world;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnAwake()
|
||||
{
|
||||
_floor = World.Filter.With<FloorComponent>().Build();
|
||||
_camera = World.Filter.With<CameraComponent>().Build();
|
||||
}
|
||||
|
||||
public World World { get; set; }
|
||||
public void OnUpdate(float deltaTime)
|
||||
{
|
||||
foreach (var item in _floor)
|
||||
{
|
||||
var size = item.GetComponent<FloorComponent>().Size;
|
||||
var positionComponent = item.GetComponent<PositionComponent>();
|
||||
var itemColorComponent = item.GetComponent<ColorComponent>();
|
||||
|
||||
//var position = Raylib.GetWorldToScreen(positionComponent.Position, _camera.First().GetComponent<CameraComponent>().Camera.GetCamera3D());
|
||||
//Raylib.DrawRectangle((int)position.X, (int)position.Y, 10, 10, itemColorComponent.Color);
|
||||
//Raylib.DrawCube(positionComponent.Position, size.X, size.Y, size.Z, itemColorComponent.Color);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user