assign static method
Draws entity with the material file at path (empty for its own
look again). False when it has nothing to draw it on.
Implementation
static bool assign(Entity entity, String path) {
final shape = entity.getComponent<Primitive3D>();
if (shape != null) {
shape.material = path;
return true;
}
final model = entity.getComponent<ModelComponent>();
if (model == null) return false;
model.materials = path.isEmpty ? {} : {'*': path};
return true;
}