using UnityEngine; using UnityEngine.UI; public class STARTPNL : MonoBehaviour { float size; public void Set() { size = 100; string Cat = ""; SceneModeManager.Instance.SetSceneMode(SceneModes.Panel);//"PANEL"; //this.name; DOIT.OffMODIFYER(); int NO = 0;//Object number total _G.SC[0] = ""; string path = this.name; string NM = this.name;//.Substring(0, this.name.Length-3);//Name Model _G.PNL="Empty"; print("path===" + path); print("NM===" + NM); //alloff(); _G.addOBJ = this.name; if (this.name == "FRID") { NO = 3; } if (this.name == "STOV") { NO = 1; } if (this.name == "DISH") { NO = 1; } if (this.name == "HOOD") { NO = 1; } if (this.name == "MICR") {NO = 1; } if (this.name == "VASE") { NO = 2; } if (this.name == "SMAL") { NO = 1; } if (this.name == "PICT") { NO = 7; } if (this.name == "PLAT") { NO = 1; } if (this.name == "STOO") { NO = 1; } if (this.name == "LAMP") { NO = 1; } //CABINET if (this.name == "BASE" ) { NO = 16; Cat = "BASE"; } if (this.name == "WALL") { NO = 13; } if (this.name == "TALL") { NO = 4; size = 150; } if (this.name == "CBASE") { NO = 2; size = 150; } if (this.name == "CWALL") { NO = 2; size = 150; } //ROOM DESIGN if (this.name == "FLOOR") { _G.addOBJ = this.name; NO = 24; path = "CERAMIC"; NM = "CERA"; setCat(this.name);} GameObject PNL = GameObject.Find("PNL").transform.Find("EMPTYLpnl").gameObject; //SIZE float WBG = 200 + NO * 110; float HBG = 250; if (NO > 8) HBG += 110; if (NO > 16) HBG += 110; if (WBG > 200 + 8 * 110) WBG = 200 + 8 * 110; WBG = 200 + 8 * 110; PNL.transform.Find("BG").GetComponent().rectTransform.sizeDelta = new Vector2(WBG, HBG); //POSITION BTN GameObject.Find("X").transform.localPosition = new Vector3(WBG / 2 - 35, HBG / 2 - 30, 1); GameObject.Find("HELP").transform.localPosition = new Vector3(-WBG / 2 + 35, -HBG / 2 + 35, 1); GameObject.Find("MOVE").transform.localPosition = new Vector3(-WBG / 2 + 35, HBG / 2 - 35, 1); GameObject.Find("ADD").transform.localPosition = new Vector3(WBG / 2 - 38, -HBG / 2 + 38, 1); GameObject.Find("EMPTYLpnl").transform.Find("CATEGORY").transform.localPosition = new Vector3(0, HBG / 2 - 30, 1); //ADDING ICONS DOIT.BTNPNL("TOG1", size , "MODEL", NM, NO, 8, path + "/"); DOIT.BTNCAT(Cat, 1, Cat, "", "", "", "", ""); GameObject.Find("EMPTYLpnl").transform.Find("CATEGORY").transform.localPosition = new Vector3(0, HBG / 2 - 30, 1); } void alloff() { GameObject.Find("MODIF").transform.Find("MoW").gameObject.SetActive(false); GameObject.Find("MODIF").transform.Find("MoH").gameObject.SetActive(false); GameObject.Find("MODIF").transform.Find("MoD").gameObject.SetActive(false); GameObject.Find("MODIF").transform.Find("MoFF").gameObject.SetActive(false); GameObject.Find("MODIF").transform.Find("C1").gameObject.SetActive(false); GameObject.Find("MODIF").transform.Find("C2").gameObject.SetActive(false); } void setCat(string CAT) { GameObject.Find("EMPTYLpnl").transform.Find("CATEGORY").gameObject.SetActive(true); if (CAT == "FLOOR") { DOIT.BTNCAT(CAT, 2, "CERAMIC", "WOOD", "", "", "", ""); /*_G.FLC[6] = "0"; _G.FLC[3] = "B5B3AD"; _G.FLC[4] = "FFFFFF"; _G.FLC[1] = "48"; _G.FLC[2] = "48";*/ } } }