Skip to content

EntityLinkManager Link Behavior

Adrian Papari edited this page Jan 7, 2019 · 4 revisions

Link Behavior

Excluding links

You can exclude links from being managed. Tune per relationship with @LinkPolicy

public class Anchor extends Component {
    @EntityId @LinkPolicy(SKIP)
    public int target;
}

Policy overview

Policy LinkListener callbacks
SKIP <none>
CHECK_SOURCE ::onLinkEstablished, ::onLinkKilled
CHECK_SOURCE_AND_TARGETS ::onLinkEstablished, ::onLinkKilled, ::onTargetChanged, ::onTargetDead

Default link behavior

Default behavior differs between normal references and bags.

default policy note
@EntityId int CHECK_SOURCE_AND_TARGETS
Entity CHECK_SOURCE_AND_TARGETS
@EntityId IntBag CHECK_SOURCE Even with CHECK_SOURCE_AND_TARGETS, never calls #onTargetChanged
Bag<Entity> CHECK_SOURCE Even with, CHECK_SOURCE_AND_TARGETS, never calls #onTargetChanged
Clone this wiki locally