void DoCollisionDetection() { foreach (ColliderAABB powerup in powerups) { bool result = player.checkOverlap(powerup); player.SetCollisionWith(result, powerup); powerup.SetCollisionWith(result, player); /*if (player.checkOverlap(powerup)) * { * print("COLLIDE"); * //Destroy(powerup.gameObject); * powerup.GetComponent<MeshRenderer>().material.color = Random.ColorHSV(0, 1, 1, 1, 1, 1); * }*/ } }
void DoCollisionDetection() { foreach (ColliderAABB powerup in powerups) { bool result = player.CheckOverlap(powerup); player.SetCollisionWith(result, powerup); powerup.SetCollisionWith(result, player); /*EVENTs * { * // print("collision!"); * // Destroy(powerup); * // Destroy(powerup.gameObject); * powerup.GetComponent<MeshRenderer>().material.color = Random.ColorHSV(0, 1, 1, 1, 1, 1); * * //event listeners, * }*/ } }