import {Container} from '@pixi/react'; import {memo} from 'react'; import {useDebug} from '@/react/context/debug.js'; import {useMainEntity} from '@/react/context/main-entity.js'; import Aabb from './aabb.jsx'; import Crosshair from './crosshair.jsx'; import Light from './light.jsx'; import SpriteComponent from './sprite.jsx'; function Entity({entity, ...rest}) { const [debug] = useDebug(); const [mainEntity] = useMainEntity(); if (!entity) { return false; } const {Direction, id, Sprite} = entity; return ( <> {entity.Sprite && ( )} {entity.Light && ( )} {debug && entity.Position && ( )} {debug && ( )} {debug && entity.Collider && ( <> {entity.Collider.aabbs.map((aabb, i) => ( ))} )} {debug && mainEntity == entity.id && ( )} ); } export default memo(Entity);