private int ChangeText(UI_Text e) { diaglouge.text = e.text; diaglouge.font = e.font; slider.value = e.progress; return(0); }
void OnEnable() { serializedObject.Update(); UI_Text text = target as UI_Text; // this.mTextID = text.mTextID; this.mTextStr = text.mTextStr; }
// [MenuItem("GameObject/UI/UIText")] // static void CreateUIText() // { // Type[] types = new Type[]{typeof(Text),typeof(UI_Text)}; // GameObject obj = EditorUtility.CreateGameObjectWithHideFlags("Text",HideFlags.None,types); // // // } // [InitializeOnLoadMethod] // static void StartInitializeOnLoadMethod() // { // EditorApplication.hierarchyWindowItemOnGUI += OnHierarchyGUI; // } // static void OnHierarchyGUI(int instanceID, Rect selectionRect) // { // Event evt = Event.current; // // Debug.LogError("kkk " + evt.button + " " + evt.type); // if (evt != null && selectionRect.Contains(evt.mousePosition) // && evt.button == 1 && evt.type == EventType.MouseDown) // { // Debug.LogError("in"); // GameObject selectedGameObject = EditorUtility.InstanceIDToObject(instanceID) as GameObject; // //这里可以判断selectedGameObject的条件 // if (selectedGameObject) // { // Debug.LogError("in2"); // Vector2 mousePosition = Event.current.mousePosition; // EditorUtility.DisplayPopupMenu(new Rect(mousePosition.x, mousePosition.y, 0, 0), "GameObject/",null); // evt.Use(); // } // } // } public override void OnInspectorGUI() { serializedObject.Update(); UI_Text text = target as UI_Text; text.mTextStr = EditorGUILayout.TextField("Text", text.mTextStr); if (this.mTextStr != text.mTextStr) { this.mTextStr = text.mTextStr; text.SetText(text.mTextStr); } serializedObject.ApplyModifiedProperties(); }
IEnumerator minusMoney() { yield return(new WaitForEndOfFrame()); Static_Var.RefreshUI(); yield return(new WaitForSeconds(3f)); Static_Var.Money -= Daily_Income; UI_Text tx = new UI_Text { text = "-100 FROM INCOME", font = font, progress = 0f }; FFMessage <UI_Text> .SendToLocal(tx); }
public void LoadUI() { main_window = new UI_Window(this); { propietari_text = new UI_Text(new System.Drawing.Point(10, 10), 100, 30, "Selecciona propietari:"); main_window.AddElement(propietari_text); propietaris_combobox = new UI_ComboBox(new System.Drawing.Point(12, 35), 200, 50); main_window.AddElement(propietaris_combobox); accepta_button = new UI_Button(new System.Drawing.Point(10, 70), 60, 30, "Accepta"); accepta_button.GetElement().Click += new System.EventHandler(this.Accepta); main_window.AddElement(accepta_button); } }
public void init() { //get view item _log = GameObject.Find("Log").GetComponent <UI_Text>(); _ui_gameround.gameObject.SetActive(true); round_code(""); _bet_timer.textContent = ""; _coin_list = _coin._list; //data setting _state_m = new StateMachine(); _state_m._state = "None"; _bet_model = new super7pk_bet(); foreach (Button bt in _btnlist) { string idx = bt.name; bt.onClick.AddListener(() => betType(idx)); } //change color //ColorBlock co= coin_list[0].colors; //co.normalColor = Color.red; //coin_list[0].colors = co; _model.putValue("coin_select", "Coin_1"); for (int i = 0; i < _coin_list.Count; i++) { string idx = i.ToString(); _coin_list[i].onClick.AddListener(() => coin_select(idx)); } _prebtn = ""; if (_local_test) { pc_test(); } else { connect_to_server(); } }
private void Timer_behavior_OnTimerEnd(string timerName) { if (timerName.Contains("Office Time")) { PlayerPrefs.SetInt("IsLate", 1); } else if (timerName.Contains("World Time")) { Static_Var.FogValue = Static_Var.FogValue + 0.3f; UI_Text tx = new UI_Text { text = "SLEEP TIME...", font = font, progress = 0f }; FFMessage <UI_Text> .SendToLocal(tx); string level = "Level" + Static_Var.currentLevel.ToString(); FFMessage <TriggerFade> .SendToLocal(new TriggerFade(level)); } }
// [MenuItem("GameObject/UI/UIText")] // static void CreateUIText() // { // Type[] types = new Type[]{typeof(Text),typeof(UI_Text)}; // GameObject obj = EditorUtility.CreateGameObjectWithHideFlags("Text",HideFlags.None,types); // // // } // [InitializeOnLoadMethod] // static void StartInitializeOnLoadMethod() // { // EditorApplication.hierarchyWindowItemOnGUI += OnHierarchyGUI; // } // static void OnHierarchyGUI(int instanceID, Rect selectionRect) // { // Event evt = Event.current; // // Debug.LogError("kkk " + evt.button + " " + evt.type); // if (evt != null && selectionRect.Contains(evt.mousePosition) // && evt.button == 1 && evt.type == EventType.MouseDown) // { // Debug.LogError("in"); // GameObject selectedGameObject = EditorUtility.InstanceIDToObject(instanceID) as GameObject; // //这里可以判断selectedGameObject的条件 // if (selectedGameObject) // { // Debug.LogError("in2"); // Vector2 mousePosition = Event.current.mousePosition; // EditorUtility.DisplayPopupMenu(new Rect(mousePosition.x, mousePosition.y, 0, 0), "GameObject/",null); // evt.Use(); // } // } // } public override void OnInspectorGUI() { serializedObject.Update(); UI_Text text = target as UI_Text; text.mTextStr = EditorGUILayout.TextField("Text", text.mTextStr); if (this.mTextStr != text.mTextStr) { this.mTextStr = text.mTextStr; // TextManager.instance.LoadLanguage(TextManager.CN); // text.SetText(text.mTextStr); } if (GUILayout.Button("Change text")) { TextManager.instance.LoadLanguage(TextManager.LANGUAGE.CN); text.SetText(text.mTextStr); } serializedObject.ApplyModifiedProperties(); }
public void OnValueChange(string value) { if (inputText) { inputText = false; return; } inputText = true; //Display the string. stringTracker++; string display = workString.Substring(0, Mathf.Min(stringTracker * 4, workString.Length - 1)); inputTextField.text = display; inputTextField.caretPosition = stringTracker * 4; //Handle player sound if (enumerator != null) { StopAllCoroutines(); } StartCoroutine(PlayerKeyDown()); //update progress bar UI_Text tx = new UI_Text { text = "WORK HARDER", font = office_Font, progress = (stringTracker / 50f) }; FFMessage <UI_Text> .SendToLocal(tx); //Check for button interactable condition if (stringTracker > game_end_string_length) { end_game_button.interactable = true; } else { end_game_button.interactable = false; } }
void LoadUI() { main_window = new UI_Window(this); { grid = new UI_Grid(new Point(15, 15), 470, 405); grid.AddColumn("Nom", 150, true); grid.AddColumn("Num registre", 150, true); grid.AddColumn("Fórmula", 180, true); grid.AddColumn("id", 120, true, false); grid.GetElement().Click += new System.EventHandler(this.AdobClick); grid.SetFont("Courier New", 8.5f); main_window.AddElement(grid); elimina_button = new UI_Button(new Point(293, 431), 120, 25, "Elimina adob"); elimina_button.GetElement().Click += new System.EventHandler(this.Elimina); elimina_button.AddImage(principal.imageList1, 3); elimina_button.SetFont("Courier New", 8.5f); main_window.AddElement(elimina_button); actualitza_button = new UI_Button(new Point(143, 431), 140, 25, "Actualitza adob"); actualitza_button.GetElement().Click += new System.EventHandler(this.Actualitza); actualitza_button.AddImage(principal.imageList1, 8); actualitza_button.SetFont("Courier New", 8.5f); main_window.AddElement(actualitza_button); crea_button = new UI_Button(new Point(14, 431), 120, 25, "Crea adob"); crea_button.GetElement().Click += new System.EventHandler(this.Crea); crea_button.AddImage(principal.imageList1, 6); crea_button.SetFont("Courier New", 8.5f); main_window.AddElement(crea_button); accepta_button = new UI_Button(new Point(845, 431), 110, 25, "Desa i surt"); accepta_button.GetElement().Click += new System.EventHandler(this.Accepta); accepta_button.AddImage(principal.imageList1, 2); accepta_button.SetFont("Courier New", 8.5f); accepta_button.SetColor(Color.Cornsilk); main_window.AddElement(accepta_button); nom_text = new UI_Text(new Point(500, 15), 150, 30, "Nom"); nom_text.SetFont("Courier New", 8.5f); main_window.AddElement(nom_text); nom_text_input = new UI_MaskedTextInput(new Point(500, 40), 200, 50); nom_text_input.SetFont("Courier New", 8.5f); main_window.AddElement(nom_text_input); num_registre_text = new UI_Text(new Point(750, 15), 150, 30, "Num registre"); num_registre_text.SetFont("Courier New", 8.5f); main_window.AddElement(num_registre_text); num_registre_input = new UI_MaskedTextInput(new Point(750, 40), 200, 50); num_registre_input.SetFont("Courier New", 8.5f); main_window.AddElement(num_registre_input); formula_text = new UI_Text(new Point(500, 85), 150, 30, "Fórmula"); formula_text.SetFont("Courier New", 8.5f); main_window.AddElement(formula_text); formula_text_input = new UI_MaskedTextInput(new Point(500, 110), 450, 50); formula_text_input.SetFont("Courier New", 8.5f); main_window.AddElement(formula_text_input); } }
void LoadUI() { main_window = new UI_Window(this); { grid = new UI_Grid(new Point(15, 15), 470, 405); grid.AddColumn("Tipus", 150, true); grid.AddColumn("Data compra", 150, true); grid.AddColumn("ROMA", 120, true); grid.AddColumn("Darrera inspecció", 120, true); grid.AddColumn("id", 120, true, false); grid.GetElement().Click += new System.EventHandler(this.MaquinaClick); grid.SetFont("Courier New", 8.5f); main_window.AddElement(grid); elimina_button = new UI_Button(new Point(14, 431), 140, 25, "Elimina màquina"); elimina_button.GetElement().Click += new System.EventHandler(this.Elimina); elimina_button.AddImage(principal.imageList1, 3); elimina_button.SetFont("Courier New", 8.5f); main_window.AddElement(elimina_button); actualitza_button = new UI_Button(new Point(163, 431), 160, 25, "Actualitza màquina"); actualitza_button.GetElement().Click += new System.EventHandler(this.Actualitza); actualitza_button.AddImage(principal.imageList1, 8); actualitza_button.SetFont("Courier New", 8.5f); main_window.AddElement(actualitza_button); crea_button = new UI_Button(new Point(333, 431), 130, 25, "Crea màquina"); crea_button.GetElement().Click += new System.EventHandler(this.Crea); crea_button.AddImage(principal.imageList1, 6); crea_button.SetFont("Courier New", 8.5f); main_window.AddElement(crea_button); accepta_button = new UI_Button(new Point(845, 431), 110, 25, "Desa i surt"); accepta_button.AddImage(principal.imageList1, 2); accepta_button.SetFont("Courier New", 8.5f); accepta_button.SetColor(Color.Cornsilk); accepta_button.GetElement().Click += new System.EventHandler(this.Accepta); main_window.AddElement(accepta_button); propietari_text = new UI_Text(new Point(500, 15), 150, 30, "Propietari"); propietari_text.SetFont("Courier New", 8.5f); main_window.AddElement(propietari_text); propietari_combo = new UI_ComboBox(new Point(500, 45), 200, 40); propietari_combo.SetFont("Courier New", 8.5f); main_window.AddElement(propietari_combo); tipus_text = new UI_Text(new Point(500, 85), 150, 30, "Tipus màquinaria"); tipus_text.SetFont("Courier New", 8.5f); main_window.AddElement(tipus_text); tipus_text_input = new UI_MaskedTextInput(new Point(500, 110), 200, 50); tipus_text_input.SetFont("Courier New", 8.5f); main_window.AddElement(tipus_text_input); data_text = new UI_Text(new Point(750, 85), 150, 30, "Data Compra"); data_text.SetFont("Courier New", 8.5f); main_window.AddElement(data_text); data_data = new UI_DateSelect(new Point(750, 110), 200, 50); data_data.SetFont("Courier New", 8.5f); main_window.AddElement(data_data); roma_text = new UI_Text(new Point(500, 155), 150, 30, "Número ROMA"); roma_text.SetFont("Courier New", 8.5f); main_window.AddElement(roma_text); roma_text_input = new UI_MaskedTextInput(new Point(500, 180), 200, 50); roma_text_input.SetFont("Courier New", 8.5f); main_window.AddElement(roma_text_input); inspeccio_text = new UI_Text(new Point(750, 155), 150, 30, "Darrera inspecció"); inspeccio_text.SetFont("Courier New", 8.5f); main_window.AddElement(inspeccio_text); inspeccio_data = new UI_DateSelect(new Point(750, 180), 200, 50); inspeccio_data.SetFont("Courier New", 8.5f); main_window.AddElement(inspeccio_data); tipus_panel = new UI_Panel(new Point(500, 220), 400, 100); tipus_panel.SetFont("Courier New", 8.5f); main_window.AddElement(tipus_panel); propia_radiobutton = new UI_RadioButton(new Point(0, 0), "Propia"); propia_radiobutton.SetFont("Courier New", 8.5f); tipus_panel.AddElement(propia_radiobutton); llogada_radiobutton = new UI_RadioButton(new Point(130, 0), "Llogada"); llogada_radiobutton.SetFont("Courier New", 8.5f); tipus_panel.AddElement(llogada_radiobutton); } }
void LoadUI() { main_window = new UI_Window(this); { grid = new UI_Grid(new Point(15, 15), 470, 405); grid.AddColumn("Nom", 150, true); grid.AddColumn("NIF", 150, true); grid.AddColumn("Núm aplicador", 70, true); grid.AddColumn("Qualificació", 120, true); grid.AddColumn("id", 120, true, false); grid.GetElement().Click += new System.EventHandler(this.PersonalClick); grid.SetFont("Courier New", 8.5f); main_window.AddElement(grid); elimina_button = new UI_Button(new Point(337, 431), 140, 25, "Elimina persona"); elimina_button.GetElement().Click += new System.EventHandler(this.Elimina); elimina_button.AddImage(principal.imageList1, 3); elimina_button.SetFont("Courier New", 8.5f); main_window.AddElement(elimina_button); actualitza_button = new UI_Button(new Point(153, 431), 175, 25, "Actualitza persona"); actualitza_button.GetElement().Click += new System.EventHandler(this.Actualitza); actualitza_button.AddImage(principal.imageList1, 8); actualitza_button.SetFont("Courier New", 8.5f); main_window.AddElement(actualitza_button); crea_button = new UI_Button(new Point(14, 431), 130, 25, "Crea persona"); crea_button.GetElement().Click += new System.EventHandler(this.Crea); crea_button.AddImage(principal.imageList1, 6); crea_button.SetFont("Courier New", 8.5f); main_window.AddElement(crea_button); accepta_button = new UI_Button(new Point(845, 431), 110, 25, "Desa i surt"); accepta_button.GetElement().Click += new System.EventHandler(this.Accepta); accepta_button.AddImage(principal.imageList1, 2); accepta_button.SetFont("Courier New", 8.5f); accepta_button.SetColor(Color.Cornsilk); main_window.AddElement(accepta_button); propietari_text = new UI_Text(new Point(500, 15), 150, 30, "Propietari"); propietari_text.SetFont("Courier New", 8.5f); main_window.AddElement(propietari_text); propietari_combo = new UI_ComboBox(new Point(500, 45), 200, 40); propietari_combo.SetFont("Courier New", 8.5f); main_window.AddElement(propietari_combo); nom_text = new UI_Text(new Point(500, 85), 150, 30, "Nom"); nom_text.SetFont("Courier New", 8.5f); main_window.AddElement(nom_text); nom_text_input = new UI_MaskedTextInput(new Point(500, 110), 200, 50); nom_text_input.SetFont("Courier New", 8.5f); main_window.AddElement(nom_text_input); nif_text = new UI_Text(new Point(750, 85), 150, 30, "NIF"); nif_text.SetFont("Courier New", 8.5f); main_window.AddElement(nif_text); nif_text_input = new UI_MaskedTextInput(new Point(750, 110), 200, 50); nif_text_input.SetFont("Courier New", 8.5f); main_window.AddElement(nif_text_input); num_carnet_text = new UI_Text(new Point(500, 155), 150, 30, "Num aplicador"); num_carnet_text.SetFont("Courier New", 8.5f); main_window.AddElement(num_carnet_text); num_carnet_text_input = new UI_MaskedTextInput(new Point(500, 180), 200, 50); num_carnet_text_input.SetFont("Courier New", 8.5f); main_window.AddElement(num_carnet_text_input); qualificacio_text = new UI_Text(new Point(750, 155), 150, 30, "Nivell qualificació"); qualificacio_text.SetFont("Courier New", 8.5f); main_window.AddElement(qualificacio_text); qualificacio_text_input = new UI_MaskedTextInput(new Point(750, 180), 200, 50); qualificacio_text_input.SetFont("Courier New", 8.5f); main_window.AddElement(qualificacio_text_input); tipus_panel = new UI_Panel(new Point(500, 210), 400, 100); main_window.AddElement(tipus_panel); propi_radiobutton = new UI_RadioButton(new Point(0, 0), "Propi"); propi_radiobutton.SetFont("Courier New", 8.5f); tipus_panel.AddElement(propi_radiobutton); contractat_radiobutton = new UI_RadioButton(new Point(130, 0), "Contractat"); contractat_radiobutton.SetFont("Courier New", 8.5f); tipus_panel.AddElement(contractat_radiobutton); serveis_radiobutton = new UI_RadioButton(new Point(260, 0), "Serveis"); serveis_radiobutton.SetFont("Courier New", 8.5f); tipus_panel.AddElement(serveis_radiobutton); } }