void Awake() { //Fetch Components ballCont = FindObjectOfType <BallController>(); holeGen = this.GetComponent <HoleGen>(); inputHandler = this.GetComponent <InputHandler>(); holeThemeHandler = this.GetComponent <HoleThemeHandler>(); defMats = this.GetComponent <DefaultMats>(); pauseHandler = FindObjectOfType <PauseHandler>(); fadeImage = GameObject.Find("BlackFade").GetComponent <Image>(); holeResultText = GameObject.Find("HoleResultText").GetComponent <TextMeshProUGUI>(); //Instantiate our GameData prefab if it doesn't already exist. if (!FindObjectOfType <GameData>()) { gameData = Instantiate(gameDataPrefab).GetComponent <GameData>(); } else { gameData = FindObjectOfType <GameData>(); } //Select the relevant scoreboard SelectScoreboard(gameData.gameMode, gameData.noHoles); //Set Vsync QualitySettings.vSyncCount = 0; }
void Start() { themeHandler = FindObjectOfType <HoleThemeHandler>(); //Set FPS & Vsync QualitySettings.vSyncCount = 0; //Fade From Black FadeIn(); }