void OnCollisionEnter(Collision collision) { if (collision.gameObject.tag == "PlayerBullet") { PlayerBullet pb = collision.gameObject.GetComponent <PlayerBullet>(); if (isCore) { //check to see if no other connected bodies foreach (FaceType face in faceTypes) { if (face != null) { if (face is FaceTypeConnector) { FaceTypeConnector ftc = (FaceTypeConnector)face; if (ftc.GetConnectedFace() != null) { if (!ftc.GetConnectedFace().GetBodyComponent().isCore) { pb.OnBounce(); return; } } } } } } OnHit(pb.GetDamage()); pb.OnHit(); } }