コード例 #1
0
ファイル: TriggerObjects.cs プロジェクト: GretelF/squircle
 public override void EndContact(ContactInfo contactInfo)
 {
     if (_leaveEvent != null)
     {
         Game.Events[_leaveEvent].trigger(_leaveEventData);
     }
 }
コード例 #2
0
ファイル: TriggerObjects.cs プロジェクト: GretelF/squircle
 public override void BeginContact(ContactInfo contactInfo)
 {
     if (_enterEvent != null)
     {
         Game.Events[_enterEvent].trigger(_enterEventData);
     }
 }
コード例 #3
0
ファイル: GameObject.cs プロジェクト: GretelF/squircle
 public virtual void BeginContact(ContactInfo contactInfo)
 {
 }
コード例 #4
0
ファイル: GameObject.cs プロジェクト: GretelF/squircle
 public virtual void EndContact(ContactInfo contactInfo)
 {
 }
コード例 #5
0
ファイル: Level.cs プロジェクト: GretelF/squircle
        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();
            }
        }