using UnityEngine; using UnityEngine.UI; public class DoorSelect : MonoBehaviour { /*public void More() { alloff(); setImage(this.name); GameObject.Find("DOORpnl").transform.Find("EDITING").gameObject.SetActive(false); _G.SC[0] = ""; } public void model() { _G.SC[0] = this.name; float n = float.Parse(_G.SC[0].Substring(5, 2)); if (_G.SC[2] == "SINGLE") { _G.Ow = "32"; n=n+100; } if (_G.SC[2] == "BI-FOLD") { _G.Ow = "32"; n = n + 200; } if (_G.SC[2] == "DOUBLE") { _G.Ow = "60"; n = n + 300; } _G.SC[0] = _G.SC[0].Substring(0, 4) + n.ToString(); print(_G.SC[0]); SetEditing(); if (_G.SC[0].Substring(0, 4)=="PATI") _G.addOBJ = "pati"; if (_G.SC[0].Substring(0, 4) == "WHIT") _G.addOBJ = "door"; if (_G.SC[0].Substring(0, 4) == "WOO") _G.addOBJ = "door"; if (_G.SC[0] == "PATI101" || _G.SC[0] == "PATI102" || _G.SC[0] == "PATI103" ) _G.Ot = "2"; if (_G.SC[0] == "PATI104" || _G.SC[0] == "PATI105" || _G.SC[0] == "PATI106" ) _G.Ot = "4"; } public void MountingSet() { _G.SC[2] = this.name; float n = float.Parse(_G.SC[0].Substring(5, 2)); if (_G.SC[2] == "SINGLE") { _G.Ow = "32"; n = n + 100; } if (_G.SC[2] == "BI-FOLD") { _G.Ow = "32"; n = n + 200; } if (_G.SC[2] == "DOUBLE") { _G.Ow = "60"; n = n + 300; } _G.SC[0] = _G.SC[0].Substring(0, 4) + n.ToString(); SetEditing(); } public void molding() { _G.SC[3] = this.name; SetEditing(); } public void SetEditing() { alloff(); GameObject.Find("DOORpnl").transform.Find("EDITING").gameObject.SetActive(true); //SETTING string M = "M1"; float w = 96; float h = 190; float y = 91; float wd = 90; float wh = 180; if (_G.SC[2] == "SINGLE" && _G.SC[0].Substring(0, 4) == "WHIT" && _G.Ocat3 == "NONE") { M = "M1"; w = 92; h = 182; y = 88; } if (_G.SC[2] == "SINGLE" && _G.SC[0].Substring(0, 4) == "WHIT" && _G.Ocat3 == "STANDARD") { M = "M2"; } if (_G.SC[2] == "SINGLE" && _G.SC[0].Substring(0, 4) == "WHIT" && _G.Ocat3 == "RELIEF") { M = "M3"; } if (_G.SC[2] == "SINGLE" && _G.SC[0].Substring(0, 4) == "WOOD" && _G.Ocat3 == "NONE") { M = "M7"; w = 92; h = 182; y = 88; } if (_G.Ocat2 == "SINGLE" && _G.SC[0].Substring(0, 4) == "WOOD" && _G.Ocat3 == "STANDARD") { M = "M8"; } if (_G.Ocat2 == "SINGLE" && _G.SC[0].Substring(0, 4) == "WOOD" && _G.Ocat3 == "RELIEF") { M = "M9"; } if (_G.Ocat2 == "BI-FOLD" && _G.SC[0].Substring(0, 4) == "WHIT" && _G.Ocat3 == "NONE") { M = "M1"; w = 92; h = 182; y = 88; } if (_G.Ocat2 == "BI-FOLD" && _G.SC[0].Substring(0, 4) == "WHIT" && _G.Ocat3 == "STANDARD") { M = "M2"; w = 108; } if (_G.Ocat2 == "BI-FOLD" && _G.SC[0].Substring(0, 4) == "WHIT" && _G.Ocat3 == "RELIEF") { M = "M3"; w = 108; } if (_G.Ocat2 == "BI-FOLD" && _G.SC[0].Substring(0, 4) == "WOOD" && _G.Ocat3 == "NONE") { M = "M7"; w = 92; h = 186; y = 88; } if (_G.Ocat2 == "BI-FOLD" && _G.SC[0].Substring(0, 4) == "WOOD" && _G.Ocat3 == "STANDARD") { M = "M8"; w = 108; } if (_G.Ocat2 == "BI-FOLD" && _G.SC[0].Substring(0, 4) == "WOOD" && _G.Ocat3 == "RELIEF") { M = "M9"; w = 108; } if (_G.Ocat2 == "DOUBLE" && _G.SC[0].Substring(0, 4) == "WHIT" && _G.Ocat3 == "NONE") { M = "M4"; w = 180; h = 182; y = 90; wd = 180; } if (_G.Ocat2 == "DOUBLE" && _G.SC[0].Substring(0, 4) == "WHIT" && _G.Ocat3 == "STANDARD") { M = "M5"; w = 200; y = 90; wd = 180; } if (_G.Ocat2 == "DOUBLE" && _G.SC[0].Substring(0, 4) == "WHIT" && _G.Ocat3 == "RELIEF") { M = "M6"; w = 200; y = 90; wd = 180; } if (_G.Ocat2 == "DOUBLE" && _G.SC[0].Substring(0, 4) == "WOOD" && _G.Ocat3 == "NONE") { M = "M10"; w = 180; h = 182; y = 90; wd = 180; } if (_G.Ocat2 == "DOUBLE" && _G.SC[0].Substring(0, 4) == "WOOD" && _G.Ocat3 == "STANDARD") { M = "M11"; w = 200; y = 90; wd = 180; } if (_G.Ocat2 == "DOUBLE" && _G.SC[0].Substring(0, 4) == "WOOD" && _G.Ocat3 == "RELIEF") { M = "M12"; w = 200; y = 90; wd = 180; } //SET SELECTED Texture2D T = Resources.Load("Door/" + _G.SC[0]) as Texture2D; GameObject.Find("SELECTED").gameObject.GetComponent().texture = T; var DoorTransform = GameObject.Find("SELECTED").transform as RectTransform; DoorTransform.sizeDelta = new Vector2(wd, wh); //SET MOLDING Texture2D TM = Resources.Load("Door/" + M) as Texture2D; GameObject.Find("MOLDING").gameObject.GetComponent().texture = TM; GameObject.Find("MOLDING").transform.localPosition = new Vector3(124, y, 0); var MoldingTransform = GameObject.Find("MOLDING").transform as RectTransform; MoldingTransform.sizeDelta = new Vector2(w, h); //set text GameObject.Find("mW").transform.GetComponent().text = _G.Ow + _G.Sys; GameObject.Find("mH").transform.GetComponent().text = _G.Oh + _G.Sys; GameObject.Find("Mountingtxt").transform.GetComponent().text = _G.Ocat2; GameObject.Find("MoldingTxt").transform.GetComponent().text = _G.Ocat3; //Color if (_G.Oc1 == "") _G.Oc1 = "FFFFFF"; if (_G.Oc2 == "") _G.Oc2 = "FFFFFF"; Coloring(_G.Oc1, "SELECTED"); Coloring(_G.Oc2, "MOLDING"); //GLASS GameObject GL= GameObject.Find("DOORpnl").transform.Find("EDITING").transform.Find("GLASS").gameObject; GL.SetActive(false); if (_G.SC[0] == "WHIT115" || _G.SC[0] == "WHIT116" || _G.SC[0] == "WHIT117" || _G.SC[0] == "WHIT118" || _G.SC[0] == "WHIT215" || _G.SC[0] == "WHIT216" || _G.SC[0] == "WHIT217" || _G.SC[0] == "WHIT218" || _G.SC[0] == "WHIT315" || _G.SC[0] == "WHIT316" || _G.SC[0] == "WHIT317" || _G.SC[0] == "WHIT318"|| _G.SC[0] == "WOO116" || _G.SC[0] == "WOO117" || _G.SC[0] == "WOO118" || _G.SC[0] == "WOO216" || _G.SC[0] == "WOO217" || _G.SC[0] == "WOO218" || _G.SC[0] == "WOO316" || _G.SC[0] == "WOO317" || _G.SC[0] == "WOO318") { GL.SetActive(true); string nd = _G.SC[0] + "G"; Texture2D G = Resources.Load("Door/" + nd) as Texture2D; GameObject.Find("GLASS").gameObject.GetComponent().texture = G; var GlassTransform = GameObject.Find("GLASS").transform as RectTransform; GlassTransform.sizeDelta = new Vector2(wd, wh); } } public void ColorDoor() { _G.Oc1 = this.name; Coloring(_G.Oc1, "SELECTED"); } public void ColorMolding() { _G.Oc2 = this.name; Coloring(_G.Oc2, "MOLDING"); } public void Coloring(string c,string SM) { Color col = DOIT.CSc(c, 255); GameObject.Find(SM).gameObject.GetComponent().color = col; alloff(); } public void HelpOver() { GameObject.Find("DOORpnl").transform.Find("TEXT").gameObject.SetActive(true); } public void HelpOut() { GameObject.Find("DOORpnl").transform.Find("TEXT").gameObject.SetActive(false); } public void ShowBtn() { alloff(); //GameObject.Find("HIDER").transform.Find("MESURE").gameObject.SetActive(false); //if (this.name == "c1") { GameObject.Find("DOORpnl").transform.Find("Color1").gameObject.SetActive(true); } //if (this.name == "c2") { GameObject.Find("DOORpnl").transform.Find("Color2").gameObject.SetActive(true); } if (this.name == "Mounting") { GameObject.Find("DOORpnl").transform.Find("Mounting Selection").gameObject.SetActive(true); } if (this.name == "Molding") { GameObject.Find("DOORpnl").transform.Find("Molding Selection").gameObject.SetActive(true); } if (this.name == "c1") { GameObject.Find("DOORpnl").transform.Find("Color1").gameObject.SetActive(true); } if (this.name == "c2") { GameObject.Find("DOORpnl").transform.Find("Color2").gameObject.SetActive(true); } } public void alloff() { GameObject.Find("DOORpnl").transform.Find("Mounting Selection").gameObject.SetActive(false); GameObject.Find("DOORpnl").transform.Find("Molding Selection").gameObject.SetActive(false); GameObject.Find("DOORpnl").transform.Find("Color1").gameObject.SetActive(false); GameObject.Find("DOORpnl").transform.Find("Color2").gameObject.SetActive(false); } public void StartPNL() { alloff(); _G.Dm = "STANDARD"; GameObject.Find("DOORpnl").transform.Find("EDITING").gameObject.SetActive(false); setImage("WHIT"); _G.Ow = "32"; _G.Oh = "80"; _G.Ocat2 = "SINGLE"; _G.Ocat3 = "STANDARD"; GameObject.Find("WHIT").gameObject.GetComponent().isOn = true; _G.addOBJ = "door"; } public void setImage(string n) { alloff(); _G.SC[0] = ""; Texture2D T = Resources.Load("ICON/DOOR-" + n) as Texture2D; GameObject.Find("IMAGE").gameObject.GetComponent().texture = T; setbtn(n); _G.Ocat = "S" + n; /*if (n != "1") { GameObject.Find("FLOORpnl").transform.Find("C2").gameObject.SetActive(false); GameObject.Find("FLOORpnl").transform.Find("GROUTH").gameObject.SetActive(false); GameObject.Find("FLOORpnl").transform.Find("SIZEW").gameObject.SetActive(true); GameObject.Find("FLOORpnl").transform.Find("SIZEC").gameObject.SetActive(false); //GameObject.Find("FLOORpnl").transform.Find("LEFT").gameObject.SetActive(true); //GameObject.Find("FLOORpnl").transform.Find("RIGHT").gameObject.SetActive(false); } else { GameObject.Find("FLOORpnl").transform.Find("C2").gameObject.SetActive(true); GameObject.Find("FLOORpnl").transform.Find("GROUTH").gameObject.SetActive(true); GameObject.Find("FLOORpnl").transform.Find("SIZEC").gameObject.SetActive(true); GameObject.Find("FLOORpnl").transform.Find("SIZEW").gameObject.SetActive(false); //GameObject.Find("FLOORpnl").transform.Find("LEFT").gameObject.SetActive(false); //GameObject.Find("FLOORpnl").transform.Find("RIGHT").gameObject.SetActive(true); } } public void setbtn(string M) { int cs = 101; int ce = 18; if (M == "WHIT") { ce = 18; } if (M == "WOOD") { ce = 18; } //if (M == "PATI") { ce = 6; } if (M == "SLID") { M = "SLID"; ce = 18; } GameObject MODEL = GameObject.Find("MODEL").gameObject; for (int i = 0; i < MODEL.transform.childCount; i++) { MODEL.transform.GetChild(i).gameObject.SetActive(false); MODEL.transform.GetChild(i).GetComponent().isOn = false; } for (int i = 0; i < ce; i++) { MODEL.transform.GetChild(i).gameObject.SetActive(true); MODEL.transform.GetChild(i).name = M + (cs + i).ToString(); } }*/ }