Beispiel #1
0
 public override void EndContact(ContactInfo contactInfo)
 {
     if (_leaveEvent != null)
     {
         Game.Events[_leaveEvent].trigger(_leaveEventData);
     }
 }
Beispiel #2
0
 public override void BeginContact(ContactInfo contactInfo)
 {
     if (_enterEvent != null)
     {
         Game.Events[_enterEvent].trigger(_enterEventData);
     }
 }
Beispiel #3
0
 public virtual void BeginContact(ContactInfo contactInfo)
 {
 }
Beispiel #4
0
 public virtual void EndContact(ContactInfo contactInfo)
 {
 }
Beispiel #5
0
        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();
            }
        }