-
Notifications
You must be signed in to change notification settings - Fork 114
EntityLinkManager
Daan van Yperen edited this page Jan 2, 2019
·
30 revisions
What happens when a component refers to an entity and that entity gets deleted? A mess! This optional module will manage your entity references for you and can deal with complicated relationships easily.
public class Anchor extends Component {
@EntityId public int target = -1; // managed
public Entity target2; // managed
}
- Prevent dangling references to entities.
- Remove referencing components when target entity dies.
- Remove child entities when parent dies.
- Requires the field itself to be
public
. A private field with getter/setter is currently not supported. - When using kotlin, coerce it to a field by adding the
@JvmField
annotation. (see https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.jvm/-jvm-field/)
- Overview
- Concepts
- Getting Started
- Using
- More guides
- Plugins
- Game Gallery
- Tools and Frameworks
- API reference