private void InitializeGame() { /* ***************** Getting references ***************** */ buttonHome = GameObject.Find("ButtonHome"); imageLevel = GameObject.Find("ImageLevel"); textureImageLevel = imageLevel.GetComponent <RawImage> (); textLevel = GameObject.Find("TextLevel").GetComponent <Text> (); textTimeValue = GameObject.Find("TextTimeValue").GetComponent <Text> (); textLevelHUDValue = GameObject.Find("TextLevelHUDValue").GetComponent <Text> (); textTotalTimeValue = GameObject.Find("TextTotaltimeValue").GetComponent <Text> (); canvasESC = GameObject.Find("CanvasESC"); canvasHUD = GameObject.Find("CanvasHUD"); powercontroller.GetReferences(); /* ***************** Setting things up ***************** */ powercontroller.SetPowers(PowerController.Powers.jump); powercontroller.SetPowers(PowerController.Powers.shield); difficulty = (int)Mathf.Log(level, 2f); numOfComets = difficulty + 4; textTotalTimeValue.text = timercontroller.GetTotalTime().ToString("##.##"); textLevel.text = "Level: " + level; textLevelHUDValue.text = level.ToString(); buttonHome.SetActive(false); SetRandomLevelImage(); imageLevel.SetActive(true); canvasESC.SetActive(false); /* ***************** start level image ***************** */ Invoke("HideLevelImage", DELAY_LEVELSTART); /* ***************** building level ***************** */ gridcontroller.BuildLevel(); /* needs to be after BuildLevel() - so the player can reference to 2nd camera (which gets instantiated in BuildLevel() */ cameracontroller.GetReferences(); cameracontroller.SetCameraPosition(); Invoke("StartTimer", DELAY_TIMER); }