コード例 #1
0
ファイル: Barrier.cs プロジェクト: pontusdacke/SyncedMG
        public override bool OnCollision(Fixture f1, Fixture f2, FarseerPhysics.Dynamics.Contacts.Contact contact)
        {
            CollidingSprite other = SyncedGameCollection.GetCollisionComponent(f2);

            if (other != null)
            {
                if (other.Tag == TagCategories.CRYSTAL)
                {
                    Grabbable g_other = (Grabbable)other;
                    if (g_other.HasOwner)
                    {
                        if (g_other.Owner.ID == _start.ID || g_other.Owner.ID == _end.ID)
                        {
                            return(false);
                        }
                        else
                        {
                            g_other.ForcedRelease();
                            return(true);
                        }
                    }
                    else
                    {
                        return(true);
                    }
                }
            }
            return(true);
        }