public void CheckForCollisions_CollidingTrack_RaisingSeparationEvent() { _detector.CheckForCollision(TrackList); //Test to see if correct event is raised. //Dependency to Point and CollisionPair must work correctly, because output is correct. Assert.That(separationWasRaised, Is.EqualTo(true)); }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); } // Check for colliding particles for (int i = 0; i < particleArray.Count; i++) { for (int j = i + 1; j < particleArray.Count; j++) { if (CollisionDetector.CheckForCollision(particleArray[i], particleArray[j]) && (particleArray[i].getParticleInstantiated() && particleArray[j].getParticleInstantiated())) { // destroy both particles if colliding Destroy(particleArray[i].gameObject); Destroy(particleArray[j].gameObject); } } } if (CheckForHit()) { ChangePos(); } if (isScoring) //Was here to mitigate errors, but I tihnk the project just didn't compile correctly since it's working fine now { ScoreText.text = SCORESTRING + score.ToString(); } }