void OnTriggerEnter(Collider other)
{
if(other.tag == "Player" && !_reached)
{
//Set reached to true so we can't trigger the checkpoint again.
_reached = true;
//Set the checkpoint data.
_checkpointData.Bullets = _spiritGun.GetBulletCount();
_checkpointData.ReserveBullets = _spiritGun.GetReserveCount();
_checkpointData.Health = _player.GetHealth();
_checkpointData.BulletBoxes = GameObject.FindGameObjectsWithTag("AmmoBox");
_checkpointData.Enemies = GameObject.FindGameObjectsWithTag("Enemy");
//Send the checkpoint data to game manager
EventManager.PostNotification((int) GameManagerScript.GameEvents.Checkpoint, this, _checkpointData);
}
}