public override void EndContact(ContactInfo contactInfo) { if (_leaveEvent != null) { Game.Events[_leaveEvent].trigger(_leaveEventData); } }
public override void BeginContact(ContactInfo contactInfo) { if (_enterEvent != null) { Game.Events[_enterEvent].trigger(_enterEventData); } }
public virtual void BeginContact(ContactInfo contactInfo) { }
public virtual void EndContact(ContactInfo contactInfo) { }
public void EndContact(Contact contact) { while (contact != null) { var lhsInfo = new ContactInfo(); var rhsInfo = new ContactInfo(); lhsInfo.contact = contact; rhsInfo.contact = contact; lhsInfo.fixtureType = FixtureType.A; rhsInfo.fixtureType = FixtureType.B; var lhsGo = contact.GetFixtureA().GetBody().GetUserData() as GameObject; var rhsGo = contact.GetFixtureB().GetBody().GetUserData() as GameObject; lhsInfo.other = rhsGo; rhsInfo.other = lhsGo; if (lhsGo != null) { lhsGo.EndContact(lhsInfo); } if (rhsGo != null) { rhsGo.EndContact(rhsInfo); } contact = contact.GetNext(); } }