protected void Copy(InputField target) { if (!input.Equals(target)) { return; } GlobalManager.BufferString = selectedText; }
void Update() { if (cardNum.Equals("Ass")) { obj.GetComponent <MeshRenderer>().material = Material1; } }
public void Register() { string message = ""; string imei = ClientConfig.HardWare.IMEI; if (string.IsNullOrEmpty(inputUser.text) || inputUser.text.Length < 6) { message = ClientConfig.Language.GetText("register_tenkhonghople"); ShowThongBao(message); return; } else if (string.IsNullOrEmpty(inputPass.text) || inputPass.text.Length < 6) { message = ClientConfig.Language.GetText("register_matkhauyeu"); ShowThongBao(message); return; } else if (inputConfirmPass.Equals(inputPass.text)) { message = ClientConfig.Language.GetText("register_matkhau_khonggiongnhau"); ShowThongBao(message); return; } string user = inputUser.text; string pass = inputPass.text; BaseInfo.gI().username = user; BaseInfo.gI().pass = pass; PopupAndLoadingScript.instance.ShowLoading(); //StartCoroutine(delayReg(user, pass, imei)); //SendData.onRegister(user, pass, imei); }
public void OnPointerClick(PointerEventData eventData) { if (inputField.Equals(kc.getInputField())) { return; } kc.clearText(); kc.SetInputField(inputField); }
private Vector3 getInputPosition( ) { if (!iFieldPositionX.Equals("") && !iFieldPositionY.Equals("") && !iFieldPositionZ.Equals("")) { float x; float y; float z; float.TryParse(iFieldPositionX.text, out x); float.TryParse(iFieldPositionY.text, out y); float.TryParse(iFieldPositionZ.text, out z); return(new Vector3(x, y, z)); } return(Vector3.zero); }
void UpdateBoxAndInputs() { float widthX = LayoutUtility.GetPreferredWidth(inX.textComponent.rectTransform); float widthY = LayoutUtility.GetPreferredWidth(inY.textComponent.rectTransform); widthBox = Mathf.Max(widthX, widthY); inX.GetComponent <RectTransform>().sizeDelta = new Vector2(30f + widthBox, 30f); inY.GetComponent <RectTransform>().sizeDelta = new Vector2(30f + widthBox, 30f); rectTransform.sizeDelta = new Vector2(GetWidth(), GetHeight()); PlaceOutputs(); PlaceInputs(); float x, y; x = y = 0f; if (inX.gameObject.activeSelf) { if (!inX.text.Equals("") && !inX.text.Equals("-") && !inX.Equals(".")) { try { x = float.Parse(inX.text); } catch (FormatException) { Debug.LogError("Could not cast inputs (x) into a float, you ninja"); } } mNode.SetVectorX(x, inX.text); } if (inY.gameObject.activeSelf) { if (!inY.text.Equals("") && !inY.text.Equals("-") && !inY.Equals(".")) { try { y = float.Parse(inY.text); } catch { Debug.LogError("Could not cast inputs (y) into a float, you ninja"); } } mNode.SetVectorY(y, inY.text); } }
public void OnClickJoin() { if (!MainMenuManager.isMultiplayerButtonClicked) { return; } MainMenuManager.isPlayerConnected = true; otherCanvasAnimator.Play("Host_Join"); lobbyManager.ChangeTo(lobbyPanel); if (ipInput.Equals(string.Empty)) { ipInput.text = "localhost"; } lobbyManager.networkAddress = ipInput.text; lobbyManager.StartClient(); lobbyManager.backDelegate = lobbyManager.StopClientClbk; lobbyManager.DisplayIsConnecting(); lobbyManager.SetServerInfo("Connecting...", lobbyManager.networkAddress); }
// gets current value of input fields and updates the database (either just the questions or also the difficulty) public void updateQuestion() { question = GameObject.Find("InputQuestion").GetComponent <InputField>(); a1 = GameObject.Find("InputAnswer1").GetComponent <InputField>(); a2 = GameObject.Find("InputAnswer2").GetComponent <InputField>(); a3 = GameObject.Find("InputAnswer3").GetComponent <InputField>(); a4 = GameObject.Find("InputAnswer4").GetComponent <InputField>(); correctAns = GameObject.Find("CorrectAnswer").GetComponent <InputField>(); dropIndex = dropdown.value; dropValueafter = dropdown.options[dropIndex].text; q = question.text; sharingQforProf = question.text; ans1 = a1.text; ans2 = a2.text; ans3 = a3.text; ans4 = a4.text; correctA = correctAns.text; bool comp1 = correctA.Equals(ans1); bool comp2 = correctA.Equals(ans2); bool comp3 = correctA.Equals(ans3); bool comp4 = correctA.Equals(ans4); bool emptyInputQ = question.Equals(""); bool emptyInputA1 = ans1.Equals(""); bool emptyInputA2 = ans2.Equals(""); bool emptyInputA3 = ans3.Equals(""); bool emptyInputA4 = ans4.Equals(""); bool emptyInputCA = correctAns.Equals(""); //checks if every input field has a value otherwise error message if (emptyInputQ | emptyInputA1 | emptyInputA2 | emptyInputA3 | emptyInputA4 | emptyInputCA) { Debug.Log("No Input given"); setEmptyText(); } else { // checks if the difficulty remained the same if (dropValuebefore.Equals(dropValueafter)) { if (comp1 == true) { GetQuestion getQuestion = new GetQuestion(); getQuestion.uploadQuestion(q, ans1, ans2, ans3, ans4, correctA, StaticVariable.id); crudQuestion.UpdateQuestion(QuestionData.world, chapterString, dropValueafter, getQuestion); setText(); } else if (comp2 == true) { GetQuestion getQuestion = new GetQuestion(); getQuestion.uploadQuestion(q, ans1, ans2, ans3, ans4, correctA, StaticVariable.id); crudQuestion.UpdateQuestion(QuestionData.world, chapterString, dropValueafter, getQuestion); setText(); } else if (comp3 == true) { GetQuestion getQuestion = new GetQuestion(); getQuestion.uploadQuestion(q, ans1, ans2, ans3, ans4, correctA, StaticVariable.id); crudQuestion.UpdateQuestion(QuestionData.world, chapterString, dropValueafter, getQuestion); setText(); } else if (comp4 == true) { GetQuestion getQuestion = new GetQuestion(); getQuestion.uploadQuestion(q, ans1, ans2, ans3, ans4, correctA, StaticVariable.id); crudQuestion.UpdateQuestion(QuestionData.world, chapterString, dropValueafter, getQuestion); setText(); } else { setIncorrectText(); } } else { if (comp1 == true) { GetQuestion getQuestion = new GetQuestion(); getQuestion.uploadQuestion(q, ans1, ans2, ans3, ans4, correctA, StaticVariable.id); crudQuestion.UpdateQuestionDifficulty(QuestionData.world, chapterString, dropValuebefore, dropValueafter, getQuestion); setText(); } else if (comp2 == true) { GetQuestion getQuestion = new GetQuestion(); getQuestion.uploadQuestion(q, ans1, ans2, ans3, ans4, correctA, StaticVariable.id); crudQuestion.UpdateQuestionDifficulty(QuestionData.world, chapterString, dropValuebefore, dropValueafter, getQuestion); setText(); } else if (comp3 == true) { GetQuestion getQuestion = new GetQuestion(); getQuestion.uploadQuestion(q, ans1, ans2, ans3, ans4, correctA, StaticVariable.id); crudQuestion.UpdateQuestionDifficulty(QuestionData.world, chapterString, dropValuebefore, dropValueafter, getQuestion); setText(); } else if (comp4 == true) { GetQuestion getQuestion = new GetQuestion(); getQuestion.uploadQuestion(q, ans1, ans2, ans3, ans4, correctA, StaticVariable.id); crudQuestion.UpdateQuestionDifficulty(QuestionData.world, chapterString, dropValuebefore, dropValueafter, getQuestion); setText(); } else { setIncorrectText(); } } } }