materialOf static method
The material file entity is drawn with; empty for its own look.
Implementation
static String materialOf(Entity entity) {
final shape = entity.getComponent<Primitive3D>();
if (shape != null) return shape.material;
return entity.getComponent<ModelComponent>()?.materials['*'] ?? '';
}