private void Start() { // Setting the maximum health of slider defined in the inspector. shipHealthSlider.maxValue = shipTotalHealth; shipHealthSlider.value = shipTotalHealth; saveToJson = GetComponent <SaveScoreToJson>(); }
private SaveScoreToJson saveScoreToJson; // Class to load the highest score and current score obtained by player. #endregion // Use this for initialization void Start() { // Retriving the high score and current score from the JSON object and setting the values in UI. saveScoreToJson = GetComponent <SaveScoreToJson>(); highScoreText.text = saveScoreToJson.highScore.ToString(); currentScoreText.text = saveScoreToJson.currentScore.ToString(); }