private void OnGUI() { if (!painelMensagemConfirmacao.gameObject.activeSelf && !painelUmaMensagem.gameObject.activeSelf) { int w = 320; int h = 240; if (GUI.Button(new Rect(0.06f * w, 0.1f * h, 0.22f * w, 0.1f * h), "Sair", ((GUISkin)Resources.Load("meuSkin")).button)) { BotaoSair(); } if (GUI.Button(new Rect(0.5f * w, 0.62f * h, 0.32f * w, 0.15f * h), "Criar", ((GUISkin)Resources.Load("meuSkin 1")).button)) { BotaoAlterarPerfil(); } if (GUI.Button(new Rect(0.06f * w, 0.62f * h, 0.32f * w, 0.15f * h), "Excluir", ((GUISkin)Resources.Load("meuSkin 2")).button)) { BotaoExcluir(); } input.text = GUI.TextField(new Rect(0.1f * w, 0.43f * h, 0.7f * w, 0.1f * h), "", ((GUISkin)Resources.Load("meuSkin")).textField); N3dsKeyboardResult result = UnityEngine.N3DS.Keyboard.GetResult(); input.text = result.ToString(); } }
private void OnGUI() { if (botaoIniciarJogo != null) { if (!nEdit.gameObject.activeSelf && !containerDeCriacaoDePerfil.activeSelf && !painelUmaMensagem.gameObject.activeSelf) { if (dadosGlobais.Perfis.Count > 1) { if (GUI.Button(new Rect(0.01f * w, 0.4f * h, 0.1f * w, 0.16f * h), "<<", skin.button)) { BotaoRetrocedePerfil(); } if (GUI.Button(new Rect(0.89f * w, 0.4f * h, 0.1f * w, 0.16f * h), ">>", skin.button)) { BotaoAvancaPerfil(); } } if (GUI.Button(new Rect(0.12f * w, 0.75f * h, 0.22f * w, 0.1f * h), "Sobre", skin.button)) { BotaoSobre(); } if (GUI.Button(new Rect(0.35f * w, 0.75f * h, 0.22f * w, 0.1f * h), "Editar", skin.button)) { BotaoEditar(); } if (GUI.Button(new Rect(0.62f * w, 0.7f * h, 0.25f * w, 0.15f * h), "Avançar", skin2.button)) { BotaoAvancar(); } if (GUI.Button(new Rect(0.11f * w, 0.87f * h, 0.26f * w, 0.12f * h), "Sair", skin.button)) { BotaoSair(); } if (GUI.Button(new Rect(0.4f * w, 0.87f * h, 0.26f * w, 0.12f * h), "Novo", skin.button)) { BotaoAbrirJanelaDeCriarPerfil(); } } else if (containerDeCriacaoDePerfil.activeSelf && !painelUmaMensagem.gameObject.activeSelf) { if (GUI.Button(new Rect(0.06f * w, 0.1f * h, 0.22f * w, 0.1f * h), "Sair", skin.button)) { BotaoCancelarCriacaoDePerfil(); } if (GUI.Button(new Rect(0.5f * w, 0.62f * h, 0.32f * w, 0.15f * h), "Criar", skin2.button)) { BotaoCriarPerfil(); } N3dsKeyboardResult result = UnityEngine.N3DS.Keyboard.GetResult(); GUI.Label(new Rect(0, 220, 60, 20), result.ToString()); string inputString = UnityEngine.N3DS.Keyboard.GetText(); GUI.Label(new Rect(70, 220, 250, 20), inputString); /* * if (T == null) * T = GameObject.Find("CriarPerfil").GetComponent<Text>();*/ GUI.TextField(new Rect(0.1f * w, 0.43f * h, 0.7f * w, 0.1f * h), "", skin.textField); if (result == N3dsKeyboardResult.Okay) { nomeNoNovoPerfil.text = inputString; } /* * if (UnityEngine.N3DS.Keyboard.GetResult() == (int)N3dsKeyboardResult.Okay) * { * N3dsKeyboardResult. * string text = UnityEngine.N3DS.Keyboard.GetText(); * T.text = text; * nomeDoPerfil.text = text; * }*/ //N3dsKeyboardResult result = UnityEngine.N3DS.Keyboard.GetResult(); //nomeDoPerfil.text = UnityEngine.N3DS.Keyboard.GetText(); //nomeDoPerfil.text = result.ToString(); } } }
void OnGUI() { int xpos = 0; int ypos = 5; width = 180; if (ButtonPressed(xpos, ref ypos, "Display Language: ", ref displayLanguage, displayLanguages)) { UnityEngine.N3DS.Keyboard.SetDisplayLanguage((N3dsKeyboardDisplayLanguage)displayLanguage); } if (ButtonPressed(xpos, ref ypos, "Finish Condition: ", ref finishableCondition, finishableConditions)) { UnityEngine.N3DS.Keyboard.SetFinishableCondition((N3dsKeyboardFinishableCondition)finishableCondition); } if (ButtonPressed(xpos, ref ypos, "Mask Mode: ", ref maskMode, maskModes)) { UnityEngine.N3DS.Keyboard.SetMaskMode((N3dsKeyboardMaskMode)maskMode); } if (ButtonPressed(xpos, ref ypos, "Parental Controls: ", ref parentalControl, parentalControls)) { UnityEngine.N3DS.Keyboard.SetParentalControls((N3dsKeyboardParentalControls)parentalControl); } if (ButtonPressed(xpos, ref ypos, "Type: ", ref keyboardType, keyboardTypes)) { UnityEngine.N3DS.Keyboard.SetType((N3dsKeyboardType)keyboardType); } if (ButtonPressed(xpos, ref ypos, "Num Buttons: ", ref numBottomButtons, 1, 3)) { UnityEngine.N3DS.Keyboard.SetNumBottomButtons(numBottomButtons); } xpos = 185; ypos = 5; width = 135; if (ButtonPressed(xpos, ref ypos, "Fixed Width: ", ref fixedWidth)) { UnityEngine.N3DS.Keyboard.SetFixedWidthMode(fixedWidth); } if (ButtonPressed(xpos, ref ypos, "Home Button: ", ref homeButton)) { UnityEngine.N3DS.Keyboard.SetHomeButtonEnabled(homeButton); } if (ButtonPressed(xpos, ref ypos, "Line Feed: ", ref lineFeedEnabled)) { UnityEngine.N3DS.Keyboard.SetLineFeedEnabled(lineFeedEnabled); } if (ButtonPressed(xpos, ref ypos, "Power Button: ", ref powerButton)) { UnityEngine.N3DS.Keyboard.SetPowerButtonEnabled(powerButton); } if (ButtonPressed(xpos, ref ypos, "Prediction: ", ref predictionEnabled)) { UnityEngine.N3DS.Keyboard.SetPredictionEnabled(predictionEnabled); } if (ButtonPressed(xpos, ref ypos, "Software Reset: ", ref softwareReset)) { UnityEngine.N3DS.Keyboard.SetSoftwareResetEnabled(softwareReset); } if (ButtonPressed(xpos, ref ypos, "Top Screen Dims: ", ref topScreenDims)) { UnityEngine.N3DS.Keyboard.SetTopScreenDims(topScreenDims); } if (GUI.Button(new Rect(160 - 60, 240 - 32, 120, 30), "Show Keyboard")) { UnityEngine.N3DS.Keyboard.Show(); } N3dsKeyboardResult result = UnityEngine.N3DS.Keyboard.GetResult(); GUI.Label(new Rect(0, 220, 60, 20), result.ToString()); inputString = UnityEngine.N3DS.Keyboard.GetText(); GUI.Label(new Rect(70, 220, 250, 20), inputString); }