Esempio n. 1
0
        protected override void Separation(Fixture _fixtureA, Fixture _fixtureB)
        {
            Fixture other = _fixtureA;

            if (_fixtureA == m_fixture)
            {
                other = _fixtureB;
            }
            GameObject otherGameObject = FixtureCollisionCategroy.GetGameObject(other);

            if (otherGameObject != null &&
                m_candidateVictims.Contains(otherGameObject))
            {
                m_candidateVictims.Remove(otherGameObject);
            }
            return;
        }
Esempio n. 2
0
        protected override bool Collision(Fixture _fixtureA, Fixture _fixtureB, FarseerPhysics.Dynamics.Contacts.Contact _contact)
        {
            Fixture other = _fixtureA;

            if (m_fixture == _fixtureA)
            {
                other = _fixtureB;
            }
            GameObject otherGameObject = FixtureCollisionCategroy.GetGameObject(other);

            if (otherGameObject != null &&
                otherGameObject.GetComponent(typeof(CanBeStealthKilled)) != null)
            {
                m_candidateVictims.Add(otherGameObject);
            }
            return(true);
        }
Esempio n. 3
0
        protected bool OnCollision(Fixture _fixtureA, Fixture _fixtureB, Contact _contact)
        {
            Fixture other = _fixtureA;

            if (_fixtureA.Body == m_body)
            {
                other = _fixtureB;
            }
            GameObject otherGameObject = FixtureCollisionCategroy.GetGameObject(other);

            if (otherGameObject != null &&
                otherGameObject.GetComponent(typeof(Vulnerable)) != null)
            {
                if (m_belongToGUID == "" || m_belongToGUID != otherGameObject.GUID)
                {
                    Vulnerable vulnerable = otherGameObject.GetComponent(typeof(Vulnerable))
                                            as Vulnerable;
                    vulnerable.GetHurt(m_damage);
                }
            }

            return(true);
        }