void NextMenu() { menuManager.ShowMenu(nextMenu); SyncDataWithController(); nextMenu.gameObject.GetComponent <MatchMenu> ().enabled = true; linesControl.RandomPosition(); this.enabled = false; }
public void Resume() { paused = false; Time.timeScale = tempTimeScale; UI_MenuManager.ShowMenu(UI_DummyMenu); count = 0; IsUserDetectedCount = 0; }
public void OnLeftRoom() { Log.Write("Player Disconnected, Back to Main Menu"); GameManager.TweenQueue.Reset(); DestroyPlayerObjects(); _menuManager.ShowMenu(_allMenuScreens.First(m => m.name.Contains("MainMenuContainer"))); }
void Start() { if (PlayerPrefs.GetInt("Soll angemeldet bleiben") == 0 || PlayerPrefs.HasKey("Soll angemeldet bleiben") || PlayerPrefs.HasKey("Benutzername") || PlayerPrefs.HasKey("Passwort Hash")) { Debug.Log("not"); canvas.ShowMenu(anmeldung); } else { Debug.Log("an"); Anmelden(PlayerPrefs.GetString("Benutzername"), PlayerPrefs.GetString("Passwort Hash")); } }
public void StartServerManual() { Lobby.AddListener(this); //gameServerIP = "127.0.0.1"; //gameServerPort = 7000; Lobby.ConnectAsServer(lobbyIP, lobbyPort); uLink.Network.InitializeServer(32, 7000); mainMenuManager.ShowMenu(windowPickSelection.GetComponent <Menu>()); pickSelectionScript.CreateLayout(); pickSelectionScript.CreatePickLayout(); }
public void uLink_OnConnectedToServer() { introSource.Stop(); mainMenuManager.ShowMenu(windowPickSelection.GetComponent <Menu>()); mainMenuManager.loadingScreenObj.SetActive(false); // GIVE THE NAME OF THE PLAYER TO THE PICK SELECTION WINDOW GameObject PickSelectionObj = GameObject.Find("Window_PickSelection_mn"); PickSelection pickSelScript = PickSelectionObj.GetComponent <PickSelection>(); pickSelScript.PlayerName = PlayerPrefs.GetString("playername"); pickSelScript.CreateLayout(); pickSelScript.CreatePickLayout(); }
public override void onClick() { if (CommandName.Length == 0) { return; } switch (CommandName) { case "Load": { MenuManager Manager = FindObjectOfType <MenuManager>(); if (Manager == null) { return; } Manager.ShowMenu(1); break; }; case "Exit": { #if UNITY_EDITOR EditorApplication.isPlaying = false; #else Application.Quit(); #endif break; }; default: break; } }
void Update() { switch (currentState) { case OverworldStates.EnteringOverworld: control.currentState = OverworldStates.Transition; Invoke("TransitionToWander", 0.4f); break; case OverworldStates.Menu: break; case OverworldStates.Transition: break; case OverworldStates.Wander: if (Input.GetButtonDown("Submit")) { control.currentState = OverworldStates.Menu; MenuManager.ShowMenu("Player Menu"); } break; case OverworldStates.Event: break; default: break; } }
public void BuyItem(MarketItem item) { ShowImage.texture = item.Content.Camera.targetTexture; ShowName.text = item.Name; MM.HideMenu(MarketMenu); MM.ShowMenu(MainMenu); }
void Update() { if (!introed) { timer += Time.deltaTime; if (timer >= introTime) { if (timer >= introTime + 1) { introed = true; } else { displayedObject.SetActive(true); } } } else { if (Input.anyKey) { displayedObject.SetActive(false); menuManager.ShowMenu(mainMenu); audioSource.PlayOneShot(audioClip); linesControl.RandomPosition(); Destroy(this); } } }
// TODO: change input system to events (Remove them from update method) void Update() { // show tool menu if (SteamVR_Actions._default.MenuUI.GetLastActive(SteamVR_Input_Sources.Any)) { menuManagerRef.ShowMenu(SteamVR_Actions._default.MenuUI.state); } }
public void BackMenu() { audioSource.PlayOneShot(cancelClip); backMenu.gameObject.GetComponent <MatchMenu> ().enabled = true; menuManager.ShowMenu(backMenu); linesControl.RandomPosition(); this.enabled = false; }
public void EndGame(MenuManager.MenuType menuType) { fakeGame.SetActive(true); Destroy(game); menuManager.ShowMenu(menuType); }
public void StartServerManual() { Lobby.AddListener(this); //gameServerIP = "127.0.0.1"; //gameServerPort = 7000; Lobby.ConnectAsServer(lobbyIP, lobbyPort); uLink.Network.InitializeServer(32, 7000); mainMenuManager.ShowMenu(windowPickSelection.GetComponent <Menu>()); pickSelectionScript.CreateLayout(); pickSelectionScript.CreatePickLayout(); cameraMain.SetActive(false); lightsObj.SetActive(false); cameraParticle.clearFlags = CameraClearFlags.SolidColor; }
private void SaveButtonPress() { MenuManager menuManager = FindObjectOfType <MenuManager>() as MenuManager; if (!menuManager) { return; } menuManager.ShowMenu(4); }
public void OnClick() { if (QuestionNum >= questionData["data"].Count) { Debug.Log("Gello"); if (score == questionData["data"].Count) { GameObject.Find("Rank").GetComponent <Text>().text = "Excelent"; } MenuManager menuResult = GameObject.Find("Canvas").GetComponent <MenuManager>(); menuResult.ShowMenu(GameObject.Find("Result").GetComponent <Menu>()); GameObject.Find("Score").GetComponent <Text>().text = score.ToString() + "/" + questionData["data"].Count; } if (nextQuestion) { var ansDestroy = GameObject.FindGameObjectsWithTag("Answer"); if (ansDestroy != null) { foreach (var ans in ansDestroy) { DestroyImmediate(ans); } } GameObject.Find("Question/Panel/QuestionContainer/Question/Text").GetComponentInChildren <Text>().text = questionData["data"][QuestionNum]["question"].ToString(); for (var i = 0; i < questionData["data"][QuestionNum]["answer"].Count; i++) { var answer = Instantiate(ansPrefab); answer.GetComponentInChildren <Text>().text = questionData["data"][QuestionNum]["answer"][i].ToString(); var answerC = GameObject.Find("AnswersContainer").GetComponent <Transform>(); answer.transform.SetParent(answerC); string offset = i.ToString(); if (i == 0) { answer.name = "Correct"; answer.GetComponent <Button>().onClick.AddListener(() => Answer("0")); } else { answer.name = "Wrong" + offset; answer.GetComponent <Button>().onClick.AddListener(() => Answer(offset)); } answer.transform.SetSiblingIndex(Random.Range(0, 3)); } QuestionNum++; nextQuestion = false; clickQuestion = true; StartCoroutine("Timer"); } }
public Main() { // Old version check if (File.Exists("scripts\\JC3RebelDrop.dll") || File.Exists("scripts\\JC3RebelDrop.ini")) { Notification.Show("~r~Old Just Cause 3 Rebel Drops installation detected. Aborted rewrite loading. Remove JC3RebelDrop.dll and JC3RebelDrop.ini to resolve this issue."); return; } // Setup Util.VerifyFileStructure(); if (PlaySound) { AudioManager.InitSounds(); } VehConfig = VehicleConfig.Load(); WepConfig = WeaponConfig.Load(); foreach (string file in Directory.GetFiles(Globals.CustomVehicleDir, "*.json")) { CustomVehicleConfigs.Add(CustomVehicleConfig.LoadFromFile(file)); } foreach (string file in Directory.GetFiles(Globals.CustomVehicleDir, "*.xml")) { CustomVehicleConfigs.Add(CustomVehicleConfig.LoadFromFile(file)); } foreach (string file in Directory.GetFiles(Globals.CustomWeaponDir, "*.json")) { CustomWeaponConfigs.Add(CustomWeaponConfig.LoadFromFile(file)); } foreach (string file in Directory.GetFiles(Globals.CustomWeaponDir, "*.xml")) { CustomWeaponConfigs.Add(CustomWeaponConfig.LoadFromFile(file)); } Config = ModConfig.Load(); MenuManager.Init(); // Event handling Tick += OnTick; KeyDown += (o, e) => { if (e.KeyCode == Config.DropMenu) // Our menu on/off switch { MenuManager.ShowMenu(); } }; Notification.Show("~y~Just Cause Rebel Drops~w~ successfully loaded!"); }
public void GUIOnClick() { //display city menu GUI from inspector /* Debug.Log("test -M: " + menuManager + "setup is : " + setup); * if (!setup) { * AfterSetup(); * Debug.Log("ran aftersetup now: " + setup); * } */ menuManager.ShowMenu(); if (isCapital) { SetBuildingType(BuildingType.Capital); //late setter } //buttonText.TextSet(); ?? needed? }
IEnumerator LoadingDepartCoroutine() { // Dok ide loading depart funkcija aktiviramo svet sa levelima koje smo presli za sada // Prikazujemo level select menu menuManager.ShowMenu(levelSelectMenu); LevelsParser.levelParser.SetWorldLevels(LevelsParser.selectedPack, LevelsParser.selectedWorld); loadingHolder.SetActive(true); loadingHolder.transform.GetChild(0).GetComponent <Animator>().Play("LoadingDepart", 0, 0); yield return(new WaitForSeconds(0.8f)); loadingHolder.SetActive(false); }
void Start() { RectTransform rect = gameObject.GetComponent <RectTransform> (); TextAsset[] files = Resources.LoadAll <TextAsset> ("Soal"); foreach (TextAsset file in files) { GameObject kat = Instantiate(katPrefab) as GameObject; kat.name = Path.GetFileNameWithoutExtension(file.name).ToString(); kat.transform.SetParent(GameObject.Find("Kategori/Panel/Scroll/KategoriC").GetComponent <Transform>()); string katName = kat.name; kat.GetComponentInChildren <Text>().text = kat.name + "(Tertinggi: " + PlayerPrefs.GetInt(kat.name) + ")"; kat.GetComponent <Button>().onClick.AddListener(() => OnClick(katName)); kat.GetComponent <Button>().onClick.AddListener(() => menu.ShowMenu(GameObject.Find("Canvas/Soal").GetComponent <Menu>())); } rect.sizeDelta = new Vector2(rect.sizeDelta.x, (rect.sizeDelta.y / 6) * files.Length); }
IEnumerator IECloseGatesAndChangeSceene() { yield return(null); if (_Menu) { _Menu.SetActive(true); } yield return(StartCoroutine(IECloseGates())); yield return(new WaitForSeconds(closedTime)); menu.gameObject.GetComponent <GatesController>().UpdateGateState(false); menuManager.ShowMenu(menu); GameMaster.instance.ClearScenee(); }
void Start() { if (GlobalVariables.gameMode == "Magic") { randomCategory = (int)Random.Range(0, 5); randomMandala = (int)Random.Range(0, 10); // Debug.Log("Randomization: " + randomCategory + " and " + randomMandala); LoadCategoryForMagicMode(randomCategory); GlobalVariables.selectedTexture = category[randomMandala]; Application.LoadLevel("Gameplay"); } canvas.ShowMenu(categoryMenu); //categoryScrollNativeAd.LoadCurrentAdInScroll(1f); }
// Update is called once per frame void Update() { if (isGameOver) { Time.timeScale = 0; UI_MenuManager.ShowMenu(UI_GameOver); UI_ScoreInGameOver.text = "" + tmpScore; UI_TimeRemainingInGameOver.text = "Time x 200 : " + (tmpTime * 200); // UI_TotalScoreInGameOver.text = "Total : " + ( ((int)(Mathf.FloorToInt(score)) + ((int)(Mathf.FloorToInt(timeRemaining))*200) )); UI_TotalScoreInGameOver.text = "Total : " + (tmpScore + tmpTime * 200); return; } else { tmpTime = Mathf.FloorToInt(timeRemaining); tmpScore = Mathf.FloorToInt(score); UI_Score.text = "Score : " + tmpScore; UI_TimeLeft.text = "Time Remain : " + tmpTime; } totalTimeElapsed += Time.deltaTime; score = totalTimeElapsed * 100; timeRemaining -= Time.deltaTime; UI_PauseMenu.PauseMenu(); if (timeRemaining <= 0) { isGameOver = true; timeRemaining = 0; } if (score >= 1500 && score <= 1550) { ChangeToBoss(); } else if (score > 3000) { isGameOver = true; } }
internal void BeginingOfService(MenuManager menuManager, bool clear = false) { MenuService menuService = new MenuService(); if (menuManager.order.OrderItems.Count != 0) { menuService.AddToMenu("Services", new Item("Change the order") { IsService = true }); menuService.ChangeItem("Services", "Take Order", new Item("Order more") { IsService = true }); } menuManager.ShowMenu(menuService.Services, clear); menuManager.TakeChoiceFromPassedMenu(menuService.Services); }
// Use this for initialization void Start() { RectTransform rect = gameObject.GetComponent <RectTransform>(); string filePath = Application.streamingAssetsPath; DirectoryInfo dir = new DirectoryInfo(filePath); FileInfo[] files = dir.GetFiles("*.json"); foreach (var file in files) { GameObject kat = Instantiate(katPrefab) as GameObject; kat.name = Path.GetFileNameWithoutExtension(file.Name).ToString(); kat.transform.SetParent(GameObject.Find("Category/Panel/Scroll/CategoryContainer").GetComponent <Transform>()); kat.GetComponentInChildren <Text>().text = kat.name; kat.GetComponent <Button>().onClick.AddListener(() => OnClick(kat.name)); kat.GetComponent <Button>().onClick.AddListener(() => menu.ShowMenu(GameObject.Find("Canvas/Question").GetComponent <Menu>())); } rect.sizeDelta = new Vector2(rect.sizeDelta.x, (rect.sizeDelta.y / 6) * files.Length); }
void OnJoinedRoom() { mainMenuManager.ShowMenu(windowPickSelection.GetComponent <Menu>()); mainMenuManager.loadingScreenObj.SetActive(false); // GIVE THE NAME OF THE PLAYER TO THE PICK SELECTION WINDOW GameObject PickSelectionObj = GameObject.Find("Window_PickSelection_mn"); PickSelection pickSelScript = PickSelectionObj.GetComponent <PickSelection>(); //pickSelScript.PlayerName = PlayerPrefs.GetString("playername"); pickSelScript.CreateLayout(); pickSelScript.CreatePickLayout(); }
public static void ShowTradingOptions() { MenuManager.SwitchToMenu(TradingSetup); MenuManager.ShowMenu(BackFromTradingOptions); //activate buttons based on whether players are currently playing foreach (Button button in TradingPartnerOptions) { button.interactable = false; foreach (Player player in GameManager.Players) { if (player != GameManager.CurrentPlayer && player.gameObject.name == button.GetComponentInChildren <Text>().text) { button.interactable = true; break; } } } Back.interactable = true; }
public void carregar(int teste) { TextAsset[] files = Resources.LoadAll <TextAsset> (""); foreach (TextAsset file in files) { Debug.Log(files.Length); GameObject kat = Instantiate(CategoPref) as GameObject; kat.name = Path.GetFileNameWithoutExtension(file.name).ToString(); kat.transform.SetParent(GameObject.Find("Categoria/Panel/Scroll/KategoriC").GetComponent <Transform> ()); kat.GetComponentInChildren <Text> ().text = kat.name; Debug.Log("Teste = " + test); //i = 1 (Vamos la)na sequencia do arquivo Streaming Asset, a ordem começa com i= 0 no nosso caso é preparaçao //No inicio usei kat.name == "Vamos-la" if (i == 1) { var colo = kat.GetComponent <Button> (); colo.GetComponentInChildren <Text> ().font = myFont; colo.GetComponentInChildren <Text> ().fontSize = 15; if (teste < 7) { kat.GetComponent <Button> ().interactable = false; } else { kat.GetComponent <Button> ().interactable = true; } } var colors = kat.GetComponent <Button> (); colors.GetComponentInChildren <Text> ().font = myFont; colors.GetComponentInChildren <Text> ().fontSize = 40; string katName = kat.name; kat.GetComponent <Button>().onClick.AddListener(() => OnClick(katName)); kat.GetComponent <Button>().onClick.AddListener(() => menu.ShowMenu(GameObject.Find("Canvas/Perguntas").GetComponent <Menu>())); i++; } rect.sizeDelta = new Vector2(rect.sizeDelta.x, (rect.sizeDelta.y / 6) * files.Length); }
public void CalculatePanelSize() { int animyAnzahl = kategorieSammlungMonster.categories[categoryInt].monsters.Count; parentPanel.GetComponent <RectTransform> ().offsetMax = new Vector2((animyAnzahl + 1) * 25 + animyAnzahl * 300, 0); parentPanel.GetComponent <RectTransform> ().offsetMin = new Vector2((animyAnzahl + 1) * -25 - animyAnzahl * 300, 0); for (int i = 0; i < kategorieSammlungMonster.categories[categoryInt].monsters.Count; i++) { Transform go = Instantiate(pref); go.transform.parent = parentPanel; go.GetComponent <RectTransform> ().offsetMax = new Vector2(650 + i * 50 + i * 600, 300); go.GetComponent <RectTransform> ().offsetMin = new Vector2(50 + i * 50 + i * 600, -300); go.GetComponent <RectTransform> ().localScale = new Vector3(1, 1, 1); go.GetComponent <Monster> ().id = i; go.GetComponentInChildren <Text> ().text = kategorieSammlungMonster.categories [categoryInt].monsters [i].name; go.GetComponent <Button> ().onClick.AddListener(delegate { menuManager.ShowMenu(menu); mmz.SetMonsterData(go.GetComponent <Monster>().id); }); } }
private void OpenMenu(MenuManager menuManager) { menuManager.ShowMenu(); }