private void Update()
    {
        //print(rectTransform.rect);
        if (totalScore == 0)
        {
            scoreText.text = "Score: 000";
        }
        else
        {
            scoreText.text = "Score: " + totalScore;
        }
        chainText.text = "Best Chain: " + highestChain;
        if (timerIsRunning)
        {
            if (timeRemaining > 0)
            {
                timeRemaining -= Time.deltaTime;
                DisplayTimeMS(timeRemaining);
            }
            else
            {
                Debug.Log("Time's up!");
                timeRemaining  = 0; // lock the timer so it doesn't turn negative
                timerIsRunning = false;
                IsActive       = false;

                moneyText.text      = "" + moneyVal + "M";
                scienceText.text    = "" + scienceVal;
                globalCoopText.text = "" + globalCoopVal;
                educationText.text  = "" + educationVal;

                int[] resourceValues = getResourceValues();
                updatedMoneyVal      = resourceValues[0] + moneyVal;
                updatedScienceVal    = resourceValues[1] + scienceVal;
                updatedGlobalCoopVal = resourceValues[2] + globalCoopVal;
                updatedEducationVal  = resourceValues[3] + educationVal;

                ResourceSerializer.updateXml(updatedMoneyVal, updatedScienceVal, updatedGlobalCoopVal, updatedEducationVal);
            }
        }
    }
 public void setResourceValues(int updatedMoneyVal, int updatedScienceVal, int updatedGlobalCoopVal, int updatedEducationVal)
 {
     print("Set Resources to: " + updatedMoneyVal + " " + updatedScienceVal + " " + updatedGlobalCoopVal + " " + updatedEducationVal);
     ResourceSerializer.updateXml(updatedMoneyVal, updatedScienceVal, updatedGlobalCoopVal, updatedEducationVal);
     updateGui();
 }