/// <summary> /// Hooks up an event handler to a collision event. /// /// The order of the two groups do not matter, as it will add them to both [a,b] and [b,a]. /// /// For example, to listen for the player colliding with the wall, you want to use Groups.PlayerID and Groups.WallID. /// </summary> /// <param name="handler">The method that will run when the event is fired</param> public void AddEvent(int firstType, int secondType, CollisionReportEvent handler) { reporters[firstType, secondType] += handler; reporters[secondType, firstType] += handler; }
public static void HookFunctionToCollisionReport(int firstType, int secondType, CollisionReportEvent handler) { LKernel.GetG<CollisionReporter>().AddEvent(firstType, secondType, handler); }
/// <summary> /// Hooks up an event handler to a collision event. /// /// The order of the two groups do not matter, as it will add them to both [a,b] and [b,a]. /// /// For example, to listen for the player colliding with the wall, you want to use Groups.PlayerID and Groups.WallID. /// </summary> /// <param name="handler">The method that will run when the event is fired</param> public void AddEvent(PonykartCollisionGroups firstType, PonykartCollisionGroups secondType, CollisionReportEvent handler) { AddEvent((int) firstType, (int) secondType, handler); }