private void OnTouchButtonTours(object sender, TouchEventArgs e) { OpenCloseMainMenu(); UIUtils.ActivateCameraLabels(false); MenuManager.GetInstance().AddMenu(new MenuTourSelection("MenuTourSelection")); State.ChangeState(eState.Tour); }
private void Exit() { MenuManager.GetInstance().RemoveCurrentMenu(); if (this.modelNode.isBuilding) { UIUtils.ActivateCameraLabels(true); State.ChangeState(eState.Exploring); } }
private void OnCloseScrollTreeView(object sender, CloseEventArgs e) { UIUtils.DestroyChilds("MenuMain/TreeView/ScrollView", true); DeleteScrollTreeViewItem(); UIUtils.ActivateCameraLabels(false); State.ChangeState(eState.Exploring); }
private void OpenMenuBuilding(ModelNode node) { UIUtils.ActivateCameraLabels(false); var menuManager = MenuManager.GetInstance(); menuManager.AddMenu(new MenuBuilding("MenuBuilding", node)); State.ChangeState(eState.MenuBuilding); }
private void OnTouchExitButton(object sender, TouchEventArgs e) { //Delete ScrollView Childrens UIUtils.DestroyChilds("MenuTourSelection/ScrollView", true); //Remove Menu MenuManager.GetInstance().RemoveCurrentMenu(); UIUtils.ActivateCameraLabels(true); State.ChangeState(eState.Exploring); }
void Start() { MenuManager.GetInstance(); using (var service = new SQLiteService()) { } ModelPoolManager.GetInstance(); GUIInitializer(); BuildingInitializer(); ModelPoolInit(); UIUtils.ActivateCameraLabels(true); State.ChangeState(eState.Exploring); }
private void ClearSearchBoxText() { var bar = UIUtils.FindGUI(name + "/Bar").transform; bar.FindChild("ButtonFind").gameObject.SetActive(true); bar.FindChild("ButtonClearText").gameObject.SetActive(false); var searchBox = bar.FindChild("SearchBox"); searchBox.GetComponent <UIInput>().value = ""; searchBox.gameObject.SetActive(false); UIUtils.DestroyChilds(name + "/TreeView/ScrollView", true); UIUtils.FindGUI(name + "/ButtonLocateMe").SetActive(true); UIUtils.ActivateCameraLabels(true); }
private void OnTouchButtonFind(object sender, TouchEventArgs e) { var bar = UIUtils.FindGUI(name + "/Bar").transform; bar.FindChild("ButtonFind").gameObject.SetActive(false); bar.FindChild("ButtonClearText").gameObject.SetActive(true); var searchbox = bar.FindChild("SearchBox").gameObject; searchbox.SetActive(true); var scrollView = UIUtils.FindGUI(name + "/TreeView/ScrollView"); var template = Resources.Load("GUI/TreeViewScrollItem") as GameObject; scrollView.GetComponent <UIScrollViewControl>().SetTextSearch(searchbox.transform, template); UIUtils.ActivateCameraLabels(false); UIUtils.FindGUI(name + "/ButtonLocateMe").SetActive(false); }
private void OpenScrollTreeView(string searchText, Transform Parent, GameObject Template) { //Activando el ScrollTreeView //UIUtils.FindGUI("MenuMain/TreeView/ScrollView").SetActive(true); UIUtils.ActivateCameraLabels(false); var textList = new List <object>(); //Obteniendo de la Base de datos using (var sqlService = new SQLiteService()) { var sql = "SELECT nombre, idUbicacion, idNodo, edificio " + "FROM Nodo " + "WHERE idUbicacion is not null and nombre not like '%Nodo%' and nombre LIKE '%" + searchText + "%' " + "ORDER BY idUbicacion, idNodo"; using (var reader = sqlService.SelectQuery(sql)) { while (reader.Read()) { var lugar = new { nombre = Convert.ToString(reader["nombre"]), ubicacion = Convert.ToString(reader["idUbicacion"]), node = Convert.ToString(reader["idNodo"]), edificio = Convert.ToString(reader["edificio"]) }; textList.Add(lugar); } } } //Eliminando los hijos del Tree View List UIUtils.DestroyChilds("MenuMain/TreeView/ScrollView", true); //Eliminando los item del tree view de la lista de botones de MenuMain DeleteScrollTreeViewItem(); Parent.GetComponent <UIScrollView>().ResetPosition(); Parent.GetComponent <UIPanel>().clipOffset = new Vector2(2, -4.5f); Parent.localPosition = new Vector3(Parent.localPosition.x, 95.5f, Parent.localPosition.z); string edificioName = string.Empty; //Agregando los hijos al Tree View List for (int i = 0; i < textList.Count; i++) { //Creando el item del Tree View con world coordinates var item = GameObject.Instantiate(Template) as GameObject; item.transform.name = "ScrollTreeViewItem" + i; //Agregando relacion de padre (Tree View List) - hijo (item del Tree View List) item.transform.parent = Parent; //Agregando la posicion relativa del hijo con relacion al padre item.transform.localPosition = new Vector3( Template.transform.localPosition.x, Template.transform.localPosition.y - 65f * i, Template.transform.localPosition.z ); //Agregando la escala relativa del hijo con relacion al padre item.transform.localScale = Template.transform.localScale; //Encontrando texto del un item (su hijo) var itemText = item.transform.FindChild("Label").GetComponent <UILabel>(); var nombre = Convert.ToString(textList[i].GetType().GetProperty("nombre").GetValue(textList[i], null)); var ubicacion = Convert.ToInt32(textList[i].GetType().GetProperty("ubicacion").GetValue(textList[i], null)); var node = Convert.ToInt32(textList[i].GetType().GetProperty("node").GetValue(textList[i], null)); int edificio; int.TryParse(Convert.ToString(textList[i].GetType().GetProperty("edificio").GetValue(textList[i], null)), out edificio); //Si son iguales la localizacion es un nombre de un edificio if (edificio != 0) { itemText.text = nombre; edificioName = nombre; } //De lo contrario esta dentro del edificio else { //Se agrega un padding de 5 espacios itemText.text = edificioName + " - " + nombre; } var button = new Button(item.name); button.OnTouchEvent += new OnTouchEventHandler(OnTouchScrollTreeViewItem); button.ObjectTag = new ModelNode() { idNodo = node, idUbicacion = ubicacion, name = nombre, isBuilding = (edificio != 0 ? true : false) }; buttonList.Add(button); treeView.ButtonCount++; } }
private void GUIInitializer() { MenuManager.GetInstance().AddMenu(new MenuMain("MenuMain")); UIUtils.ActivateCameraLabels(true); }