void Update() { bountyIndicator.SetActive(isInBounty); if (isInBounty) { if (bountyStartTime + currentBounty.time <= Time.time) { Debug.Log("Bounty Failed"); isInBounty = false; Bounty nullB = new Bounty(); nullB.time = -1f; pauseMenuController.setBounty(nullB); StartCoroutine(waitToGiveNewBounty()); } if (currentBounty.building.GetComponent <Building>().isDestroyed) { Economy.playerCredits = currentBounty.credit; Debug.Log("Giving " + currentBounty.credit); isInBounty = false; StartCoroutine(waitToGiveNewBounty()); } } }