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; }
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); }
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); }