private void Awake() { gravity = PlayerPrefs.GetFloat("gravity", 4); tmpGravity = gravity; print("loaded gravity: " + gravity); ResetPlayer = GameObject.Find("GameController").GetComponent <ResetPlayerRotation>(); }
private void Awake()//Assign PlayAnimation and TMPro components { ResetPlayer = GameObject.Find("GameController").GetComponent <ResetPlayerRotation>(); PlayAnimation = GameObject.Find("UI").GetComponent <AnimationController>(); GameElements = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerAndTrampolines>(); Colors = GameObject.FindGameObjectWithTag("Background").GetComponent <GameColorsController>(); scoreTxt = GameObject.FindGameObjectWithTag("ScoreTxt").GetComponent <TextMeshProUGUI>(); tmpScoreTxt = GameObject.FindGameObjectWithTag("TmpScoreTxt").GetComponent <TextMeshProUGUI>(); updateTmpScoreTxt = GameObject.FindGameObjectWithTag("UpdateTmpScoreTxt").GetComponent <TextMeshProUGUI>(); perfectLandTxt = GameObject.FindGameObjectWithTag("PerfectLandTxt").GetComponent <TextMeshProUGUI>(); currLevelTxt = GameObject.FindGameObjectWithTag("CurrentLevelNo").GetComponent <TextMeshProUGUI>(); nxtLevelTxt = GameObject.FindGameObjectWithTag("NextLevelNo").GetComponent <TextMeshProUGUI>(); scorePlus1 = GameObject.FindGameObjectWithTag("ScoreUpdateTxt").GetComponent <TextMeshProUGUI>(); tmpScorePlus1 = GameObject.FindGameObjectWithTag("TmpScoreUpdateTxt").GetComponent <TextMeshProUGUI>(); currentLevelWorldSpace = GameObject.FindGameObjectWithTag("InWorldStats").GetComponentInChildren <TextMeshPro>(); highScoreTxt = GameObject.FindGameObjectWithTag("HighScoreTxt").GetComponent <TextMeshProUGUI>(); //highScoreTxtGO = GameObject.FindGameObjectWithTag("HighScoreTxtGO").GetComponent<TextMeshProUGUI>(); //lastScoreTxt = GameObject.FindGameObjectWithTag("LastScoreTxt").GetComponent<TextMeshProUGUI>(); //lastScoreTxtGO = GameObject.FindGameObjectWithTag("LastScoreTxtGO").GetComponent<TextMeshProUGUI>(); }