Skip to content

Best way to refer to an entity from a component #152

Answered by Doraku
cjhooker asked this question in Q&A
Discussion options

You must be logged in to vote

Hey great to know that DefaultEcs is doing it for you :)

The is a recurring missing feature for which I don't have a complete solution yet. If you know what you are doing there is nothing wrong with storing entity in component, my goal is to have some kind of reference component that would allow you to reference an other entity component which would be automatically removed/disabled as the actual entity changes state so you don't have to do those checks yourself but it's not here yet :(

Anyway on the serialization problem, this is why my serializers takes a Predicate<Type> and a SerializationContext to marshal types. That way you can transform your non serializable component to something …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@cjhooker
Comment options

Answer selected by cjhooker
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants