问题描述
data: (
graphics: (
mesh: Shape((shape: Sphere(32,32))),material: (
albedo: Generate(Srgba(0.0,0.0,1.0,1.0)),),transform: (),)
这是来自 amethyst git repo (https://github.com/amethyst/amethyst/blob/v0.15.3/examples/sphere/assets/prefab/sphere.ron) 中的示例之一的文件 我写了这个锈函数:
fn initialize_sphere(world: &mut World) {
let mesh = world.exec(|loader: AssetLoaderSystemData<'_,Mesh>| {
loader.load_from_data(
Shape::Sphere(32,32)
.generate::<(Vec<Position>,Vec<normal>,Vec<Tangent>,Vec<TexCoord>)>(None)
.into(),(),)
});
let material_defaults = world.read_resource::<MaterialDefaults>().0.clone();
let material = world.exec(|(material_loader,texture_loader): (AssetLoaderSystemData<'_,Material>,AssetLoaderSystemData<'_,Texture>)| {
let albedo = texture_loader.load_from_data(
load_from_srgba(Srgba::new(0.0,1.0)).into(),);
material_loader.load_from_data(
Material {
albedo,..material_defaults
},)
});
world.create_entity()
.with(mesh)
.with(material)
.build();
}
但是当我从 on_start
回调中调用它时,它什么也不做!我用调试行 (https://github.com/amethyst/amethyst/tree/v0.15.3/examples/debug_lines) 运行它以排除位置错误,但球体仍然没有出现在任何地方。我花了6个多小时试图解决这个问题,但仍然没有解决方案。请告诉我我错过了什么
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)