void ShowData() { input_ProblemType.GetComponentInChildren <InputField>().text = Data.ProblemTypeString; input_BuildingName.GetComponentInChildren <InputField>().text = Data.BuildingNameString; input_Floor.GetComponentInChildren <InputField>().text = Data.FloorString; input_OfficeName.GetComponentInChildren <InputField>().text = Data.LocationString; }
public void PlayerBets() { playerCurrentBet = int.Parse(betField.GetComponentInChildren <Text>().text); if (playerCurrentBet > playerFunds) { Debug.Log("Player bet is more than current funds"); ShowPlayerStatusState("not enough funds"); } else if (playerCurrentBet % 10 != 0) { Debug.Log("Please only bet multiples of 10"); } else { BetFieldState("freeze"); //Deduct player's current bet from total funds AdjustPlayerFunds(); //If the player is the last better: show deal button, hide next round button if (blackJackController.bettingTurnIndex == blackJackController.numberOfPlayers - 1) { blackJackController.DealButtonState(true); blackJackController.NextRoundState(false); } blackJackController.bettingTurnIndex++; blackJackController.BettingTurn(); } }
public void saveMoves() { chel.GetComponent <chelScript>().name = name.GetComponentInChildren <Text>().text; if (height.GetComponentInChildren <Text>().text != "") { chel.GetComponent <chelScript>().height = Int32.Parse(height.GetComponentInChildren <Text>().text); } else { chel.GetComponent <chelScript>().height = 0; } if (weight.GetComponentInChildren <Text>().text != "") { chel.GetComponent <chelScript>().weight = Int32.Parse(weight.GetComponentInChildren <Text>().text); } else { chel.GetComponent <chelScript>().weight = 0; } if (male.isOn) { chel.GetComponent <chelScript>().isMale = true; } else { chel.GetComponent <chelScript>().isMale = false; } Cancel(); }
void ReValue() { if (GameManager.isNumPlayerChosen && GameManager.players.Count - 1 == GameManager.playerIteration) { NameField.GetComponentInChildren <InputField> ().text = GameManager.GetActivePlayer().Name; PasswordField.GetComponentInChildren <InputField> ().text = GameManager.GetActivePlayer().Password; ChangeName(); ChangePass(); } }
// Use this for initialization void Start() { if (PlayerPrefs.HasKey("Sound")) { Debug.Log(String.Format("Sound is {0}", PlayerPrefs.GetInt("Sound"))); MuteSlider.GetComponent <Slider>().value = PlayerPrefs.GetInt("Sound"); } if (PlayerPrefs.HasKey("Goal")) { goalTextField.GetComponentInChildren <InputField>().text = PlayerPrefs.GetInt("Goal").ToString(); } }
public void visibleEye() { string textField = InputField.text; this.InputField.contentType = InputField.ContentType.Standard; objUnityInput.contentType = InputField.contentType; //ToastHelper.ShowToast(textField+"\\\\"+this.InputField.contentType.ToString() + this.InputField.name); this.OnDestroy(); base.Start(); StartCoroutine(InitialzieOnNextFrame()); objUnityInput.GetComponentInChildren <Text>().text = textField; //Debug.Log(objUnityInput.contentType); }
public void OnLogFileSet() { if (!logPlayer.LoadLog(logFileField.text)) { logFileField.GetComponentInChildren <Text>().color = Color.red; playPauseButton.interactable = false; } else { logFileField.GetComponentInChildren <Text>().color = Color.cyan; logTimeSlider.maxValue = logPlayer.length; playPauseButton.interactable = true; } }
// Use this for initialization void Start() { var foundObjects = FindObjectsOfType <Text>(); for (int i = 0; i < foundObjects.Length; i++) { if (foundObjects [i].name == cmdOutputTextName) { CmdOutputText = foundObjects [i]; continue; } if (foundObjects [i].name == cmdInputTextName) { CmdInputText = foundObjects [i]; continue; } if (CmdInputText != null && CmdOutputText != null) { break; } } thisInput = this.GetComponent <InputField> (); thisText = thisInput.GetComponentInChildren <Text> (); thisInput.onEndEdit.AddListener(submitPress); }
public void FirstEnterClicked() { InputField input = GameObject.FindObjectOfType <InputField>(); Text textBox = input.GetComponentInChildren <Text>(); // check if inputText == getEgg password , if yes, load dragon Scene // if not, show "wrong Password" if (passlist.pwarray[0].key == textBox.text) { dragon.GetEgg = true; //save dragon as getEgg == true dragon.Save(); DontDestroyOnLoad(dragon); Flowchart flowchart = GameObject.FindObjectOfType <Flowchart>(); flowchart.SetBooleanVariable("getEgg", true); print(flowchart.GetBooleanVariable("getEgg")); } else { input.text = ""; GameObject.Find("Placeholder").GetComponent <Text>().text = "Wrong Password"; } }
public void SubmitName() { if (inputField.GetComponentInChildren <Text>().text != string.Empty) { string playerName = inputField.GetComponentInChildren <Text>().text; savedName = playerName; if (!CheckForExistence()) { Debug.Log("This name is valid!"); } } else { Debug.Log("InputField is empty"); } }
private void SetOperation() { rngInt1 = UnityEngine.Random.Range(1, 10); rngInt2 = UnityEngine.Random.Range(1, 10); switch (UnityEngine.Random.Range(1, 4)) { case 1: symbol = "+"; result = rngInt1 + rngInt2; break; case 2: symbol = "-"; result = rngInt1 - rngInt2; break; case 3: symbol = "x"; result = rngInt1 * rngInt2; break; default: symbol = "+"; result = rngInt1 + rngInt2; break; } inputMatemathic.GetComponentInChildren <Text>().text = rngInt1.ToString() + symbol + rngInt2.ToString() + "=?"; }
GameObject DrawInput(XsollaFormElement element) { // if this promo coupone code then draw another prefab if (element.GetName() == "couponCode") { GameObject newItem = Instantiate(Resources.Load("Prefabs/SimpleView/_PaymentFormElements/ContainerPromoCode")) as GameObject; PromoCodeController controller = newItem.GetComponent <PromoCodeController>(); controller.InitScreen(_translation, element); controller._inputField.onEndEdit.AddListener(delegate { OnEndEdit(element, controller._inputField); }); controller._promoCodeApply.onClick.AddListener(delegate { bool isLinkRequired = false; if ((form.GetCurrentCommand() == XsollaForm.CurrentCommand.CHECKOUT) && form.GetSkipChekout()) { string checkoutToken = form.GetCheckoutToken(); isLinkRequired = checkoutToken != null && !"".Equals(checkoutToken) && !"null".Equals(checkoutToken) && !"false".Equals(checkoutToken); } if (isLinkRequired) { string link = "https://secure.xsolla.com/pages/checkout/?token=" + form.GetCheckoutToken(); if (Application.platform == RuntimePlatform.WebGLPlayer //|| Application.platform == RuntimePlatform.OSXWebPlayer //|| Application.platform == RuntimePlatform.WindowsWebPlayer ) { Application.ExternalEval("window.open('" + link + "','Window title')"); } else { Application.OpenURL(link); } } gameObject.GetComponentInParent <XsollaPaystationController> ().ApplyPromoCoupone(form.GetXpsMap()); }); return(newItem); } else { GameObject newItem = Instantiate(inputPrefab) as GameObject; newItem.GetComponentInChildren <Text>().text = element.GetTitle(); InputField inputField = newItem.GetComponentInChildren <InputField>(); inputField.GetComponentInChildren <Text>().text = element.GetExample(); SetupValidation(element.GetName(), inputField); //inputField.onValidateInput += ValidateInput; inputField.onEndEdit.AddListener(delegate { OnEndEdit(element, inputField); }); return(newItem); } }
/// <summary> /// /// </summary> protected override void Awake() { base.Awake(); txt_Caption = ipt_Content.GetComponentInChildren <Text>(); ipt_Content.onValueChanged.AddListener(Ipt_Content_OnValueChanged); ipt_Content.onEndEdit.AddListener(Ipt_Content_OnEndEdit); }
public void EndNameEdit() { NewFoodNameToAdd = ""; NewFoodNameToAdd = newFoodNameField.GetComponentInChildren <Text>().text; newFoodNameField.gameObject.SetActive(false); newCaloriesField.gameObject.SetActive(true); }
private void Awake() { m_Commander = GetComponentInParent <Commander>(); SetupConsoleInput(); consoleInput.onValueChanged.AddListener(delegate { if (!consoleInput.text.Contains("\n")) { return; } var text = (consoleInput.text).Remove(consoleInput.text.LastIndexOf("\n", StringComparison.Ordinal)); consoleInput.text = text; m_Commander.ProcessCommand(text); }); consoleInput.GetComponentInChildren <Text>().font = font; consoleInput.gameObject.SetActive(false); m_Commander.onCloseCommander.AddListener(delegate { consoleInput.gameObject.SetActive(false); //consoleInput.DeactivateInputField(); }); m_Commander.onOpenCommander.AddListener(delegate { consoleInput.gameObject.SetActive(true); consoleInput.ActivateInputField(); }); m_Commander.onFinishProcessCommand.AddListener(delegate { consoleInput.text = string.Empty; }); // Check if logs exists m_Logs = GetComponentInParent <Logs>(); if (m_Logs) { SetupLogPanel(); m_Commander.onCloseCommander.AddListener(delegate { m_LogPanel.logPanelScroll.SetActive(false); m_LogPanel.logPanelToast.SetActive(true); }); m_Commander.onOpenCommander.AddListener(delegate { m_LogPanel.logPanelScroll.SetActive(true); m_LogPanel.logPanelToast.SetActive(false); }); } }
void AssignInput() { qrcode = input_QRcode.GetComponentInChildren <InputField>().text; problemtype = input_BuildingName.GetComponentInChildren <InputField>().text; buildingname = input_BuildingName.GetComponentInChildren <InputField>().text; floor = input_Floor.GetComponentInChildren <InputField>().text; officename = input_OfficeName.GetComponentInChildren <InputField>().text; description = input_Description.GetComponentInChildren <InputField>().text; }
public void PlayerFundsState(bool state) { if (state == true) { playerAvailableFunds.enabled = true; playerAvailableFunds.interactable = true; playerAvailableFunds.GetComponentInChildren <CanvasGroup>().alpha = 1; playerAvailableFunds.GetComponentInChildren <Text>().color = Color.black; } else { playerAvailableFunds.enabled = false; playerAvailableFunds.interactable = false; playerAvailableFunds.GetComponentInChildren <CanvasGroup>().alpha = 0; playerAvailableFunds.GetComponentInChildren <Text>().color = Color.clear; } }
public void OnPathSubmit(InputField inputField) { string path = inputField.text; if (Directory.Exists(path)) { currentDirectory = path; UpdateDir(); currentPath.GetComponentInChildren <Text>().color = Color.black; } else if (File.Exists(path)) { Answer(path); } else { currentPath.GetComponentInChildren <Text>().color = Color.red; } }
public void OnClick() { m_TestList = new List <UTreeData>(); m_AllTreeInfo = test.m_Instance.m_NeedInfo; if (m_AllTreeInfo != null) { StartCoroutine(OnClickGenerate()); } m_InputField.GetComponentInChildren <Text>().text = m_AllTreeInfo.Count.ToString(); }
static void Postfix(ref InputField ___m_passwordDialog) { Log("Pwd Field " + ___m_passwordDialog); var charJIP = _hostList.CurrentSelected ?? new CharacterHost(); if (charJIP.RequirePassword || !string.IsNullOrEmpty(charJIP.Password)) { InputField componentInChildren = ___m_passwordDialog.GetComponentInChildren <InputField>(); componentInChildren.text = charJIP.Password; } }
//点击进入游戏 public void OnEnterGame() { playerName = inputName.GetComponentInChildren <Text>().text.ToString(); //存储选择的角色 PlayerPrefs.SetInt("PlayerIndex", IndexChoose); //存储角色的名字 PlayerPrefs.SetString("PlayerName", playerName); //Debug.Log("Name:" +playerName); //加载下个场景 SceneManager.LoadScene(2); }
public void ResetBuilder() { CommandsSet.Clear(); CommandName.GetComponentInChildren <Text>().text = "Enter the name"; CommandName.GetComponent <Image>().color = Color.white; UICommandElements.Clear(); CommandName.text = null; foreach (UICommand child in GetComponentsInChildren <UICommand>()) { Destroy(child.gameObject); } }
public void Show() { score_uploaded = PlayerPrefs.GetInt("score_uploaded"); input_text.GetComponentInChildren <Text>().text = "Enter username"; input_text.GetComponentInChildren <Text>().color = Color.grey; gameObject.SetActive(true); }
//提交昵称 void submitName() { string nameStr = nameInput.GetComponentInChildren <Text> ().text; if (nameStr == "") { regText.text = "请输出昵称!"; } else { StartCoroutine(checkName(nameStr)); } }
void loadNextScene() { if (!comment.GetComponentInChildren <Text>().text.Equals("")) { processComment(comment.GetComponentInChildren <Text>().text); } if (PlayerPrefs.GetString("role").Equals("Scouting")) { Variables.teamData = Variables.ToBinary(int.Parse(Variables.teamnumber), 13) + Variables.ToBinary(int.Parse(Variables.matchnumber), 7) + Variables.teamColor; } else if (PlayerPrefs.GetString("role").Equals("Strategy") || PlayerPrefs.GetString("role").Equals("Assistant") || PlayerPrefs.GetString("role").Equals("Fouls") || PlayerPrefs.GetString("role").Equals("Defense")) { Variables.teamData = Variables.ToBinary(int.Parse(Variables.matchnumber), 7); Variables.teamData = Variables.teamData + Variables.ToBinary(int.Parse(Variables.foulTeams[0]), 13); Variables.teamData = Variables.teamData + Variables.ToBinary(int.Parse(Variables.foulTeams[1]), 13); Variables.teamData = Variables.teamData + Variables.ToBinary(int.Parse(Variables.foulTeams[2]), 13); } Variables.recordQR = false; SceneManager.LoadScene("qrgenerator"); }
public void ShowDealerStatus(string state) { if (state == "blackjack") { showDealerStatus.GetComponentInChildren <InputField>().text = state; } else if (state == "bust") { showDealerStatus.GetComponentInChildren <InputField>().text = state; } else if (state == "clear") { showDealerStatus.GetComponentInChildren <InputField>().text = ""; } else { showDealerStatus.GetComponentInChildren <InputField>().text = dealerScore.ToString(); } }
public void saveToHighScore() { //Check if user has inserted Name if (usr_name == "") { InputField nf = Name_Field.GetComponent <InputField>(); nf.GetComponentInChildren <Text>().text = "Insert Name Please!: "; } else { saveToFile(); } }
// Get all the references needed for the UI public void initialize() { commandLineField = GetComponentInChildren <CommandLineField>(true).gameObject; panel = GetComponentInChildren <CommandLinePanel>(true).gameObject; terminalLines = GetComponentInChildren <CommandLineTerminalText>(true).gameObject; inputField = commandLineField.GetComponentInChildren <InputField>(); panelImage = panel.GetComponentInChildren <Image>(true); inputText = inputField.GetComponentInChildren <Text>(); terminalText = terminalLines.GetComponentInChildren <Text>(); setFpsDisplay(); ready = true; setActiveUi(false); }
public void EndCalorieEdit() { NewCalorieCountToAdd = 0; string cal = newCaloriesField.GetComponentInChildren <Text>().text; Int32.TryParse(cal, out NewCalorieCountToAdd); newCaloriesField.gameObject.SetActive(false); AddNewButton.gameObject.SetActive(true); AddNewFoodCaloriePair(NewFoodNameToAdd, NewCalorieCountToAdd); UpdateTable(); //WriteNewKeyValuePairToFile(NewFoodNameToAdd); }
void Start() { /*DontDestroyOnLoad(this); * if (GameObject.Find(name).gameObject != this.gameObject) * Destroy(this.gameObject);*/ LogicMain.Initialize(); LogicMain.logInEvent.AddListener(s => { ShowMsg(s); }); Client.Initialize(); usernameText = usernameInputField.GetComponentInChildren <Text>(); passwordText = passwordInputField.GetComponentInChildren <Text>(); portText = portInputField.GetComponentInChildren <Text>(); loginButton.onClick.AddListener(LogInClick); registerButton.onClick.AddListener(RegisterClick); }