#Sync asset loading

5 messages · Page 1 of 1 (latest)

somber condor
#

Are you storing the handles?

fringe pewter
# somber condor Are you storing the handles?

Yeah, I have a resource like this which gets initialized in my setup phase:

#[derive(Resource)]
struct Textures {
    ground: Vec<Handle<StandardMaterial>>,

    bottle_dropoff: Handle<StandardMaterial>,
    medkit_dropoff: Handle<StandardMaterial>,
    smores_dropoff: Handle<StandardMaterial>,
    bottle_pickup: Handle<StandardMaterial>,
    medkit_pickup: Handle<StandardMaterial>,
    smores_pickup: Handle<StandardMaterial>,

    pad_mesh: Handle<Mesh>,
    ground_mesh: Handle<Mesh>,
}

and then I have a textures: Res<Textures> argument in systems which spawn the actual entities.

somber condor
#

Are they strong handles? It is weird that they wouldn’t be considered loaded

fringe pewter
#

I'm not sure why, but spawning another entity on top of entities that aren't rendering (with no textures) somehow makes the textures show up on the other entity. Turned out to be some rendering issue, not an asset loading issue.