using UnityEngine; using UnityEngine.UI; public class ButtonControl : MonoBehaviour { public GameObject MYPNL; public void PointerImage() { this.transform.Find("Image").gameObject.SetActive(true); } public void PointerEnter() { this.transform.GetChild(0).gameObject.SetActive(true); if (this.name == "DECO ITEMS" || this.name == "APPLIANCE" || this.name == "PLUMBING" || this.name == "CABINET") { GameObject.Find("DECO ITEMS").GetComponent().alpha = 1; GameObject.Find("APPLIANCE").GetComponent().alpha = 1; GameObject.Find("PLUMBING").GetComponent().alpha = 1; GameObject.Find("CABINET").GetComponent().alpha = 1; GameObject.Find("SHOWHIDE").GetComponent().alpha = 0; } if (this.name == "FILE" || this.name == "EDIT" || this.name == "2D VIEW" || this.name == "LIST ITEMS") { GameObject.Find("FILE").GetComponent().alpha = 1; GameObject.Find("EDIT").GetComponent().alpha = 1; GameObject.Find("2D VIEW").GetComponent().alpha = 1; GameObject.Find("LIST ITEMS").GetComponent().alpha = 1; GameObject.Find("SHOWHIDE").GetComponent().alpha = 0; } if (this.name == "DESIGN ROOM" || this.name == "BLOC" || this.name == "LIGHT ROOM" || this.name == "PAINTER") { GameObject.Find("DESIGN ROOM").GetComponent().alpha = 1; GameObject.Find("BLOC").GetComponent().alpha = 1; GameObject.Find("LIGHT ROOM").GetComponent().alpha = 1; GameObject.Find("PAINTER").GetComponent().alpha = 1; GameObject.Find("SHOWHIDE").GetComponent().alpha = 0; } } public void ShowTip() { this.transform.GetChild(0).gameObject.SetActive(true); } public void HideTip() { this.transform.GetChild(0).gameObject.SetActive(false); } public void DesCab() { //print("this.name===" + this.name); /* string BTNname = this.name; string NUMs="000"; if (BTNname.Length > 6) { NUMs = BTNname.Substring(BTNname.Length-3, 3); float NumN = float.Parse(NUMs)-100; NUMs = " " + NumN.ToString(); } this.transform.GetChild(0).gameObject.SetActive(true); int indexC = System.Array.IndexOf(_L.Cab, this.name); int indexO = System.Array.IndexOf(_OL.OBJ, this.name); int indexF = System.Array.IndexOf(_OF.OBJ, this.name.Substring(0,4)); string des = this.transform.GetChild(0).gameObject.transform.GetChild(0).gameObject.GetComponent().text; if (indexC != -1){ des = _L.Cab[indexC + 1 ]+"\n"+ _L.Cab[indexC + 8+_G.L] ;} if (indexF != -1) { des = _OF.OBJ[indexF + _G.L]+ NUMs; } //if (this.name.Substring(0, 4) == "BLOC") { this.transform.GetChild(0).gameObject.transform.GetChild(0).gameObject.GetComponent().text = TRANS.This("P_"+ this.name); } if (this.name.Substring(0, 4) == "AWAL") { des = TRANS.This("P_" + this.name); } if (this.name.Substring(0, 4) == "SWAL") { des = TRANS.This("P_" + this.name); } if (this.name.Substring(0, 4) == "DOOR") { des = TRANS.This("P_" + this.name); } //if (this.name.Substring(0, 4) == "WIND") { des = TRANS.This("P_" + this.name); } if (this.name.Substring(0, 4) == "MOLD") { des = TRANS.This("P_" + this.name); } if (this.name == "MOLD101") { des = TRANS.This("M_" + this.name); } if (this.name == "MOLD102") { des = TRANS.This("M_" + this.name); } if (this.name == "GLOBAL") { des = TRANS.This("T_" + this.name); } if (this.name == "NONE") { des = TRANS.This("T_" + this.name); } if (this.name == "SETCOL") { des = TRANS.This("T_" + this.name); } if (this.name == "TOPC101") { des = TRANS.This("M_" + this.name); } if (this.name == "TOPC102") { des = TRANS.This("M_" + this.name); } if (this.name == "TOPC103") { des = TRANS.This("M_" + this.name); } if (this.name == "TOPC104") { des = TRANS.This("M_" + this.name); } if (this.name == "TOPC105") { des = TRANS.This("M_" + this.name); } if (this.name == "SINK101") { des = TRANS.This("M_" + this.name); } if (this.name == "SINK102") { des = TRANS.This("M_" + this.name); } if (this.name == "SINK103") { des = TRANS.This("M_" + this.name); } if (this.name == "SINK104") { des = TRANS.This("M_" + this.name); } if (this.name == "SINK105") { des = TRANS.This("M_" + this.name); } if (this.name == "SINK106") { des = TRANS.This("M_" + this.name); } if (this.name == "BLOC101") { des = TRANS.This( this.name); } if (this.name == "BLOC102") { des = TRANS.This( this.name); } if (this.name == "BLOC103") { des = TRANS.This(this.name); } if (this.name == "BLOC104") { des = TRANS.This(this.name); } if (this.name == "BLOC105") { des = TRANS.This( this.name); } if (this.name == "BLOC106") { des = TRANS.This( this.name); } if (this.name == "PANE101") { des = TRANS.This("T_FRIDGE"); } if (this.name == "PANE102") { des = TRANS.This("T_DISHWASHER"); } if (this.name == "PANE103") { des = TRANS.This("T_ISLAND"); } if (this.name.Substring(0,4) == "DCAB") { des = TRANS.This("T_DOOR") +" "+ this.name.Substring(4, 3); } if (this.name.Substring(0, 4) == "BCAB") { des = TRANS.This("T_BOX") + " " + this.name.Substring(4, 3); } if (this.name.Substring(0, 4) == "GPNL") { des = TRANS.This("T_PANEL") + " " + this.name.Substring(4, 3); } if (this.name.Substring(0, 4) == "KICK") { des = TRANS.This("T_KICK") + " " + this.name.Substring(4, 3); } if (this.name.Substring(0, 4) == "OGEE") { des = TRANS.This("T_OGEE") + " " + this.name.Substring(4, 3); } if (this.name.Substring(0, 4) == "UNDE") { des = TRANS.This("T_UNDER") + " " + this.name.Substring(4, 3); } if (this.name.Substring(0, 4) == "HEAD") { des = TRANS.This("T_HEAD") + " " + this.name.Substring(4, 3); } this.transform.GetChild(0).gameObject.transform.GetChild(0).gameObject.GetComponent().text = des;*/ } // public void NameItem() // { // this.transform.GetChild(0).gameObject.SetActive(true); // int index = System.Array.IndexOf(_T.NameItem, this.name); // string tip = _T.NameItem[index + 1 ]; // this.transform.GetChild(0).gameObject.transform.GetChild(0).gameObject.GetComponent().text = tip; // } public void PointerExit() { this.transform.GetChild(0).gameObject.SetActive(false); if (GameObject.Find("BTN") && _G.PIN == false) { GameObject BTN = GameObject.Find("BTN").gameObject; for(int i=0; i().alpha = 0; } GameObject.Find("SHOWHIDE").GetComponent().alpha = 1; } } public void HelpShow() { GameObject.Find("ADDTO").transform.Find("TEXT").gameObject.SetActive(true); } public void HelpHide() { GameObject.Find("ADDTO").transform.Find("TEXT").gameObject.SetActive(false); } public void LanguageChange(Dropdown target) { _G.L = target.value + 1; if (GameObject.Find("HIDER").transform.Find("CONTROL").gameObject.activeInHierarchy) //TopControl.showMesure(); _G.L = target.value + 1; if (GameObject.Find("HIDER").transform.Find("CONTROL").gameObject.activeInHierarchy) { //TopControl.showMesure(); } if (GameObject.Find("FN")) { if (_G.FileName == "FN") GameObject.Find("FN").transform.GetComponent().text = TRANS.This("FN"); } } public void closeThis() { if(this.transform.parent.name=="BNT") this.transform.parent.parent.gameObject.SetActive(false); else this.transform.parent.gameObject.SetActive(false); } public void closeThisOnly(){ if (this.transform.parent.name == "BNT") this.transform.parent.parent.gameObject.SetActive(false); else this.transform.parent.gameObject.SetActive(false); } }