private void AssignReferences() { _MenuScreen = FindObjectOfType <MenuScreenController> (); _LevelSelectScreen = FindObjectOfType <LevelSelectScreenController> (); _SettingsScreen = FindObjectOfType <MenuSettingScreenController> (); _CreditsScreen = FindObjectOfType <CreditScreenController> (); }
// Use this for initialization void Start() { dataController = FindObjectOfType <DataController>(); Debug.Log("InStart of GameController"); currentRoundData = dataController.GetCurrentRoundData(); questionPool = currentRoundData.questions; menuScreenController = FindObjectOfType <MenuScreenController>(); questionIndex = 0; ShowQuestion(); }
/// <summary> /// Korutyna ładująca scenę z ekranem rozgrywki /// </summary> /// <returns></returns> public IEnumerator LoadGameScene() { MenuScreenController menuController = GameObject.FindGameObjectWithTag("MenuController").GetComponent <MenuScreenController>(); AsyncOperation async = SceneManager.LoadSceneAsync(1); async.allowSceneActivation = false; while (!async.isDone) { menuController.SetLoadingProgress(async.progress); // Scena się załadowała if (async.progress >= 0.9f) { async.allowSceneActivation = true; } yield return(new WaitForSeconds(0.1f)); } }
/// <summary> /// The method adds Menu, Start and Bottom screens to their relevant containers /// and assigns the property fields. /// </summary> public static void ShowStartScreen() { MenuScreenController menuScreen = new MenuScreenController(); MainForm.GetInstance().LeftPanel.Controls.Add(menuScreen); StartScreenController startScreen = new StartScreenController(); MainForm.GetInstance().RightPanel.Controls.Add(startScreen); if (MainForm.GetInstance().BottomPanel.HasChildren) { MainForm.GetInstance().BottomPanel.Controls.RemoveAt(0); } currentScreen = startScreen; List <UserControl> currentScrenHistory = new List <UserControl>(); currentScrenHistory.Add(startScreen); screenHistory = currentScrenHistory; }