0

Imagine I've crated an entity with transform:

let entity = world.create_entity().with(Transform::default());

How do I get its transform later having entity instance? E.g. (pseudo code):

let transform = entity.get_associated::<Transform>();
4

1 回答 1

0

Worked for me:

let transform = world.read_storage::<Transform>().get(entity);

It also can be write_storage.

于 2020-07-12T21:44:05.907 回答