using UnityEngine; using System.Globalization; using UnityEngine.UI; using AutoTiling; using System.Collections; using System; using TMPro; using System.Collections.Generic; public class DOIT : MonoBehaviour { public static void DeleteAllUIElementsStartingFrom(string path, VisualElementUI firstElement) { if (firstElement == VisualElementUI.Filters) { DELETEAllChild("PNL/" + path + "/" + Define.UIElementCategory[VisualElementUI.Filters] + "/Viewport/Content"); } if (firstElement == VisualElementUI.Sub_Filters) { DELETEAllChild("PNL/" + path + "/" + Define.UIElementCategory[VisualElementUI.Sub_Filters] + "/Viewport/Content"); DELETEAllChild("PNL/" + path + "/" + Define.UIElementCategory[VisualElementUI.Models] + "/Viewport/Content"); DELETEAllChild("PNL/" + path + "/" + Define.UIElementCategory[VisualElementUI.TextureColors] + "/Viewport/Content"); } else if (firstElement == VisualElementUI.Models) { DELETEAllChild("PNL/" + path + "/" + Define.UIElementCategory[VisualElementUI.Models] + "/Viewport/Content"); DELETEAllChild("PNL/" + path + "/" + Define.UIElementCategory[VisualElementUI.TextureColors] + "/Viewport/Content"); } else if (firstElement == VisualElementUI.TextureColors) { DELETEAllChild("PNL/" + path + "/" + Define.UIElementCategory[VisualElementUI.TextureColors] + "/Viewport/Content"); } } public static void DELETEAllChild(string path) { GameObject pathGameObject = GameObject.Find(path); if (pathGameObject == null) return; foreach (Transform obj in pathGameObject.transform) { obj.gameObject.SetActive(true); } GameObject PAPA = GameObject.Find(path).gameObject; for (int i = PAPA.transform.childCount - 1; i >= 0; i--) { GameObject.DestroyImmediate(PAPA.transform.GetChild(i).gameObject); } } public static void DELETEAllChild(Transform parent) { if (parent == null) return; //foreach (Transform obj in parent) //{ // obj.gameObject.SetActive(true); //} for (int i = parent.childCount - 1; i >= 0; i--) { DestroyImmediate(parent.transform.GetChild(i).gameObject); } } public static void DELETEAllChildName(Transform parent,List ListName) { if (parent == null) return; for (int i = parent.childCount - 1; i >= 0; i--) { GameObject Object=parent.transform.GetChild(i).gameObject; if(ListName.Contains(Object.name))DestroyImmediate(Object); } } public static void DELETEAllObjectChild(GameObject O) { foreach (Transform obj in O.transform) { obj.gameObject.SetActive(true); } GameObject PAPA = O.gameObject; for (int i = PAPA.transform.childCount - 1; i >= 0; i--) { GameObject.DestroyImmediate(PAPA.transform.GetChild(i).gameObject); } } public static void ResetRoomSelect() { //print("-----ResetRoomSelect----"); // if (_G.SHADEWALL == null) _G.SHADEWALL = Resources.Load("MATERIALS/SHADEWALL") as Material; Material mat = _G.INV; //_G.SHADEWALL; mat.mainTextureScale = new Vector2(1.0f, 1.0f); for (int i = 1; i < _G.NW + 1; i++) { string str = "m" + i.ToString(); if (GameObject.Find(str)) { // Color c=GameObject.Find(str.Replace("m","w")).transform.Find("s1").GetComponent().material.color; //c.a=0.5f; GameObject.Find(str).GetComponent().material = mat; //GameObject.Find(str).GetComponent().material.color=c; } } if(_G.CeilingPoints !=null){ for(int i=0; i<_G.CeilingPoints.Length; i++) { if (GameObject.Find("sceil"+i.ToString())) { GameObject.Find("sceil"+i.ToString()).GetComponent().material = mat; GameObject.Find("sceil"+i.ToString()).GetComponent().material.mainTextureScale = new Vector2(1.0f, 1.0f); } } } if (GameObject.Find("sfloor")) { GameObject.Find("sfloor").GetComponent().material =_G.INV; GameObject.Find("sfloor").GetComponent().material.mainTextureScale = new Vector2(1.0f, 1.0f); } PAINT.SEL = ""; } public static void AllWall() { float mesx = 0; for (int i = 1; i < _G.NW + 1; i++) { string str = "m" + i.ToString(); if (GameObject.Find(str)) { mesx = getWallWide(str); GameObject Wall = Get.o1(str); //GameObject.Find(str).gameObject; Wall.GetComponent().material = _G.MESH; DOIT.SetSizeTex(Wall, 60f, 60f, 0, 0, 0, 0, 90, 90); //GameObject.Find(str).GetComponent().material.mainTextureScale = new Vector2(mesx / 12f, _G.HEIGHT / 12f); } } } public static void CloseALLPNL() { GameObject[] pnl = GameObject.FindGameObjectsWithTag("pnl"); foreach (GameObject p in pnl) { p.gameObject.SetActive(false); } GameObject[] menu = GameObject.FindGameObjectsWithTag("Menu"); foreach (GameObject m in menu) { m.gameObject.SetActive(false); } GameObject[] btn = GameObject.FindGameObjectsWithTag("btnAround"); foreach (GameObject i in btn) { //print(i.name); if (i.transform.Find("Image")) { if (i.transform.Find("Image").gameObject.activeSelf) { i.transform.Find("Image").gameObject.SetActive(false); if (i.transform.Find("Image1")) i.transform.Find("Image1").gameObject.SetActive(true); ButtonControl.BtnAround(i.name); } } } GameObject pnlGameObject = GameObject.Find("PNL"); if (pnlGameObject) pnlGameObject.transform.Find("SAVEWEBpnl").transform.GetComponent().alpha = 1; GameObject hider = GameObject.Find("HIDER"); if (hider) hider.transform.Find("LOADpnl").transform.GetComponent().alpha = 1; ResetRoomSelect(); SceneModeManager.SelectedName = ""; SceneModeManager.Instance.SetSceneMode(SceneModes.Navigate); _G.PNL = ""; _G.NAVIGATE = true; AllSelOff(); Set.alpha(Get.o2("Canvas","Language"),true); } public static void CloseALLPNLONLY() { GameObject[] pnl; pnl = GameObject.FindGameObjectsWithTag("pnl"); foreach (GameObject p in pnl) { p.SetActive(false); } GameObject[] menu; menu = GameObject.FindGameObjectsWithTag("Menu"); foreach (GameObject m in menu) { m.SetActive(false); } if (GameObject.Find("SAVEWEBpnl")) GameObject.Find("SAVEWEBpnl").transform.GetComponent().alpha = 1; if (GameObject.Find("LOADpnl")) GameObject.Find("LOADpnl").transform.GetComponent().alpha = 1; } public static void CloseALLMenu() { GameObject[] pnl; pnl = GameObject.FindGameObjectsWithTag("Menu"); foreach (GameObject p in pnl) { p.SetActive(false); } } public static void disableActionsDropdown() { GameObject.Find("HIDER").transform.Find("SELECT").gameObject.SetActive(false); } public static void AllSelOff() { for (var i = 0; i < _G.OBJnum + 1; i++) { if (!exist(i, out Transform sceneObject)) continue; //string name = _G.OBJs[i][0]; if (sceneObject.gameObject.layer != 2 ) { Set.Layer(sceneObject.gameObject, 0); } if (_G.Redflag) { if (!Collision.checkBool(i) && _G.Redflag) { sceneObject.GetComponent().material = _G.INV; continue; } } if (!_G.Redflag && !_G.SELECEDLIST.Contains(sceneObject.name)) { sceneObject.GetComponent().material = _G.INV; continue; } if (_G.SELECEDLIST.Contains(sceneObject.name)) { sceneObject.GetComponent().material = _G.GBT; continue; } if (_G.GHOSTLIST.Contains(sceneObject.name)) { sceneObject.GetComponent().material = _G.GBT; continue; } sceneObject.GetComponent().material = _G.GRT; } Mesure.Hide(); } public static void AllTogchildfalse(GameObject O) { foreach (Transform obj in O.transform) { //print("obj.name==1="+obj.name); if (obj.name.IndexOf("k") == -1 && obj.name != "-1" ) { //print("obj.name==2="+obj.name); obj.gameObject.GetComponent().isOn = false; } } } public static void AllChildOff(GameObject O) { for (int i = 0; i < O.transform.childCount; i++) { O.transform.GetChild(i).gameObject.SetActive(false); } } public static void AllChildON(GameObject O) { for (int i = 0; i < O.transform.childCount; i++) { O.transform.GetChild(i).gameObject.gameObject.SetActive(true); } } public static void ResetRoom() { CloseALLPNL(); AllSelOff(); GameObject.Find("HIDER").transform.Find("LoadingCircle").gameObject.SetActive(false); } public static void meshlight() { //print("SceneModeManager.SelectedName===="+SceneModeManager.SelectedName); if (SceneModeManager.SelectedName!= "") { int ADN = Get.GetObjectIndex(SceneModeManager.SelectedName); float mesx; float mesz; string str; if (_G.OBJs[ADN][22] != SceneModeManager.Floor.name && _G.OBJs[ADN][22] != SceneModeManager.Ceil.name) { int Wallnum = int.Parse(_G.OBJs[ADN][22][1..]); str = "m" + Wallnum.ToString(); mesz = _G.HEIGHT; mesx = getWallWide(_G.OBJs[ADN][22].Replace("w", "m")); } else { str = "s" + _G.OBJs[ADN][22]; } //sceil if(str=="sceil") { for(int i=0; i<_G.CeilingPoints.Length; i++) { AddMeshMaterial(str+i.ToString()); } } else { AddMeshMaterial(str); } } } public static void AddMeshMaterial(string str) { GameObject Wall = Get.o1(str); //GameObject.Find(str).gameObject; Wall.GetComponent().material = _G.MESH; SetSizeTex(Wall, 60f, 60f, 0, 0, 0, 0, 90, 90); } public static float xfzf(string xz) { float f = 1; GameObject sel = GameObject.Find(SceneModeManager.SelectedName); int IN = Get.GetObjectIndex(SceneModeManager.SelectedName); int Wallnum = int.Parse(_G.OBJs[IN][22].Substring(1, 1)); GameObject wall = GameObject.Find("w" + Wallnum.ToString()); float Ww = 0; float a = 0; for (int i = 1; i < _G.NW + 1; i++) { if (Wallnum == i) { Ww = _G.WallsWidth[i - 1]; a = _G.WallsAngle[i - 1]; } } float xf = Mathf.Cos(a * Mathf.Deg2Rad); float zf = Mathf.Sin(a * Mathf.Deg2Rad); if (xz == "x") f = xf; if (xz == "z") f = zf; if (xz == "ww") f = Ww; return f; } public static float GetScenePos(string v, float os) { float value = 0; if (PAINT.SEL == "floor" || PAINT.SEL == "ceil") { return 0; } else { int wn = int.Parse(PAINT.SEL[1..]); float ry = _G.WallsAngle[wn - 1]; GameObject Wall = Get.o1("ROOM/w" + wn.ToString()); Vector3 Wallposition = Wall.transform.position; Vector3 newPos = Wall.transform.forward * os * -1f + Wallposition; if (v == "px") { value = newPos.x; } if (v == "pz") { value = newPos.z; } if (v == "ry") { value = ry; } } return value; } public static int GetWallAngle() { int ON = Get.GetObjectIndex(SceneModeManager.SelectedName); int Wallnum = int.Parse(_G.OBJs[ON][22].Substring(1, 1)); int num = 0; GameObject wall = GameObject.Find("w" + Wallnum.ToString()); Vector3 ANGLE = wall.transform.eulerAngles; num = (int)(ANGLE.y); return num; } public static float getPn(string p) {//Position xyz of wall int nO = int.Parse(SceneModeManager.SelectedName[4..]); int Wallnum = int.Parse(_G.OBJs[nO][22].Substring(1, 1)); float num = 0; GameObject wall = GameObject.Find("w" + Wallnum.ToString()); Vector3 pos = wall.transform.position; if (p == "x") num = pos.x; if (p == "y") num = pos.y; if (p == "z") num = pos.z; return num; } public static float getCabPos(string v) { GameObject T = GameObject.Find(_G.TARGET); Vector3 pos = T.transform.position; Quaternion rot = T.transform.rotation; float px = pos.x; float py = pos.y; float pz = pos.z; float rx = rot.x; float ry = rot.y; float rz = rot.z; float value = 0; if (v == "px") value = px; if (v == "py") value = py; if (v == "pz") value = pz; if (v == "rx") value = rx; if (v == "ry") value = ry; if (v == "rz") value = rz; return value; } public static float getWallWide(string W) { int nW = int.Parse(W[1..]); float Wide = _G. WallsWidth[nW - 1]; return Wide; } //----------------------------------------------------------------------------------------------------------------------------// //---------------------------------------------------------Check------------------------------------------------------------// //----------------------------------------------------------------------------------------------------------------------------// public static void SetAlignPNL() { GameObject ALIGN = GameObject.Find("HIDER").transform.Find("ALIGN").transform.Find("Abtn").gameObject; int nt = int.Parse(_G.TARGET[4..]); //int nO = int.Parse(SceneModeManager.SelectedName.Substring(4, SceneModeManager.SelectedName.Length - 4)); bool Ax = DOIT.CheckAxe( "X"); bool Ay = DOIT.CheckAxe( "Y"); bool Az = DOIT.CheckAxe( "Z"); for (int i = 0; i < ALIGN.transform.childCount; i++) { ALIGN.transform.GetChild(i).gameObject.SetActive(true); } if (_G.OBJs[nt][22] != "floor") { if (Ay == false) { ALIGN.transform.Find("AL").gameObject.SetActive(false); ALIGN.transform.Find("AC").gameObject.SetActive(false); ALIGN.transform.Find("AR").gameObject.SetActive(false); } if (Ax == false && Az == false) { ALIGN.transform.Find("AB").gameObject.SetActive(false); ALIGN.transform.Find("ACH").gameObject.SetActive(false); ALIGN.transform.Find("AT").gameObject.SetActive(false); } //if (Ax == false && Ay == true && Az == false) { ALIGN.transform.Find("AT").gameObject.SetActive(false); ALIGN.transform.Find("ACH").gameObject.SetActive(false); ALIGN.transform.Find("AB").gameObject.SetActive(false); } } else if (_G.OBJs[nt][22] == "floor") { if (Ax == false && Az == true) { ALIGN.transform.Find("AT").gameObject.SetActive(false); ALIGN.transform.Find("ACH").gameObject.SetActive(false); ALIGN.transform.Find("AB").gameObject.SetActive(false); } if (Ax == true && Az == false) { ALIGN.transform.Find("AL").gameObject.SetActive(false); ALIGN.transform.Find("AC").gameObject.SetActive(false); ALIGN.transform.Find("AR").gameObject.SetActive(false); } } else { GameObject.Find("HIDER").transform.Find("MESSAGE").gameObject.transform.GetChild(1).gameObject.GetComponent().text = "You have to select an object"; } } public static bool CheckAxe(string A) { GameObject T = GameObject.Find(_G.TARGET); GameObject S = GameObject.Find(SceneModeManager.SelectedName); Vector3 tPOS = T.transform.position; Vector3 sPOS = S.transform.position; Vector3 SO = S.GetComponent().bounds.size; float Owx = SO.x - 0.5f; float Ohy = SO.y - 0.5f; float Owz = SO.z - 0.5f;//Object depth Vector3 TO = T.GetComponent().bounds.size; float Twx = TO.x - 0.5f; float Thy = TO.y - 0.5f; float Twz = TO.z - 0.5f;//Object depth //Distance center float Mx = Mathf.Abs(sPOS.x - tPOS.x); float Mz = Mathf.Abs(sPOS.z - tPOS.z); float My = Mathf.Abs(sPOS.y - tPOS.y); float Ymesure = (Ohy * 0.5f + Thy * 0.5f); print("My=====" + My + " Ymesure=====" + Ymesure); if (A == "X") { return Mx >= (Owx * 0.5f + Twx * 0.5f); } if (A == "Z") { return Mz >= (Owz * 0.5f + Twz * 0.5f); } if (A == "Y") { return My >= (Ohy * 0.5f + Thy * 0.5f); } return false; } public static bool checkSpace(string TU) { //print("_G.TARGET===="+_G.TARGET); //print("SceneModeManager.SelectedName===="+SceneModeManager.SelectedName); bool t = true; GameObject tar = GameObject.Find(_G.TARGET); int ntO = Get.GetObjectIndex(_G.TARGET); Vector3 tPOS = tar.transform.position; float tpy = tPOS.y; float th = ConvertStringToNumber(_G.OBJs[ntO][7]); //GameObject sel = GameObject.Find(SceneModeManager.SelectedName).gameObject; int nsO = Get.GetObjectIndex(SceneModeManager.SelectedName); float sh = ConvertStringToNumber(_G.OBJs[nsO][7]); float sa = 0; if (TU == "T") sa = _G.HEIGHT / 2 - tpy - th / 2; if (TU == "U") sa = _G.HEIGHT / 2 + tpy - th / 2; if (sa < sh) { t = false; } return t; } public static void NoSelection(GameObject S) { for (int i = 0; i < S.transform.childCount; i++) { S.transform.GetChild(i).transform.GetComponent().isOn = false; } } //----------------------------------------------------------------------------------------------------------------------------// //---------------------------------------------------------EMPTY------------------------------------------------------------// //----------------------------------------------------------------------------------------------------------------------------// public static void BTNPNL(string tog, float size, string parent, string name, float num, float maxw, string path) { print("parent===="+parent); GameObject MODEL = Get.o1("EMPTYLpnl/" + parent); foreach (Transform child in MODEL.transform) { GameObject.Destroy(child.gameObject); } float X = 0; float Y = 0; float step = size + 10; if (maxw > num) maxw = num; float Ran = (float)num / (float)maxw; Ran = Mathf.CeilToInt(Ran); //Create BTN for (int i = 1; i < num + 1; i++) { GameObject M = (GameObject)Instantiate(GameObject.Find("HIDER").transform.Find(tog).gameObject); X = -step * maxw / 2 + (i) * step - step / 2; Y = (Ran - 1) * step / 2; if (i > maxw) { X -= step * maxw; Y -= step; } if (i > maxw * 2) { X -= step * maxw; Y -= step; } if (i > maxw * 3) { X -= step * maxw; Y -= step; } if (i > maxw * 4) { X -= step * maxw; Y -= step; } int ncat = 100; if (path.IndexOf("DESIGNER") != -1) ncat = 200; if (path.IndexOf("KNOB/") != -1) { ncat = 0; } string namepath = name; if (_G.PNLSelect == "CABBOXPNL" || _G.PNLSelect == "PanelGlobalPNL" || _G.PNLSelect == "DecoPNL") namepath = "TEXT"; M.name = name + (i + ncat).ToString(); Sprite T = Resources.Load("ICONS/" + path + namepath + (i + ncat).ToString()); //print("T path=== "+"ICONS/" + path + namepath + (i + ncat).ToString()); string pathS = "ICONS/SelectR2"; if (_G.PNLSelect == "CABDOORPNL" || _G.PNLSelect == "CABBOXPNL" || _G.PNLSelect == "PanelGlobalPNL" || _G.PNLSelect == "OGEEPNL" || _G.PNLSelect == "UNDERPNL" || _G.PNLSelect == "KickGlobalPNL" || _G.PNLSelect == "HeadPNL" || _G.PNLSelect == "DecoPNL") pathS = "ICONS/Select"; Sprite S = Resources.Load(pathS); M.transform.Find("Background").GetComponent().sprite = T; M.transform.Find("Background/Checkmark").GetComponent().sprite = S; M.SetActive(true); M.transform.localScale = new Vector3(size / 100, size / 100, 1); M.transform.SetSiblingIndex(0); M.transform.SetParent(MODEL.transform, false); M.transform.localPosition = new Vector3(X, Y, 1); } } public static void BTNCAT(string CAT, float Num, string n1, string n2, string n3, string n4, string n5, string n6) { //Empty Category GameObject C = GameObject.Find("CATEGORY"); foreach (Transform child in C.transform) { child.gameObject.name = "destroy"; GameObject.Destroy(child.gameObject); } //Create BTN if (n1 != "") addBTNCAT(n1); if (n2 != "") addBTNCAT(n2); if (n3 != "") addBTNCAT(n3); if (n4 != "") addBTNCAT(n4); if (n5 != "") addBTNCAT(n5); if (n6 != "") addBTNCAT(n6); if (Num == 1) { GameObject.Find(n1).transform.localPosition = new Vector3(0, 0, 1); } if (Num == 2) { GameObject.Find(n1).transform.localPosition = new Vector3(-65, 0, 1); GameObject.Find(n2).transform.localPosition = new Vector3(65, 0, 1); } if (Num == 3) { GameObject.Find(n1).transform.localPosition = new Vector3(-125, 0, 1); GameObject.Find(n2).transform.localPosition = new Vector3(0, 0, 1); GameObject.Find(n3).transform.localPosition = new Vector3(125, 0, 1); } if (Num == 4) { GameObject.Find(n1).transform.localPosition = new Vector3(-195, 0, 1); GameObject.Find(n2).transform.localPosition = new Vector3(-65, 0, 1); GameObject.Find(n3).transform.localPosition = new Vector3(65, 0, 1); GameObject.Find(n4).transform.localPosition = new Vector3(195, 0, 1); } if (Num == 6) { GameObject.Find(n1).transform.localPosition = new Vector3(-325, 0, 1); GameObject.Find(n2).transform.localPosition = new Vector3(-195, 0, 1); GameObject.Find(n3).transform.localPosition = new Vector3(-65, 0, 1); GameObject.Find(n4).transform.localPosition = new Vector3(65, 0, 1); GameObject.Find(n5).transform.localPosition = new Vector3(195, 0, 1); GameObject.Find(n6).transform.localPosition = new Vector3(325, 0, 1); } } public static void addBTNCAT(string n) { GameObject Cat = (GameObject)Instantiate(GameObject.Find("HIDER").transform.Find("BTNCAT").gameObject); Cat.transform.SetParent(GameObject.Find("CATEGORY").transform, false); Cat.transform.Find("Background").transform.Find("text").gameObject.GetComponent().text = n; Cat.name = n; Cat.transform.Find("Background").transform.Find("text").name = "T_" + n; Cat.SetActive(true); Cat.transform.localPosition = new Vector3(0, 0, 1); }//Category Btn public static void Sizebackground(float NO, float maxw) { GameObject PNL = GameObject.Find("PNL").transform.Find("EMPTYLpnl").gameObject; float Wide = 200; if (NO == 2) Wide = 520; float WBG = 0;//Wide + NO * 110; if (WBG > Wide + maxw * 110) WBG = Wide + maxw * 110; WBG = Wide + maxw * 110; if (WBG < 450) WBG = 450; if (maxw == 2) WBG = 400; if (maxw == 1) WBG = 350; float HBG = 250; PNL.transform.Find("MODEL").transform.localPosition = new Vector3(0, 0, 0); if (_G.PNLSelect == "SPLASH") { HBG = 300; PNL.transform.Find("MODEL").transform.localPosition = new Vector3(0, 25, 0); } if (_G.PNLSelect == "OPENNING") { WBG = 450; } if (_G.PNLSelect == "MOLDING") { HBG = 300; WBG = 750; } if (_G.PNLSelect == "MIRROR") { WBG = 850; } if (_G.PNLSelect == "SMALLELECTRO" || _G.PNLSelect == "LAMP" || _G.PNLSelect == "STOOL" || _G.PNLSelect == "VASE") { HBG = 330; PNL.transform.Find("MODEL").transform.localPosition = new Vector3(0, 10, 0); } if (_G.PNLSelect == "OPENNING") { WBG = 450; } if (_G.PNLSelect == "HeadPNL") { WBG = 1080; } if (NO > maxw) HBG += 110; if (NO > maxw * 2) HBG += 110; if (NO > maxw * 3) HBG += 110; GameObject.Find("EMPTYLpnl").transform.Find("CATEGORY").transform.localPosition = new Vector3(0, HBG / 2 - 35, 1); PNL.transform.Find("BG").GetComponent().rectTransform.sizeDelta = new Vector2(WBG, HBG); 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); _G.PNLSelect = ""; } public static void OffMODIFYER() { GameObject MODIFY = Get.o2("EMPTYLpnl","MODIFYER"); MODIFY.transform.localPosition= new Vector3(0, 0, 1); for (int i = 0; i < MODIFY.transform.childCount; i++) { MODIFY.transform.GetChild(i).transform.gameObject.SetActive(false); } } public static float GetShine(string S) { float s = 0; if (S.IndexOf("S") != -1) s = 0.82f;//Semi| else if (S.IndexOf("M") != -1) s = 0.1f;//Mat else if (S.IndexOf("G") != -1) s = 0.95f;//Glossy return s; } public static Color GetIsColor(string S) { Color c; c = GameObject.Find(S).transform.GetComponent().material.color; return c; } public static void btnSetColor(GameObject O, string col) { ColorBlock theColor = O.GetComponent