public static EntityBehaviour Follow(this EntityBehaviour entity, GameObject target, Action action) { entity.DequeueController("move"); var c = new LinearObjectFollowMovementController(target); if (action != null) { c.ControllerFinished += (sender, e) => action(); } entity.QueueController("move", c); return entity; }
public static EntityBehaviour Throw(this EntityBehaviour entity, GameObject target, Action action) { entity.DequeueController("move"); var c = new LinearObjectFollowMovementController(target){ IsYAxisIgnored = false, IsFinishedOnCatchup = true }; if (action != null) { c.ControllerFinished += (sender, e) => action(); } entity.QueueController("move", c); return entity; }