using UnityEngine; using System.Globalization; public class CreateDECO : MonoBehaviour { public static void AddDeco() { int ind = System.Array.IndexOf(_L.Cab, _G.SC[0]); float w = DOIT.ConvertStringToNumber(_G.SC[1]); float h = DOIT.ConvertStringToNumber(_G.SC[2]); float d = DOIT.ConvertStringToNumber(_G.SC[3]); float k = 0; float ff = DOIT.ConvertStringToNumber(_G.SC[4]); float T = 0;//Counter height float os = d / 2; float t = _G.cat;//tickness float px = 0; float py = 0; float pz = 0; float rx = 0; float ry = 0; float rz = 0; if (_G.SC[0].IndexOf("BASE") != -1) { k = _G.caKH; T = _G.caCH; h = h + T; } if (_G.SC[0].IndexOf("TALL") != -1) { k = _G.caKH; } string PLR = "L";//position Left or Right if (_G.SC[0] == "CBASE101") PLR = "L"; if (_G.SC[0] == "CWALL101") PLR = "L"; if (_G.SC[0] == "CWALL103") PLR = "L"; if (_G.SC[0] == "CBASE103") PLR = "L"; //Position if (PAINT.SEL == "floor") { px = 0; pz = 0; rx = 0; ry = 0; rz = 0; } py = -_G.HEIGHT / 2 + ff + h / 2;//-_G.HEIGHT / 2-py+h/2 if (PAINT.SEL != "floor") { px = DOIT.GetScenePos("px", os); pz = DOIT.GetScenePos("pz", os); rx = DOIT.GetScenePos("rx", os); ry = DOIT.GetScenePos("ry", os); rz = DOIT.GetScenePos("rz", os); } if (SceneModeManager.CompareSceneMode(SceneModes.SnapOn)) { py = 100; px = 0; pz = 0; rx = 0; ry = 0; rz = 0; } string name = "deco" + _G.OBJnum.ToString(CultureInfo.InvariantCulture); SceneModeManager.SelectedName = name; _G.OBJs[_G.OBJnum] = new string[100]; string[] C = _G.OBJs[_G.OBJnum]; C[0] = name; C[1] = _L.Cab[ind + 1];//Model C[2] = "Deco";//Category C[3] = "UNLOCK"; //lock or unlock C[4] = _L.Cab[ind + 2]; //Category cab ex:B2 C[5] = _G.SC[0]; //Cabinet Catégorie ex BA C[6] = w.ToString(CultureInfo.InvariantCulture); C[7] = h.ToString(CultureInfo.InvariantCulture); C[8] = d.ToString(CultureInfo.InvariantCulture); C[9] = t.ToString(CultureInfo.InvariantCulture); C[10] = k.ToString(CultureInfo.InvariantCulture); C[11] = T.ToString(CultureInfo.InvariantCulture); //C[10] = _G.Ws; //C[14] = _G.Ds; C[15] = (px).ToString(CultureInfo.InvariantCulture); //pos X C[16] = (py).ToString(CultureInfo.InvariantCulture); //pos Y C[17] = (pz).ToString(CultureInfo.InvariantCulture); //pos Z C[18] = (rx).ToString(CultureInfo.InvariantCulture); //rot X C[19] = (ry).ToString(CultureInfo.InvariantCulture); //rot Y C[20] = (rz).ToString(CultureInfo.InvariantCulture); //rot Z C[21] = (ff).ToString(CultureInfo.InvariantCulture); //dis from floor C[22] = PAINT.SEL; //Wall select or floor C[23] = PLR; //Left/Right door C[24] = "0";//DOIT.getInPos(C[1]).ToString(CultureInfo.InvariantCulture);// _L.Cab[ind + 10]; //Inside height float wd = w; string[] DC1 = DC.DC1(C[1], wd, h - k - T, PLR); string[] DC2 = DC.DC2(C[1], wd, h - k - T, PLR); for (int i = 0; i < DC1.Length; i++) { C[25] = C[25] + DC1[i].ToString(CultureInfo.InvariantCulture) + ","; } for (int i = 0; i < DC2.Length; i++) { C[26] = C[26] + DC2[i].ToString(CultureInfo.InvariantCulture) + ","; } C[25] = C[25].Substring(0, C[25].Length - 1); C[26] = C[26].Substring(0, C[26].Length - 1); C[30] = "";//door patern C[31] = "";//door1 patern C[32] = "";//door3 patern C[40] = "Off"; C[50] = "NONE";//Filler Left C[51] = "NONE";//Filler Right //SPLASH C[54] = UIT.Global(Header.Splash,_G.G);//GGlobalSelectionManager.GetValue(GlobalOption.SPLA_9);//Texture C[55] = "0,0,0,0";//left,hight,right,back,Tex,sizeX,sizeY,Rot,Shine C[56] = "0,0,0,0";//left,hight,right,back,Tex,sizeX,sizeY,Rot,Shine //COUNTER TOP SIDE C[45] = "OFF";//Counter side Left ON/OFF C[46] = "OFF";//Counter side back ON/OFF C[47] = "OFF";//Counter side right ON/OFF //DOOR C[60] = "GLOBAL";//GLOBAL/UNIQUE C[61] = UIT.Global(Header.Door,_G.G);//GlobalSelectionManager.GetValue(GlobalOption.DOORCAB_0); ;//Door cabinet code C[62] = UIT.Global(Header.Int,_G.G);//GlobalSelectionManager.GetValue(GlobalOption.INTPNL_1);//_G.BINT;//BOX color code C[64] = UIT.Global(Header.Ogee,_G.G);//GlobalSelectionManager.GetValue(GlobalOption.OGEE_5); C[66] = "HEAD000,0,FFFFFF,r0,S";//HEAD color code //MOLDING C[70] = "m1,0,m3,m4,0,0";//Ogee "m1,m2,m3,m4,0,0" C[71] = "0,0,0,0,0,0";//Under "Um1,Um2,Um3,Um4,Um5,Um6" C[72] = "Hm1,Hm2,Hm3,Hm4,Hm5,Hm6";//Head "Hm1,Hm2,Hm3,Hm4,Hm5,Hm6" C[73] = "0,0,0,0,0,0";//Ogee Anchor point ofset C[89] = C[0];//Groupe string ConstructDECO.AddObject(_G.nO); _G.OBJnum += 1; } }