using System.Collections.Generic; using UnityEngine; public class ConstructCORNERBASE : MonoBehaviour { //VARIABLES static string[] C;//CODE CABINET ADN //static string Name; static int nO;//Number of the cabinet Object static float W; static float HB;//HB HEIGHT BOX ONLY static float HBK;//HBK HEIGHT BOX WITH KICK static float HBKT;//HBKT HEIGHT BOX WITH KICK AND TOP static float DoorThickness;//door thickness static string DTvalue;//door thickness fron csv static float DB;//Depth Box static float DBD;//Depth Box+Door static float DBC;//Depth Box+Counter Projection static float DW;//Door wide static float DW2;//Door wide static float K;//KICK HEIGHT static float kf;//Kick Front projection static float t ;//tickness panels static float px;//Cabinet position x static float py;//Cabinet position y static float pz;//Cabinet position z static float rx;//Cabinet rotation angle X static float ry;//Cabinet rotation angle Y static float rz;//Cabinet rotation angle Z static float kfl;//kick front left static float kfr;//kick front right static float fw50;//Filler Right static float fw51;//Filler Left //static string[] CP;//Counter projection static float T;//Counter Top Height static float pf;//Projection front static float pb;//Projection back static float pl;//Projection left static float pr;//Projection right static float pbr;//Projection back right static float pbl;//Projection back left static float pfcab;//Matching Counter depth static float sl;//Side left wide for corner cabinet static float sr;//Side right wide for corner cabinet static float dr;//Door wide right static float dl;//Door wide left static float PosyC;//Counter Y position static float PosyS;//Side panel Y position static float PosyK;//Kick Y position static float OS1;//Offset on left sidePosY static float OS2;//Offset on back static float OS3;//Offset on right side static float OS4;//Offset on front static float OY;//Offset Y position static float RL;//Retraction Left static float RR;//Retraction Right static float RBL;//Retraction back Left static float RBR;//Retraction back Right static float RB;//Retraction Back static float Kw;//Kick Wide static float Back45;//Back static Vector3 Kpos;//Kick position static string Captext;//Caps to add on static string texshelf;//Texture shelf static string[] codeD1;//Code poatern door 1 static string[] codeD2;//Code poatern door 1 static string[] KT;//Kick Texture static string[] CK;//CODE KICK static string[] C39;//Retraction kick static Material BLACK_G;//Material for leg static Vector3 P1,P2,P3,P4,P5,P6,P7,P8;//Position points static Vector3 Pf50;//Kick left point position when filler static Vector3 Pf51;//Kick right point position when filler static float of;//Value for offset setting static GameObject BASE; static GameObject S1,S2,S3,S4,S5;//Side Panels static GameObject S1B,S2B,S3B,S4B,S5B;//Side Panels bottom static GameObject K1,K2,K3,K4,K5,K6,K7,K8;//Kicks GameObject static GameObject TOP;//Panel on Top under countertop static GameObject UNDER;//Panel under cabinet static GameObject COUNTER;//Countertop GameObject static GameObject COUNTER2;//Countertop GameObject static GameObject KICK; static GameObject FL,FR;//Filler left and right static string[] SideModel; static Vector3 CenterBox,VolumeBase; static float backBox,frontBox,leftBox,rightBox,valueX,valueZ; static float BaseDeptCabinet; static GameObject DOOR1,DOOR2; public static void AddCab(int numO)//, string Name, float W, float H, float D, float T, float K, float ff, float px, float py, float pz, float rx, float ry, float rz) { fw50=0; fw51=0; nO=numO; C = _G.OBJs[nO]; //print("C[41]====" + C[41]); //Back 45 panel string Back45string=UIT.Value(Library.Cabinet,C[1],Header.BA); if(Back45string=="")Back45=0; Back45=DOIT.ConvertStringToNumber(Back45string); //SETTING DOOR THICKNESS DoorThickness = Get.DoorThickness(nO); of =t*0.5f; BaseDeptCabinet=_P.Listfloat["BASE_DEPTH"]; //SETTING SIZES W = DOIT.ConvertStringToNumber(C[6]); HB = DOIT.ConvertStringToNumber(C[7]) - DOIT.ConvertStringToNumber(C[10]);//HB HEIGHT BOX HBK = DOIT.ConvertStringToNumber(C[7]);//HBK HEIGHT BOX WITH KICK HBKT = DOIT.ConvertStringToNumber(C[7]) + DOIT.ConvertStringToNumber(C[11]);//HBKT HEIGHT BOX WITH KICK AND TOP DB = DOIT.ConvertStringToNumber(C[8]);//Depth Box DBD = DB + DoorThickness ;//Depth Box+Door //DBC = DB + DOIT.ConvertStringToNumber(C[42].Split('_')[4]);//Depth Box+Door+Counter Projection t = DOIT.ConvertStringToNumber(C[9]);//tickness panels sl = DOIT.ConvertStringToNumber(C[28]);//Side left wide for corner cabinet sr = DOIT.ConvertStringToNumber(C[29]);//Side right wide for corner cabinet dr = DB - sr; dl = W - sl; //SETTING POSITION CABINET px = DOIT.ConvertStringToNumber(C[15]); py = DOIT.ConvertStringToNumber(C[16]); pz = DOIT.ConvertStringToNumber(C[17]); rx = DOIT.ConvertStringToNumber(C[18]); ry = DOIT.ConvertStringToNumber(C[19]); rz = DOIT.ConvertStringToNumber(C[20]); KICK = new ("KICK"); K = DOIT.ConvertStringToNumber(C[35]); kf = DOIT.ConvertStringToNumber(C[33]);//depth of kick //Counter Projection string[] CP = C[42].Split("_");//Counter projection //print("C[42]===="+C[42]); if(CP.Length<8){ C[42]="1.25_0_0_0_0_1.75_1.75_0"; CP = C[42].Split("_"); } T = DOIT.ConvertStringToNumber(CP[0]);//Counter height pf = DOIT.ConvertStringToNumber(CP[5]);//Over top front pl = DOIT.ConvertStringToNumber(CP[1]);//Projection left pr = DOIT.ConvertStringToNumber(CP[4]);//Projection right pbr = DOIT.ConvertStringToNumber(CP[3]);//Projection back right pbl = DOIT.ConvertStringToNumber(CP[2]);//Projection back left kfl = DOIT.ConvertStringToNumber(C[37]);//kick front left kfr = DOIT.ConvertStringToNumber(C[38]);//kick front right if (C[39] == "none") { C[39] = "0_0_0_0_0_0"; }//RETRACTION C39=C[39].Replace(",","_").Split('_');//Retraction kick RL=DOIT.ConvertStringToNumber(C39[0]);//Retraction Left RR=DOIT.ConvertStringToNumber(C39[3]);//Retraction Right RBL=DOIT.ConvertStringToNumber(C39[1]);//Retraction back Left RBR=DOIT.ConvertStringToNumber(C39[2]);//Retraction back Right BLACK_G =UIT_MATERIAL.GetMaterial("333333_Glossy"); SideModel=C[83].Split("_"); if (C[12] == "none") C[12] = _G.cadt.ToString(); // if (C[52] == "none" || C[52] == "NONE") C[52] = "0"; // if (C[53] == "none" || C[53] == "NONE") C[53] = "0"; // fw50 = DOIT.ConvertStringToNumber(C[52]); // fw51 = DOIT.ConvertStringToNumber(C[53]); if (C[50].Split('?')[0] != "NONE") { fw50=DOIT.ConvertStringToNumber(C[50].Split("?")[3]);} if (C[51].Split('?')[0] != "NONE") { fw51=DOIT.ConvertStringToNumber(C[51].Split("?")[3]);} //Texture KT = new string[] { C[63], C[62] }; CK = C[34].Replace(",","_").Split('_'); if (C[28] == "none" || C[28] == null || C[28] == "") C[28] = DOIT.CNs(_P.Listfloat["BASE_DEPTH"]); if (C[29] == "none" || C[29] == null || C[29] == "") C[29] = DOIT.CNs(_P.Listfloat["BASE_DEPTH"]); sl = DOIT.ConvertStringToNumber(C[28]);//Side left wide for corner cabinet sr = DOIT.ConvertStringToNumber(C[29]);//Side right wide for corner cabinet dr = DB - sr; dl = W - sl; OS1 = 0;//Offset OS2 = 0;//Offset OS3 = 0;//Offset OS4 = 0;//Offset PosyC = HBKT*0.5f-T*0.5f; PosyS = K*0.5f-T*0.5f; PosyK = -HBKT*0.5f+K*0.5f; // string[] C81 = C[81].Split(',');////Recover Panel // if (C81[0] != "0") {OS1 = 0.625f;} // if (C81[1] != "0") {OS2 = 0.625f;} // if (C81[2] != "0") {OS3 = 0.625f;} // if (C81[3] != "0") {OS4 = 0.625f;} //print("C[42]============================"+C[42]); if(Get.Bool(C[4], "B2_B4_B9_B11_W19_B3_B5_B10_B12_B20")){ if (C[48] == "COLLISION" && C[49] == "GHOST") { OS1 += pl; OS2 += pbl; OS3 += pbr; OS4 += pr; } if (C[48] == "COLLISION" && C[49] == "COLLISION") { OS1 += Mathf.Max(pl,fw50); OS2 += pbl; OS3 += pbr; OS4 += Mathf.Max(pr, fw51); } if (C[48] == "GHOST" && C[49] == "COLLISION") { OS1 += fw50; OS4 += fw51; } } if(Get.Bool(C[4], "B6_B7_B26_B27")) { if (C[48] == "COLLISION" && C[49] == "GHOST") { OS1 += pl; OS2 += pbl; OS3 += pbr; OS4 += pr; } if (C[48] == "COLLISION" && C[49] == "COLLISION") { OS1 += pl; OS2 += Mathf.Max(pbl, fw50); OS3 += Mathf.Max(pbr, fw51); OS4 += pr; } if (C[48] == "GHOST" && C[49] == "COLLISION") { OS2 += fw50; OS3 += fw51; } } //print("fw51===2="+fw51); if (C[73] == "null") C[73] = "KICK"; P1 = new(0, 0, 0); P2 = new(0, 0, 0); P3 = new(0, 0, 0); P4 = new(0, 0, 0); P5 = new(0, 0, 0); P6 = new(0, 0, 0); if(new List{"B11","B9"}.Contains(C[4])) {OS1+=DoorThickness;} if(new List{"B12","B10"}.Contains(C[4])) {OS4+=DoorThickness;} //CREATEBASE BASE = GameObject.CreatePrimitive(PrimitiveType.Cube);//new (); if(Get.Bool(C[4], "B2_B4_B6_B9_B11_W19_W26")){ BASE.transform.localScale = new(W + OS2 + OS4 + 0.5f, HBKT + 0.5f, DB + 0.5f + OS1 + OS3); VolumeBase=BASE.transform.localScale; CenterBox=new(-VolumeBase.x*0.5f+0.25f+OS2+W*0.5f,0,-VolumeBase.z*0.5F+0.25f+OS1+DB*0.5f); } if(Get.Bool(C[4], "B3_B5_B7_B10_B12_B20_B27")){ BASE.transform.localScale = new(W + OS1 + OS3 + 0.5f, HBKT + 0.5f, DB + 0.5f + OS2 + OS4); VolumeBase=BASE.transform.localScale; CenterBox=new(-VolumeBase.x*0.5f+0.25f+OS1+W*0.5f,0,-VolumeBase.z*0.5F+0.25f+OS4+DB*0.5f); } BASE.name = C[0]; BASE.transform.parent = GameObject.Find("SCENE").transform; BASE.tag = "cabbase"; //BOX POSITION backBox=CenterBox.z+DB*0.5f; frontBox=CenterBox.z-DB*0.5f; leftBox=CenterBox.x-W*0.5f; rightBox=CenterBox.x+W*0.5f; Mesure.Addpoints("CORNER BASE",BASE); //RigidBody BASE.AddComponent(); BASE.GetComponent().useGravity = false; BASE.GetComponent().isKinematic = true; BASE.GetComponent().detectCollisions = true; BASE.GetComponent().isTrigger = true; //Plan Top View CREATE.Point(BASE, "PBLU", leftBox, (HBKT * 0.5f) - T, backBox);//P1 CREATE.Point(BASE, "PBRU", rightBox, (HBKT * 0.5f) - T, backBox);//P2 CREATE.Point(BASE, "PFLU", leftBox, (HBKT * 0.5f) - T, frontBox);//P3 CREATE.Point(BASE, "PFRU", rightBox, (HBKT * 0.5f) - T, frontBox);//P4 CREATE.Point(BASE, "PBLB", leftBox, -HBKT * 0.5f, backBox);//P1 CREATE.Point(BASE, "PBRB", rightBox, -HBKT * 0.5f, backBox);//P2 CREATE.Point(BASE, "PFLB", leftBox, -HBKT * 0.5f, frontBox);//P3 CREATE.Point(BASE, "PFRB", rightBox, -HBKT * 0.5f, frontBox);//P4 CREATE.EmptyPoint(BASE, "CenterBox", CenterBox.x, 0, CenterBox.z);//P1 //print("fw51===="+fw51); //float valueX=-W*0.5f+sl; //float valueZ=-backBox-sr; switch(C[4] ){ case "B2": B2(); break; case "B3": B3(); break; case "B4": B4(); break; case "B5": B5(); break; case "B6": B6(); break; case "B7": B7(); break; case "B9": B9(); break; case "B10":B10(); break; case "B11":B11(); break; case "B12":B12(); break; case "B19":B19(); break; case "B20":B20(); break; case "B26":B26(); break; case "B27":B27(); break; } CAPS.ShowTOP(C[0][4..], BASE, valueX,HBK*0.5f+1,valueZ, Color.red); CAPS.ShowFRONT(C[0][4..], BASE, 0, 0, frontBox, Color.red); //ADD LIGHT // GameObject ImageLigth = SelectLight.Add_light_on_Base_Cabinet(DW,-HBK/2+K, DOOR1.transform.position, DOOR1.transform.eulerAngles ,C[40]); // ImageLigth.transform.SetParent(BASE.transform); // if(DOOR2!=null){ // GameObject ImageLigth2 = SelectLight.Add_light_on_Base_Cabinet(DW2,-HBK/2+K, DOOR2.transform.position, DOOR2.transform.eulerAngles ,C[40]); // ImageLigth2.transform.SetParent(BASE.transform); // } Vector3 CabinetPosition=new(px,py,pz); BASE.transform.position = CabinetPosition; BASE.transform.localRotation = Quaternion.Euler(rx, ry, rz); BASE.AddComponent(typeof(MoveObject)); BASE.GetComponent().material = _G.INV; // if (SceneModeManager.Selected != null && _G.PON != "AIpnl") // { // if (!string.IsNullOrEmpty(_G.SC[15])) // { // float PosX = float.Parse(_G.SC[15]); _G.SC[15] = ""; // float PosZ = float.Parse(_G.SC[17]); _G.SC[17] = ""; // } // Vector3 OldCenterBox=new(PosX,py,PosZ); // Vector3 NewCenterPosition=BASE.transform.Find("CenterBox").transform.position; // NewCenterPosition=new(NewCenterPosition.x,py,NewCenterPosition.z); // float distance=Vector3.Distance(OldCenterBox,NewCenterPosition); // var direction = (OldCenterBox-NewCenterPosition).normalized; // CabinetPosition += distance*direction; // BASE.transform.position = CabinetPosition; // DOIT.SaveObjectPositionInData(BASE.transform); // } //SHOW CAPS //string Unique_Name = C[1];//UIT.Value(Library.Cabinet,C[1],Header.ID); //string Captext = Unique_Name + "\n" + DOIT.CSs(C[6]) + "x" + DOIT.CSs(C[7]); //CAPS.Show(Captext, BASE, DB, W*0.5f, frontBox); } public static void B2(){ //CONTOUR// CODE.GetDiv(C[25]); DOSIDE.PNLNew(BASE, nO,K*0.5f - T *0.5f,DB*0.5f,HB,K,kf,t,CenterBox,Back45); //SHELF ON OPENING float of=4.5F*0.5f; //_G.RTOT=3; if(C[25].IndexOf("o") != -1){ for(int i=1; i<_G.RTOT+1; i++ ){ if(i<_G.RTOT ){ //UNDER = MCXMP.MCX6VL(t, sl, W, P1, P2, P3, P4, P5, P6, Get.BoxTex(C, 5)); Vector3[] Points=new Vector3[6]{P1, P2, P3, P4, P5, P6 }; UNDER = MCXMP.MCXV("Shelf",t, Points, Get.BoxTex(C, 5),"Untagged"); UNDER.transform.position = new(0, of+_G.ROWY1[i-1]-_G.ROWH1[i-1]*0.5f, 0); UNDER.transform.parent = BASE.transform; } } } of=t*0.5f; //DOOR //print("C[25]C[25]C[25]C[25]==="+C[25]); DW = W - sl - 0.25f; C[25] = DC.Resize(C[25], DW, HB, nO); codeD1 = C[25].Split("_"[0]); DOOR1 = Createdoor.Patern(codeD1, nO); DOOR1.transform.position = new(rightBox- dl *0.5f+ 0.0f, PosyS, backBox- sr - _G.cadt *0.5f); DOOR1.transform.parent = BASE.transform; //print("C[26]C[26]C[26]C[26]==="+C[26]); DW2 = DB - sr - 0.25f; C[26] = DC.Resize(C[26], DW2, HB, nO); codeD2 = C[26].Split("_"[0]); DOOR2 = Createdoor.Patern(codeD2, nO); DOOR2.transform.position = new(leftBox+ sl + _G.cadt *0.5f, PosyS,frontBox+ dr *0.5f); DOOR2.transform.localRotation = Quaternion.Euler(0, -90, 0); DOOR2.transform.parent = BASE.transform; DOOR2.name = "DoorPatern2"; valueX=rightBox-DW+1 ; valueZ=frontBox+DW2-2 ; //KICK //----------------------K1------------------------------------------------------------ P1 = new(leftBox, PosyK, frontBox+RL); P2 = new(leftBox, PosyK, backBox); P3 = new(rightBox-RR, PosyK, backBox); P4 = new(rightBox-RR+fw51, PosyK, backBox-sr+kf); P5 = new(leftBox+ sl-kf, PosyK, backBox-sr+kf); P6 = new(leftBox+ sl-kf, PosyK, frontBox+RL-fw50); //----------------------K1------------------------------------------------------------ Kw = Vector3.Distance(P1,P6); Kpos = (P1 + P6) *0.5f; if (CK[1] != "0") { K1 = Createkick.Mcx("K1", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[int.Parse(CK[1]) - 1]); K1.transform.SetParent(KICK.transform); } //----------------------K2------------------------------------------------------------ Kw = Vector3.Distance(P1,P2); Kpos = (P1 + P2) *0.5f; if (CK[2] != "0") { K2 = Createkick.Mcx("K2", Kw, K, t, Kpos.x+of, PosyK, Kpos.z, 0, -90, 0, KT[int.Parse(CK[2]) - 1]); K2.transform.SetParent(KICK.transform); } //----------------------K3------------------------------------------------------------ Kw = Vector3.Distance(P2,P3); Kpos = (P2 + P3) *0.5f; if (CK[3] != "0") { K3 = Createkick.Mcx("K3", Kw, K, t, Kpos.x, PosyK, Kpos.z-of, 0, 0, 0, KT[int.Parse(CK[3]) - 1]); K3.transform.SetParent(KICK.transform); } //----------------------K4------------------------------------------------------------ Kw = Vector3.Distance(P3,P4); Kpos = (P3 + P4) *0.5f; if (CK[4] != "0") { K4 = Createkick.Mcx("K4", Kw, K, t, Kpos.x-of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[4]) - 1]); K4.transform.SetParent(KICK.transform); } //----------------------K5------------------------------------------------------------ Kw = Vector3.Distance(P4,P5); Kpos = (P4 + P5) *0.5f; if (CK[5] != "0") { K5 = Createkick.Mcx("K5", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[int.Parse(CK[5]) - 1]); K5.transform.SetParent(KICK.transform); } //----------------------K6------------------------------------------------------------ Kw = Vector3.Distance(P5,P6); Kpos = (P5 + P6) *0.5f; if (CK[6] != "0") { K5 = Createkick.Mcx("K6", Kw, K, t, Kpos.x- of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[6]) - 1]); K5.transform.SetParent(KICK.transform); } KICK.transform.SetParent(BASE.transform); //LEGS if ( C[73].IndexOf("LEG")!=-1) { Vector3 P; Vector3 R = new(0, 0, 0); P = new(leftBox+RBL+2, PosyK, frontBox+RL+2); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); P = new(rightBox-RR-2, PosyK, backBox-RBR- 2); LEGS.Standard(BASE, "L3", K, P, R, BLACK_G); P = new(rightBox -RR- 2, PosyK, backBox- sr + kf+ 2); LEGS.Standard(BASE, "L4", K, P, R, BLACK_G); P = new(leftBox+ sl - kf-2, PosyK, backBox-sr+kf+2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); P = new(leftBox+ sl -kf-2, PosyK, frontBox+RL+2); LEGS.Standard(BASE, "L6", K, P, R, BLACK_G); if(Back45>0.1f){ P = new(leftBox+RL+2, PosyK, backBox-RBR- 2-Back45); LEGS.Standard(BASE, "L2", K, P, R, BLACK_G); P = new(leftBox+ Back45+2, PosyK, backBox-RBR-2); LEGS.Standard(BASE, "L7", K, P, R, BLACK_G); } else{ P = new(leftBox+RBL+2, PosyK, backBox-RBR-2-Back45); LEGS.Standard(BASE, "L2", K, P, R, BLACK_G); } } //COUNTER Back45=0.1f; if (T != 0) { Vector3[] Points = new Vector3[4]{ new(leftBox- pbl, 0,frontBox- pl), new(leftBox- pbl+Back45, 0, backBox+ pbr-Back45), new(leftBox+ sl + pf , 0, backBox - sr - pf), new(leftBox+ sl + pf , 0,frontBox- pl) }; COUNTER = MCXMP.MCXV("CounterTop", T, Points, C[41], "counter"); COUNTER.transform.position = new(0, HBKT * 0.5f, 0); COUNTER.transform.localRotation = Quaternion.Euler(0, 0, 0); COUNTER.transform.parent = BASE.transform; COUNTER.name = "CABCOUNTER"; Points = new Vector3[4]{ new(leftBox- pbl, 0, backBox+ pbr), new(rightBox+ pr, 0, backBox+ pbr), new(rightBox+ pr, 0, backBox - sr - pf ), new(leftBox+ sl + pf , 0, backBox - sr - pf), }; COUNTER2 = MCXMP.MCXV("CounterTop2", T, Points, C[41], "counter"); COUNTER2.transform.position = new(0, HBKT *0.5f, 0); COUNTER2.transform.localRotation = Quaternion.Euler(0, 0, 0); COUNTER2.transform.parent = BASE.transform; COUNTER2.name = "CABCOUNTER2"; } //FILLER if (_G.OBJs[nO][50] != "NONE") { FL = CreateBoxPnl.Filler("FL", fw50, HB, t, leftBox+ sl - t *0.5f, PosyS,frontBox- fw50 *0.5f, 0, 90, 0, C[50]); FL.transform.parent = BASE.transform; } if (_G.OBJs[nO][51] != "NONE") { FR = CreateBoxPnl.Filler("FR", fw51, HB, t, rightBox+ fw51 *0.5f, PosyS, backBox- sr + t *0.5f, 0, 0, 0, C[51]); FR.transform.parent = BASE.transform; } //SPLASH DOBS.SplashC(BASE, C[55], W, HBK, DB, C[54]); DOBS.SplashL(BASE, C[56], W, HBK, DB, C[54]); //RECOVER Recover.AddRecoverOnCornerCab(BASE,C,leftBox,backBox,rightBox); // //SHOW CAPS // string Unique_Name = _G.LibraryCabinets[C[1]].Unique_Name; // string Captext = Unique_Name + "\n" + DOIT.CSs(C[6]) + "x" + DOIT.CSs(C[7]); //CAPS.Show(Captext, BASE, DB, rightBox- 5, frontBox+ 5); } public static void B3(){ //CONTOUR// CODE.GetDiv(C[25]); DOSIDE.PNLNew(BASE, nO,K / 2 - T / 2,DB*0.5f,HB,K,kf,t,CenterBox,Back45); //DOORS float DW = W - sl - 0.25f; C[25] = DC.Resize(C[25], DW, HB, nO); codeD1 = C[25].Split("_"[0]); DOOR1 = Createdoor.Patern(codeD1, nO); DOOR1.transform.position = new(leftBox+ dl *0.5f- 0.0f, PosyS, backBox- sl - t *0.5f); DOOR1.transform.parent = BASE.transform; float DW2 = DB - sr - 0.25f; C[26] = DC.Resize(C[26], DW2, HB, nO); codeD2 = C[26].Split("_"[0]); DOOR2 = Createdoor.Patern(codeD2, nO); DOOR2.transform.position = new(rightBox- sr - t *0.5f, PosyS, frontBox+ dr *0.5f); DOOR2.transform.localRotation = Quaternion.Euler(0, 90, 0); DOOR2.transform.parent = BASE.transform; valueX=leftBox+ DW-1 ; valueZ=frontBox + DW2-2 ; //KICK //----------------------K1------------------------------------------------------------ P1 = new(leftBox+RL-fw50, PosyK, backBox-sl+kf); P2 = new(leftBox+RL, PosyK, backBox); P3 = new(rightBox, PosyK, backBox); P4 = new(rightBox, PosyK, frontBox+RR); P5 = new(rightBox- sr+kf, PosyK, frontBox+RR-fw51); P6 = new(rightBox- sr+kf, PosyK, backBox-sl+kf); //----------------------K1------------------------------------------------------------ Kw = Vector3.Distance(P1,P2); Kpos = (P1 + P2) *0.5f; if (CK[1] != "0") { K1 = Createkick.Mcx("K1", Kw, K, t, Kpos.x+ of, PosyK, Kpos.z, 0, -90, 0, KT[int.Parse(CK[1]) - 1]); K1.transform.SetParent(KICK.transform); } //----------------------K2------------------------------------------------------------ Kw = Vector3.Distance(P2,P3); Kpos = (P2 + P3) *0.5f; if (CK[2] != "0") { K2 = Createkick.Mcx("K2", Kw, K, t, Kpos.x, PosyK, Kpos.z- of, 0, 0, 0, KT[int.Parse(CK[2]) - 1]); K2.transform.SetParent(KICK.transform); } //----------------------K3------------------------------------------------------------ Kw = Vector3.Distance(P3,P4); Kpos = (P3 + P4) *0.5f; if (CK[3] != "0") { K3 = Createkick.Mcx("K3", Kw, K, t, Kpos.x- of, PosyK, Kpos.z, 0, -90, 0, KT[int.Parse(CK[3]) - 1]); K3.transform.SetParent(KICK.transform); } //----------------------K4------------------------------------------------------------ Kw = Vector3.Distance(P4,P5); Kpos = (P4 + P5) *0.5f; if (CK[4] != "0") { K4 = Createkick.Mcx("K4", Kw, K, t, Kpos.x, PosyK, Kpos.z+ of, 0, 0, 0, KT[int.Parse(CK[4]) - 1]); K4.transform.SetParent(KICK.transform); } //----------------------K5------------------------------------------------------------ Kw = Vector3.Distance(P5,P6); Kpos = (P5 + P6) *0.5f; if (CK[5] != "0") { K5 = Createkick.Mcx("K5", Kw, K, t, Kpos.x+ of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[5]) - 1]); K5.transform.SetParent(KICK.transform); } //----------------------K6------------------------------------------------------------ Kw = Vector3.Distance(P1,P6); Kpos = (P1 + P6) *0.5f; if (CK[6] != "0") { K5 = Createkick.Mcx("K6", Kw, K, t, Kpos.x, PosyK, Kpos.z+ of, 0, 0, 0, KT[int.Parse(CK[6]) - 1]); K5.transform.SetParent(KICK.transform); } KICK.transform.SetParent(BASE.transform); //LEGS if (C[73].IndexOf("LEG")!=-1) { Vector3 P; Vector3 R = new(0, 0, 0); P = new(leftBox+RL+2, PosyK, backBox- sl +kf+2); LEGS.Standard(BASE, "L1",K, P, R, BLACK_G); P = new(leftBox+RL+2, PosyK, backBox-RBL-2); LEGS.Standard(BASE, "L2", K, P, R, BLACK_G); P = new(rightBox-RBR- 2, PosyK, frontBox+RR+2); LEGS.Standard(BASE, "L4", K, P, R, BLACK_G); P = new(rightBox- sr + kf+2, PosyK,frontBox+RR+2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); P = new(rightBox- sr + kf+2, PosyK, backBox- sl +kf+2); LEGS.Standard(BASE, "L6", K, P, R, BLACK_G); if(Back45>0.1f){ P = new(rightBox-RBR-2-Back45, PosyK, backBox-RBR- 2); LEGS.Standard(BASE, "L3", K, P, R, BLACK_G); P = new(rightBox - RBR-2, PosyK, backBox-RBR-2 -Back45); LEGS.Standard(BASE, "L7", K, P, R, BLACK_G); } else{ P = new(rightBox-RBR- 2, PosyK, backBox-RBL-2); LEGS.Standard(BASE, "L3", K, P, R, BLACK_G); } } //COUNTER Back45=0.1f; if (T != 0) { Vector3[] Points = new Vector3[4]{ new(leftBox- pl, 0, backBox-sl-pf), new(leftBox- pl-Back45, 0, backBox+ pbl), new(rightBox+ pbr, 0, backBox+ pbl-Back45), new(rightBox- sr - pf , 0, backBox-sl-pf) }; COUNTER2 = MCXMP.MCXV("CounterTop2", T, Points, C[41], "counter"); COUNTER2.transform.position = new(0, HBKT * 0.5f, 0); COUNTER2.transform.localRotation = Quaternion.Euler(0, 0, 0); COUNTER2.transform.parent = BASE.transform; COUNTER2.name = "CABCOUNTER2"; Points = new Vector3[4]{ new(rightBox+ pbr, 0, backBox+ pbl-Back45), new(rightBox+ pbr, 0, backBox-DB- pr), new(rightBox- sr - pf , 0, backBox-DB- pr), new(rightBox- sr - pf , 0, backBox-sl-pf) }; COUNTER = MCXMP.MCXV("CounterTop", T, Points, C[41], "counter"); COUNTER.transform.position = new(0, HBKT *0.5f, 0); COUNTER.transform.localRotation = Quaternion.Euler(0, 0, 0); COUNTER.transform.parent = BASE.transform; COUNTER.name = "CABCOUNTER"; } //FILLER if (_G.OBJs[nO][50] != "NONE") { FL = CreateBoxPnl.Filler("FL", fw50, HB, t, leftBox - fw50 * 0.5f, PosyS, backBox - sl + t * 0.5f, 0, 0, 0, C[50]); FL.transform.parent = BASE.transform; } if (_G.OBJs[nO][51] != "NONE") { FR = CreateBoxPnl.Filler("FR", fw51, HB, t, rightBox- sr + t *0.5f, PosyS, frontBox- fw51 *0.5f, 0, 90, 0, C[51]); FR.transform.parent = BASE.transform; } //SPLASH DOBS.SplashC(BASE, C[55], W, HBK, DB, C[54]); DOBS.SplashR(BASE, C[56], W, HBK, DB, C[54]); //RECOVER Recover.AddRecoverOnCornerCab(BASE,C,leftBox,backBox,rightBox); // //SHOW CAPS //Show(Captext, BASE, DB, leftBox+ 5, frontBox+ 5); } public static void B4(){ //CONTOUR// CODE.GetDiv(C[25]); DOSIDE.PNLNew(BASE, nO,K / 2 - T / 2,DB*0.5f,HB,K,kf,t,CenterBox,Back45); //DOOR dr = DB - sr; dl = W - sl; float DW = Mathf.Sqrt((dr * dr) + (dl * dl)); C[25] = DC.Resize(C[25], DW, HB, nO); codeD1 = C[25].Split("_"[0]); GameObject DP = Createdoor.Patern(codeD1, nO); DOOR1 = new ("DP"); float A = Mathf.Atan(dl / dr) * Mathf.Rad2Deg; DP.transform.localRotation = Quaternion.Euler(0, A - 90, 0); DP.transform.SetParent(DOOR1.transform); DOOR1.transform.position = new(rightBox- dl *0.5f, PosyS, frontBox + dr *0.5f); DOOR1.transform.parent = BASE.transform; valueX=rightBox- dl *0.5f; valueZ=frontBox + dr *0.5f; //FILLER if (_G.OBJs[nO][50] != "NONE") { FL = CreateBoxPnl.Filler("FL", fw50, HB, t, leftBox+ sl - t *0.5f, PosyS, frontBox- fw50 *0.5f, 0, 90, 0, C[50]); FL.transform.parent = BASE.transform; } if (_G.OBJs[nO][51] != "NONE") { FR = CreateBoxPnl.Filler("FR", fw51, HB, t, rightBox+ fw51 *0.5f, PosyS, backBox- sr + t *0.5f, 0, 0, 0, C[51]); FR.transform.parent = BASE.transform; } CREATE.EmptyPoint(BASE, "CenterBox", 0, 0, 0);//P1 //SPLASH DOBS.SplashC(BASE, C[55], W, HBK, DB, C[54]); DOBS.SplashL(BASE, C[56], W, HBK, DB, C[54]); //RECOVER Recover.AddRecoverOnCornerCab(BASE,C,leftBox,backBox,rightBox); //SINK//FAUCET if (C[67] != "NONE") { ConstructSink.AddSink(nO); } if (C[68] != "NONE") { ConstructFaucet.addfaucet(nO); } // //SHOW CAPS // string Unique_Name = _G.LibraryCabinets[C[1]].Unique_Name; // string Captext = Unique_Name + "\n" + DOIT.CSs(C[6]) + "x" + DOIT.CSs(C[7]); //CAPS.Show(Captext, BASE, DB, rightBox- 5, frontBox+ 5); //Shelf string texself = Get.BoxTex(C, 7); if (C[25].IndexOf("o") != -1 || C[25].IndexOf("w") != -1 || C[25].IndexOf("c") != -1) { CODE.GetDiv(C[25]); //ROW1 of = 0.625f; P1 = new(-W / 2 + of, 0, -DB / 2 + of); P2 = new(-W / 2 + of, 0, DB / 2 - of); P3 = new(W / 2 - of, 0, DB / 2 - of); P4 = new(W / 2 - of, 0, DB / 2 - sr); P5 = new(-W / 2 + sl, 0, -DB / 2 + of); AddShelf.Set(codeD1, BASE, DB - t * 2, W, texself, P5, P4, P3, P2, P1,K*0.5f-T*0.05f,CenterBox); } if (C[25].IndexOf("w") != -1) { if (_G.Rdiv1.Count != 0) { addWinner.AddingOnWinner(BASE, _G.Rdiv1, DB - t * 2, _G.ROWY1[0]+OY, DOIT.ConvertStringToNumber(C[6]), texself); } if (_G.Rdiv2.Count != 0) { addWinner.AddingOnWinner(BASE, _G.Rdiv2, DB - t * 2, _G.ROWY1[1]+OY, DOIT.ConvertStringToNumber(C[6]), texself); } if (_G.Rdiv3.Count != 0) { addWinner.AddingOnWinner(BASE, _G.Rdiv3, DB - t * 2, _G.ROWY1[2]+OY, DOIT.ConvertStringToNumber(C[6]), texself); } if (_G.Rdiv4.Count != 0) { addWinner.AddingOnWinner(BASE, _G.Rdiv4, DB - t * 2, _G.ROWY1[3]+OY, DOIT.ConvertStringToNumber(C[6]), texself); } if (_G.Rdiv5.Count != 0) { addWinner.AddingOnWinner(BASE, _G.Rdiv5, DB - t * 2, _G.ROWY1[4]+OY, DOIT.ConvertStringToNumber(C[6]), texself); } if (_G.Rdiv6.Count != 0) { addWinner.AddingOnWinner(BASE, _G.Rdiv6, DB - t * 2, _G.ROWY1[5]+OY, DOIT.ConvertStringToNumber(C[6]), texself); } } //KICK P1 = new(leftBox, PosyK, frontBox+RL); P2 = new(leftBox, PosyK, backBox); P3 = new(rightBox-RL, PosyK, backBox); P4 = new(rightBox-RL, PosyK, backBox-sr+kf); P5 = new(leftBox+ sl-kf, PosyK, frontBox+RL); A = Mathf.Rad2Deg * Mathf.Atan2(P4.x - P5.x, P4.z - P5.z); //----------------------K1------------------------------------------------------------ Kw = Vector3.Distance(P1,P5); Kpos = (P1 + P5) *0.5f; if (CK[1] != "0") { K1 = Createkick.Mcx("K1", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[int.Parse(CK[1]) - 1]); K1.transform.SetParent(KICK.transform); } //----------------------K2------------------------------------------------------------ Kw = Vector3.Distance(P1,P2); Kpos = (P1 + P2) *0.5f; if (CK[2] != "0") { K2 = Createkick.Mcx("K2", Kw, K, t, Kpos.x+of, PosyK, Kpos.z, 0, -90, 0, KT[int.Parse(CK[2]) - 1]); K2.transform.SetParent(KICK.transform); } //----------------------K3------------------------------------------------------------ Kw = Vector3.Distance(P2,P3); Kpos = (P2 + P3) *0.5f; if (CK[3] != "0") { K3 = Createkick.Mcx("K3", Kw, K, t, Kpos.x, PosyK, Kpos.z-of, 0, 0, 0, KT[int.Parse(CK[3]) - 1]); K3.transform.SetParent(KICK.transform); } //----------------------K4------------------------------------------------------------ Kw = Vector3.Distance(P3,P4); Kpos = (P3 + P4) *0.5f; if (CK[4] != "0") { K4 = Createkick.Mcx("K4", Kw, K, t, Kpos.x-of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[4]) - 1]); K4.transform.SetParent(KICK.transform); } //----------------------K5------------------------------------------------------------ Kw = Vector3.Distance(P4,P5); Kpos = (P4 + P5) *0.5f; if (CK[5] != "0") { K5 = Createkick.Mcx("K5", Kw, K, t, Kpos.x-of, PosyK, Kpos.z+of, 0, A-90, 0, KT[int.Parse(CK[5]) - 1]); K5.transform.SetParent(KICK.transform); } if(fw50!=0){ Kw = fw50; Pf50=new(P5.x,P5.y,P5.z-fw50); Kpos = (P5 + Pf50) *0.5f; K6 = Createkick.Mcx("K6", Kw, K, t, Kpos.x-of, PosyK, Kpos.z, 0, 90, 0, KT[0]); K6.transform.SetParent(KICK.transform); } if(fw51!=0){ Kw = fw51; Pf51=new(P4.x+fw51,P4.y,P4.z); Kpos = (P4 + Pf51) *0.5f; K7 = Createkick.Mcx("K7", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[0]); K7.transform.SetParent(KICK.transform); } KICK.transform.SetParent(BASE.transform); //LEGS if (C[73].IndexOf("LEG")!=-1) { Vector3 R = new(0, 0, 0); Vector3 P; if(sl>=12){ P = new(leftBox+RBL+ 2, PosyK, frontBox+RL+2); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); P = new(leftBox+sl-kf-2, PosyK,frontBox+RL+2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } else { P = new(leftBox+sl*0.5f, PosyK, frontBox+RL+2); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); } P = new(leftBox +RBL+ 2, PosyK, backBox-RBR-2); LEGS.Standard(BASE, "L2", K, P, R, BLACK_G); if(sr>=12){ P = new(rightBox-RR-2, PosyK, backBox-RBR-2); LEGS.Standard(BASE, "L4", K, P, R, BLACK_G); P = new(rightBox-RR-2, PosyK, backBox- sr+kf+2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } else{ P = new(rightBox-RR-2, PosyK, backBox-sr*0.5f); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } if(Back45>0.1f){ P = new(rightBox-RR-2, PosyK, backBox-RBR- 2-Back45); LEGS.Standard(BASE, "L3", K, P, R, BLACK_G); P = new(leftBox+ Back45+2, PosyK, backBox-RBR-2); LEGS.Standard(BASE, "L7", K, P, R, BLACK_G); } else{ P = new(rightBox-RR-2, PosyK, backBox-RBR- 2); LEGS.Standard(BASE, "L3", K, P, R, BLACK_G); } } //COUNTER Back45=0.1f; if (T != 0) { Vector3[] Points=new Vector3[6]{ new(leftBox- pbl, 0,frontBox- pl), new(leftBox- pbl, 0, backBox+ pbr-Back45), new(leftBox+Back45, 0, backBox+ pbr), new(rightBox+ pr, 0, backBox+ pbr), new(rightBox+ pr, 0, backBox - sr - pf ), new(leftBox+ sl + pf , 0,frontBox- pl) }; COUNTER = MCXMP.MCXV("CounterTop",T, Points, C[41],"counter"); //GameObject COUNTER = CounterMCX.MCX4V("CounterTop",T, P1, P2, P3, P4, C[41]); COUNTER.transform.position = new(0, HBKT *0.5f, 0); COUNTER.transform.localRotation = Quaternion.Euler(0, 0, 0); COUNTER.transform.parent = BASE.transform; COUNTER.name = "CABCOUNTER"; } } public static void B5(){ //CONTOUR CODE.GetDiv(C[25]); DOSIDE.PNLNew(BASE, nO,K / 2 - T / 2,backBox,HB,K,kf,t,CenterBox,Back45); //DOOR dr = W - sr; dl = DB - sl; float DW = Mathf.Sqrt((dr * dr) + (dl * dl)); //if(C[1]!="BC0" && C[1]!="BC00" )C[25]=DC.Resize(C[25],W,HB,nO); C[25] = DC.Resize(C[25], DW, HB, nO); codeD1 = C[25].Split("_"[0]); GameObject DP = Createdoor.Patern(codeD1, nO); DOOR1 = new ("DP"); float A = Mathf.Atan(dr / dl) * Mathf.Rad2Deg; DP.transform.localRotation = Quaternion.Euler(0, 90 - A, 0); DP.transform.SetParent(DOOR1.transform); DOOR1.transform.position = new(leftBox+ dr *0.5f, PosyS, frontBox+ dl *0.5f); DOOR1.transform.parent = BASE.transform; valueX=leftBox+ dr *0.5f; valueZ=frontBox+ dl *0.5f; //FILLER if (_G.OBJs[nO][50] != "NONE") { FL = CreateBoxPnl.Filler("FL", fw50, HB, t, leftBox- fw50 *0.5f, PosyS, backBox- sl + t *0.5f, 0, 0, 0, C[50]); FL.transform.parent = BASE.transform; } if (_G.OBJs[nO][51] != "NONE") { FR = CreateBoxPnl.Filler("FR", fw51, HB, t, rightBox- sr + t *0.5f, PosyS, frontBox- fw51 *0.5f, 0, 90, 0, C[51]); FR.transform.parent = BASE.transform; } CREATE.EmptyPoint(BASE, "CenterBox", 0, 0, 0);//P1 //SPLASH DOBS.SplashC(BASE, C[55], W, HBK, DB, C[54]); DOBS.SplashR(BASE, C[56], W, HBK, DB, C[54]); //RECOVER Recover.AddRecoverOnCornerCab(BASE,C,leftBox,backBox,rightBox); //SINK//FAUCET if (C[67] != "NONE") { ConstructSink.AddSink(nO); } if (C[68] != "NONE") { ConstructFaucet.addfaucet(nO); } // //SHOW CAPS // string Unique_Name = _G.LibraryCabinets[C[1]].Unique_Name; // string Captext = Unique_Name + "\n" + DOIT.CSs(C[6]) + "x" + DOIT.CSs(C[7]); //CAPS.Show(Captext, BASE, DB, leftBox+ 5, frontBox+ 5); //BOTTOM Vector3[] Points=new Vector3[5]{ new(leftBox+ t, 0, backBox- sl), new(leftBox+t, 0, backBox-t), new(rightBox- t, 0, backBox- t), new(rightBox- t, 0, frontBox+ t), new(rightBox- sr, 0, frontBox+ t) }; GameObject UNDER = MCXMP.MCXV("Shelf",t, Points, C[62],"Untagged"); UNDER.transform.position = new(0, -HBKT *0.5f+ K+t, 0); UNDER.transform.parent = BASE.transform; UNDER.name = "UNDER"; // //KICK P1 = new(leftBox+RL, PosyK, backBox-sl+kf); P2 = new(leftBox+RL, PosyK, backBox); P3 = new(rightBox, PosyK, backBox); P4 = new(rightBox, PosyK, frontBox+RR); P5 = new(rightBox-sr+kf, PosyK, frontBox+RR); A = Mathf.Rad2Deg * Mathf.Atan2(P5.x - P1.x, P5.z - P1.z); //----------------------K1------------------------------------------------------------ Kw = Vector3.Distance(P1,P2); Kpos = (P1 + P2) *0.5f; if (CK[1] != "0") { K1 = Createkick.Mcx("K1", Kw, K, t, Kpos.x+of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[1]) - 1]); K1.transform.SetParent(KICK.transform); } //----------------------K2------------------------------------------------------------ Kw = Vector3.Distance(P2,P3); Kpos = (P2 + P3) *0.5f; if (CK[2] != "0") { K2 = Createkick.Mcx("K2", Kw, K, t, Kpos.x, PosyK, Kpos.z-of, 0, 0, 0, KT[int.Parse(CK[2]) - 1]); K2.transform.SetParent(KICK.transform); } //----------------------K3------------------------------------------------------------ Kw = Vector3.Distance(P3,P4); Kpos = (P3 + P4) *0.5f; if (CK[3] != "0") { K3 = Createkick.Mcx("K3", Kw, K, t, Kpos.x-of, PosyK, Kpos.z, 0, -90, 0, KT[int.Parse(CK[3]) - 1]); K3.transform.SetParent(KICK.transform); } //----------------------K4------------------------------------------------------------ Kw = Vector3.Distance(P4,P5); Kpos = (P4 + P5) *0.5f; if (CK[4] != "0") { K4 = Createkick.Mcx("K4", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[int.Parse(CK[4]) - 1]); K4.transform.SetParent(KICK.transform); } //----------------------K5------------------------------------------------------------ Kw = Vector3.Distance(P1,P5); Kpos = (P1 + P5) *0.5f; if (CK[5] != "0") { K5 = Createkick.Mcx("K5", Kw, K, t, Kpos.x+of, PosyK, Kpos.z+of, 0, A-90, 0, KT[int.Parse(CK[5]) - 1]); K5.transform.SetParent(KICK.transform); } if(fw50!=0){ Kw = fw50; Pf50=new(P1.x-fw50,P1.y,P1.z); Kpos = (P1 + Pf50) *0.5f; K6 = Createkick.Mcx("K6", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[0]); K6.transform.SetParent(KICK.transform); } if(fw51!=0){ Kw = fw51; Pf51=new(P5.x,P5.y,P5.z-fw51); Kpos = (P5 + Pf51) *0.5f; K7 = Createkick.Mcx("K7", Kw, K, t, Kpos.x+of, PosyK, Kpos.z, 0, 90, 0, KT[0]); K7.transform.SetParent(KICK.transform); } KICK.transform.SetParent(BASE.transform); if (C[73].IndexOf("LEG")!=-1) { Vector3 R = new(0, 0, 0); Vector3 P; if(sl>=12){ P = new(leftBox+RL+ 2, PosyK, backBox- sl + kf+2); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); P = new(leftBox+RL+ 2, PosyK, backBox-RBL-2); LEGS.Standard(BASE, "L2", K, P, R, BLACK_G); } else { P = new(leftBox+RL+2, PosyK, backBox- sl*0.5f); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); } // P = new(rightBox-RBR -2, PosyK, backBox-RBL-2); // LEGS.Standard(BASE, "L3", K, P, R, BLACK_G); if(sr>=12){ P = new(rightBox- RBR-2, PosyK, frontBox+ RR+2); LEGS.Standard(BASE, "L4", K, P, R, BLACK_G); P = new(rightBox- sr + kf+ 2, PosyK, frontBox+RR+ 2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } else{ P = new(rightBox- sr*0.5f, PosyK, frontBox+ RR +2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } P = new(rightBox- sr + kf+2, PosyK, backBox- sl +kf+2); LEGS.Standard(BASE, "L6", K, P, R, BLACK_G); if(Back45>0.1f){ P = new(rightBox-RR-2, PosyK, backBox-RBR- 2-Back45); LEGS.Standard(BASE, "L3", K, P, R, BLACK_G); P = new(leftBox+ Back45+2, PosyK, backBox-RBR-2 -Back45); LEGS.Standard(BASE, "L7", K, P, R, BLACK_G); } else{ P = new(rightBox-RBR- 2, PosyK, backBox-RBL-2); LEGS.Standard(BASE, "L3", K, P, R, BLACK_G); } } //COUNTER if (T != 0) { float pfr=Mathf.Max(pr, pf); float pfl=Mathf.Max(pl, pf); P1 = new(leftBox- pfl, 0, backBox- sl - pf); P2 = new(leftBox- pfl, 0, backBox+ pbl); P3 = new(rightBox+ pbr, 0, backBox+ pbl); P4 = new(rightBox+ pbr, 0, frontBox- pfr); P5 = new(rightBox- sr - pf , 0, frontBox- pfr); COUNTER = CounterMCX.MCX5VR("CounterTop",T, sr + 1, W, P1, P2, P3, P4, P5, C[41]); COUNTER.transform.position = new(0, HBKT *0.5f, 0); COUNTER.transform.localRotation = Quaternion.Euler(0, 0, 0); COUNTER.transform.parent = BASE.transform; COUNTER.name = "CABCOUNTER"; } } public static void B6(){ //CONTOUR// CODE.GetDiv(C[25]); DOSIDE.PNLNew(BASE, nO,K / 2 - T / 2,DB*0.5f,HB,K,kf,t,CenterBox,Back45); //DOOR dr = DB - sr; dl = W - sl; float DW = Mathf.Sqrt((dr * dr) + (dl * dl)); C[25] = DC.Resize(C[25], DW, HB, nO); codeD1 = C[25].Split("_"[0]); GameObject DP = Createdoor.Patern(codeD1, nO); DOOR1 = new ("DP"); float A = Mathf.Atan(dl / dr) * Mathf.Rad2Deg; DP.transform.localRotation = Quaternion.Euler(0, A - 90, 0); DP.transform.SetParent(DOOR1.transform); DOOR1.transform.position = new(rightBox- dl *0.5f, PosyS,frontBox+ dr *0.5f); DOOR1.transform.parent = BASE.transform; valueX=rightBox- dl *0.5f; valueZ=frontBox + dr *0.5f; //FILLER if (_G.OBJs[nO][50] != "NONE") { FL = CreateBoxPnl.Filler("FL", fw50, HB, t, leftBox - fw50 * 0.5f, PosyS, frontBox+t*0.5f, 0, 0, 0, C[50]); FL.transform.parent = BASE.transform; } if (_G.OBJs[nO][51] != "NONE") { FR = CreateBoxPnl.Filler("FR", fw51, HB, t, rightBox-t*0.5f, PosyS, backBox + fw51 * 0.5f, 0, 90, 0, C[51]); FR.transform.parent = BASE.transform; } //ANCHORE POINT // CREATE.EmptyPoint(BASE, "P1", leftBox, 0, frontBox); // CREATE.EmptyPoint(BASE, "P2", leftBox+sl, 0, frontBox); // CREATE.EmptyPoint(BASE, "P3", rightBox, 0, backBox-sr); // CREATE.EmptyPoint(BASE, "P4", rightBox, 0, backBox); // CREATE.EmptyPoint(BASE, "P5", leftBox, 0, backBox); //SPLASH DOBS.SplashC(BASE, C[55], W, HBK, DB, C[54]); DOBS.SplashL(BASE, C[56], W, HBK, DB, C[54]); //SINK//FAUCET if (C[67] != "NONE") { ConstructSink.AddSink(nO); } if (C[68] != "NONE") { ConstructFaucet.addfaucet(nO); } // //SHOW CAPS // string Unique_Name = _G.LibraryCabinets[C[1]].Unique_Name; // string Captext = Unique_Name + "\n" + DOIT.CSs(C[6]) + "x" + DOIT.CSs(C[7]); //CAPS.Show(Captext, BASE, DB, rightBox- 5, frontBox+ 5); //KICK float kfRL=Mathf.Max(kf,RL); float kfRR=Mathf.Max(kf,RR); P1 = new(leftBox, PosyK, frontBox+kfRL); P2 = new(leftBox, PosyK, backBox-RBR); P3 = new(rightBox-kfRL, PosyK, backBox-RBR); P4 = new(rightBox-kfRL, PosyK, backBox-sr); P5 = new(leftBox+ sl, PosyK, frontBox+kfRR); Pf50= P1; Pf51= P3; if( fw50!=0)Pf50= new(leftBox-fw50, PosyK, P1.z); if( fw51!=0)Pf51= new(P3.x, PosyK, backBox+fw51); A = Mathf.Rad2Deg * Mathf.Atan2(P4.x - P5.x, P4.z - P5.z); //----------------------K1------------------------------------------------------------ Kw = Vector3.Distance(Pf50,P5); Kpos = (Pf50 + P5) *0.5f; if (CK[1] != "0") { K1 = Createkick.Mcx("K1", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[int.Parse(CK[1]) - 1]); K1.transform.SetParent(KICK.transform); } //----------------------K2------------------------------------------------------------ Kw = Vector3.Distance(P1,P2); Kpos = (P1 + P2) *0.5f; if (CK[2] != "0") { K2 = Createkick.Mcx("K2", Kw, K, t, Kpos.x+of, PosyK, Kpos.z, 0, -90, 0, KT[int.Parse(CK[2]) - 1]); K2.transform.SetParent(KICK.transform); } //----------------------K3------------------------------------------------------------ Kw = Vector3.Distance(P2,P3); Kpos = (P2 + P3) *0.5f; if (CK[3] != "0") { K3 = Createkick.Mcx("K3", Kw, K, t, Kpos.x, PosyK, Kpos.z-of, 0, 0, 0, KT[int.Parse(CK[3]) - 1]); K3.transform.SetParent(KICK.transform); } //----------------------K4------------------------------------------------------------ Kw = Vector3.Distance(Pf51,P4); Kpos = (Pf51 + P4) *0.5f; if (CK[4] != "0") { K4 = Createkick.Mcx("K4", Kw, K, t, Kpos.x-of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[4]) - 1]); K4.transform.SetParent(KICK.transform); } //----------------------K5------------------------------------------------------------ Kw = Vector3.Distance(P4,P5); Kpos = (P4 + P5) *0.5f; if (CK[5] != "0") { K5 = Createkick.Mcx("K5", Kw, K, t, Kpos.x-of*0.5f, PosyK, Kpos.z+of*0.5f, 0, A-90, 0, KT[int.Parse(CK[5]) - 1]); K5.transform.SetParent(KICK.transform); } KICK.transform.SetParent(BASE.transform); //LEGS if (C[73].IndexOf("LEG")!=-1) { Vector3 R = new(0, 0, 0); Vector3 P; P = new(P1.x+2, PosyK, P1.z+2); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); if(sl>=12){ P = new(P5.x-2, PosyK,P5.z+2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } P = new(P2.x + 2, PosyK, P2.z-2); LEGS.Standard(BASE, "L2", K, P, R, BLACK_G); P = new(P3.x-2, PosyK, P3.z-2); LEGS.Standard(BASE, "L4", K, P, R, BLACK_G); if(sr>=12){ P = new(P4.x-2, PosyK, P4.z+ 2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } } //COUNTER if (T != 0) { float pfr=Mathf.Max(pr, pf); float pfl=Mathf.Max(pl, pf); P1 = new(leftBox- pbl, 0, frontBox- pfl); P2 = new(leftBox- pbl, 0, backBox+ pbr); P3 = new(rightBox+ pfr, 0, backBox+ pbr); P4 = new(rightBox+ pfr, 0, backBox- sr - pfl); P5 = new(leftBox+ sl + pf , 0, frontBox- pfl); COUNTER = CounterMCX.MCX5VL("CounterTop",T, sl, W, P1, P2, P3, P4, P5, C[41]); COUNTER.transform.position = new(0, HBKT *0.5f, 0); COUNTER.transform.localRotation = Quaternion.Euler(0, 0, 0); COUNTER.transform.parent = BASE.transform; COUNTER.name = "CABCOUNTER"; } } public static void B7(){ //CONTOUR// CODE.GetDiv(C[25]); DOSIDE.PNLNew(BASE, nO,K / 2 - T / 2,DB*0.5f,HB,K,kf,t,CenterBox,Back45); //DOOR dr = W - sr; dl = DB - sl; float DW = Mathf.Sqrt((dr * dr) + (dl * dl)); //if(C[1]!="BC0" && C[1]!="BC00" )C[25]=DC.Resize(C[25],W,HB,nO); C[25] = DC.Resize(C[25], DW, HB, nO); codeD1 = C[25].Split("_"[0]); GameObject DP = Createdoor.Patern(codeD1, nO); DOOR1 = new ("DP"); float A = Mathf.Atan(dr / dl) * Mathf.Rad2Deg; DP.transform.localRotation = Quaternion.Euler(0, 90 - A, 0); DP.transform.SetParent(DOOR1.transform); DOOR1.transform.position = new(leftBox+ dr *0.5f, PosyS, frontBox+ dl *0.5f); DOOR1.transform.parent = BASE.transform; valueX=leftBox+ dr *0.5f; valueZ=frontBox+ dl *0.5f; //FILLER if (_G.OBJs[nO][50] != "NONE") { FL = CreateBoxPnl.Filler("FL", fw50, HB, t, leftBox+t*0.5f, PosyS, backBox+fw50*0.5f, 0, 90, 0, C[50]); FL.transform.parent = BASE.transform; } if (_G.OBJs[nO][51] != "NONE") { FR = CreateBoxPnl.Filler("FR", fw51, HB, t, rightBox+fw51*0.5f, PosyS, frontBox+t *0.5f, 0, 0, 0, C[51]); FR.transform.parent = BASE.transform; } //ANCHORE POINT // CREATE.EmptyPoint(BASE, "P1", leftBox, 0, backBox); // CREATE.EmptyPoint(BASE, "P2", leftBox, 0, backBox-sl); // CREATE.EmptyPoint(BASE, "P3", rightBox-sr, 0, frontBox); // CREATE.EmptyPoint(BASE, "P4", rightBox, 0, frontBox); // CREATE.EmptyPoint(BASE, "P5", rightBox, 0, backBox); //SPLASH DOBS.SplashC(BASE, C[55], W, HBK, DB, C[54]); DOBS.SplashR(BASE, C[56], W, HBK, DB, C[54]); //SINK//FAUCET if (C[67] != "NONE") { ConstructSink.AddSink(nO); } if (C[68] != "NONE") { ConstructFaucet.addfaucet(nO); } // //SHOW CAPS // string Unique_Name = _G.LibraryCabinets[C[1]].Unique_Name; // string Captext = Unique_Name + "\n" + DOIT.CSs(C[6]) + "x" + DOIT.CSs(C[7]); //CAPS.Show(Captext, BASE, DB, leftBox+ 5, frontBox+ 5); //BOTTOM Vector3[] Points=new Vector3[5]{ new(leftBox+ t, 0, backBox- sl), new(leftBox+t, 0, backBox-t), new(rightBox- t, 0, backBox- t), new(rightBox- t, 0, frontBox+ t), new(rightBox- sr, 0, frontBox+ t), }; GameObject UNDER = MCXMP.MCXV("Shelf",t, Points, C[62],"Untagged");//MCXMP.MCX5VL(t, sr, W, P1, P2, P3, P4, P5, C[62]); UNDER.transform.position = new(0, -HBKT *0.5f+ K+t, 0); UNDER.transform.parent = BASE.transform; UNDER.name = "UNDER"; //KICK P1 = new(leftBox+kf, PosyK, backBox-sl); P2 = new(leftBox+kf, PosyK, backBox-RBL); P3 = new(rightBox-RBR, PosyK, backBox-RBL); P4 = new(rightBox-RBR, PosyK,frontBox+kf); P5 = new(rightBox-sr, PosyK, frontBox+kf); if(RBL>Vector3.Distance(P1,P2))RBL=Vector3.Distance(P1,P2); if(RBR>Vector3.Distance(P4,P5))RBR=Vector3.Distance(P4,P5); P2 = new(leftBox+kf, PosyK, backBox-RBL); P3 = new(rightBox-RBR, PosyK, backBox-RBL); P4 = new(rightBox-RBR, PosyK,frontBox+kf); Pf50= P2; Pf51= P4; if( fw50!=0)Pf50= new(P2.x, PosyK, P2.z+fw50); if( fw51!=0)Pf51= new(P4.x+fw51, PosyK, P4.z); A = Mathf.Rad2Deg * Mathf.Atan2(P5.x - P1.x, P5.z - P1.z); //----------------------K1------------------------------------------------------------ Kw = Vector3.Distance(P1,Pf50); Kpos = (P1+ Pf50) *0.5f; if (CK[1] != "0") { K1 = Createkick.Mcx("K1", Kw, K, t, Kpos.x+of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[1]) - 1]); K1.transform.SetParent(KICK.transform); } //----------------------K2------------------------------------------------------------ Kw = Vector3.Distance(P2,P3); Kpos = (P2 + P3) *0.5f; if (CK[2] != "0") { K2 = Createkick.Mcx("K2", Kw, K, t, Kpos.x, PosyK, Kpos.z-of, 0, 0, 0, KT[int.Parse(CK[2]) - 1]); K2.transform.SetParent(KICK.transform); } //----------------------K3------------------------------------------------------------ Kw = Vector3.Distance(P3,P4); Kpos = (P3 + P4) *0.5f; if (CK[3] != "0") { K3 = Createkick.Mcx("K3", Kw, K, t, Kpos.x-of, PosyK, Kpos.z, 0, -90, 0, KT[int.Parse(CK[3]) - 1]); K3.transform.SetParent(KICK.transform); } //----------------------K4------------------------------------------------------------ Kw = Vector3.Distance(Pf51,P5); Kpos = (Pf51 + P5) *0.5f; if (CK[4] != "0") { K4 = Createkick.Mcx("K4", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[int.Parse(CK[4]) - 1]); K4.transform.SetParent(KICK.transform); } //----------------------K5------------------------------------------------------------ Kw = Vector3.Distance(P1,P5); Kpos = (P1 + P5) *0.5f; if (CK[5] != "0") { K5 = Createkick.Mcx("K5", Kw, K, t, Kpos.x+of*0.5f, PosyK, Kpos.z+of*0.5f, 0, A-90, 0, KT[int.Parse(CK[5]) - 1]); K5.transform.SetParent(KICK.transform); } KICK.transform.SetParent(BASE.transform); if (C[73].IndexOf("LEG")!=-1 ) { Vector3 R = new(0, 0, 0); Vector3 P; P = new(P2.x+2, PosyK, P2.z-2); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); if(sl>=12){ P = new(P1.x+ 2, PosyK, P1.z + 2); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); } P = new(P3.x-2, PosyK,P3.z-2); LEGS.Standard(BASE, "L3", K, P, R, BLACK_G); P = new(P4.x-2, PosyK, P4.z+ 2); LEGS.Standard(BASE, "L4", K, P, R, BLACK_G); if(sr>=12){ P = new(P5.x+ 2, PosyK, P5.z+ 2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } } //COUNTER if (T != 0) { float pfr=Mathf.Max(pr, pf); float pfl=Mathf.Max(pl, pf); P1 = new(leftBox- pfl, 0, backBox- sl - pf); P2 = new(leftBox- pfl, 0, backBox+ pbl); P3 = new(rightBox+ pbr, 0, backBox+ pbl); P4 = new(rightBox+ pbr, 0, frontBox- pfr); P5 = new(rightBox- sr - pf , 0, frontBox- pfr); COUNTER = CounterMCX.MCX5VR("CounterTop",T, sr + 1, W, P1, P2, P3, P4, P5, C[41]); COUNTER.transform.position = new(0, HBKT *0.5f, 0); COUNTER.transform.localRotation = Quaternion.Euler(0, 0, 0); COUNTER.transform.parent = BASE.transform; COUNTER.name = "CABCOUNTER"; } } public static void B9(){ //CONTOUR// CODE.GetDiv(C[25]); DOSIDE.PNLNew(BASE, nO, K / 2 - T / 2, DB * 0.5f, HB,K,kf,t, CenterBox, Back45); //DOOR float DW = W - sl - 0.5f; C[25] = DC.Resize(C[25], DW, HB, nO); codeD1 = C[25].Split("_"[0]); DOOR1 = Createdoor.Patern(codeD1, nO); DOOR1.transform.position = new(rightBox - DW * 0.5f - 0.25f, K * 0.5f - T * 0.5f, frontBox - DoorThickness * 0.5f); DOOR1.transform.parent = BASE.transform; valueX=rightBox- DW *0.5f - 0.25f; valueZ=frontBox+ 2; //Finger Grip edge float e1ay= HBKT*0.5f-T-1.375f *0.5f; float e1by= HBKT*0.5f-T -2f +0.625f*0.5f; DOSIDE.AddFrontEdges(BASE, C, W - sl - 0.5f, e1ay, e1by,CenterBox.x+ rightBox- DW *0.5f - 0.25f,backBox, DB); //COUNTER if (T != 0) { if (pl == 0) pl = pf; P1 = new(leftBox - pbl, 0, frontBox - pl); P2 = new(leftBox - pbl, 0, backBox + pbr); P3 = new(rightBox + pr, 0, backBox + pbr); P4 = new(rightBox + pr, 0, frontBox - pf); P5 = new(leftBox + BaseDeptCabinet + pf, 0, P4.z); P6 = new(P5.x, 0, P1.z); COUNTER = CounterMCX.MCX6VR("CounterTop", T, sr + 0, W, P1, P2, P3, P4, P5, P6, C[41]); COUNTER.transform.position = new(0, HBKT * 0.5f, 0); COUNTER.transform.localRotation = Quaternion.Euler(0, 0, 0); COUNTER.transform.parent = BASE.transform; COUNTER.name = "CABCOUNTER"; } //FILLER if (_G.OBJs[nO][50] != "NONE") { FL = CreateBoxPnl.Filler("FL", fw50, HB, t, leftBox+ BaseDeptCabinet - t *0.5f, PosyS, frontBox - fw50 *0.5f-t, 0, 90, 0, C[50]); FL.transform.parent = BASE.transform; } if (_G.OBJs[nO][51] != "NONE") { FR = CreateBoxPnl.Filler("FR", fw51, HB, t, rightBox+ fw51*0.5f, PosyS, frontBox+t*0.5f, 0, 0, 0, C[51]); FR.transform.parent = BASE.transform; } //ANCHORE POINT // CREATE.EmptyPoint(BASE, "P1", leftBox, 0, frontBox); // CREATE.EmptyPoint(BASE, "P2", leftBox+sl, 0, frontBox); // CREATE.EmptyPoint(BASE, "P3", leftBox+sl, 0, backBox-sr); // CREATE.EmptyPoint(BASE, "P4", rightBox, 0, backBox-sr); // CREATE.EmptyPoint(BASE, "P5", rightBox, 0, backBox); // CREATE.EmptyPoint(BASE, "P6", leftBox, 0, backBox); //SPLASH DOBS.SplashC(BASE, C[55], W, HBK, DB, C[54]); DOBS.SplashL(BASE, C[56], W, HBK, DB, C[54]); //RECOVER Recover.AddRecoverOnCornerCab(BASE,C,leftBox,backBox,rightBox); // //SHOW CAPS // string Unique_Name = C[1];//UIT.Value(Library.Cabinet,C[1],Header.ID); // string Captext = Unique_Name + "\n" + DOIT.CSs(C[6]) + "x" + DOIT.CSs(C[7]); //CAPS.Show(Captext, BASE, DB, W*0.5f, frontBox); //KICK P1 = new(leftBox, PosyK, frontBox-t); P2 = new(leftBox, PosyK, backBox); P3 = new(rightBox-RR, PosyK, backBox); P4 = new(rightBox-RR, PosyK, frontBox+kf); P5 = new(leftBox+ BaseDeptCabinet-kf, PosyK, frontBox+kf); P6 = new(leftBox+ BaseDeptCabinet-kf, PosyK, P1.z); Pf50=P6; Pf51=P4; if(fw50!=0){Pf50 =new(P6.x,P6.y,P6.z-fw50);} if(fw51!=0){Pf51 =new(P4.x+fw51,P4.y,P4.z);} //----------------------K1------------------------------------------------------------ Kw = Vector3.Distance(P1,P6); Kpos = (P1 + P6) *0.5f; if (CK[1] != "0") { K1 = Createkick.Mcx("K1", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[int.Parse(CK[1]) - 1]); K1.transform.SetParent(KICK.transform); } //----------------------K2------------------------------------------------------------ Kw = Vector3.Distance(P1,P2); Kpos = (P1 + P2) *0.5f; if (CK[2] != "0") { K2 = Createkick.Mcx("K2", Kw, K, t, Kpos.x+of, PosyK, Kpos.z, 0, -90, 0, KT[int.Parse(CK[2]) - 1]); K2.transform.SetParent(KICK.transform); } //----------------------K3------------------------------------------------------------ Kw = Vector3.Distance(P2,P3); Kpos = (P2 + P3) *0.5f; if (CK[3] != "0") { K3 = Createkick.Mcx("K3", Kw, K, t, Kpos.x, PosyK, Kpos.z-of, 0, 0, 0, KT[int.Parse(CK[3]) - 1]); K3.transform.SetParent(KICK.transform); } //----------------------K4------------------------------------------------------------ Kw = Vector3.Distance(P3,P4); Kpos = (P3 + P4) *0.5f; if (CK[4] != "0") { K4 = Createkick.Mcx("K4", Kw, K, t, Kpos.x-of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[4]) - 1]); K4.transform.SetParent(KICK.transform); } //----------------------K5------------------------------------------------------------ Kw = Vector3.Distance(P5,Pf51); Kpos = (Pf51 + P5) *0.5f; if (CK[5] != "0") { K5 = Createkick.Mcx("K5", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[int.Parse(CK[5]) - 1]); K5.transform.SetParent(KICK.transform); } //----------------------K6------------------------------------------------------------ Kw = Vector3.Distance(P5,Pf50); Kpos = (P5 + Pf50) *0.5f; if (CK[6] != "0") { K6 = Createkick.Mcx("K6", Kw, K, t, Kpos.x- of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[6]) - 1]); K6.transform.SetParent(KICK.transform); } KICK.transform.SetParent(BASE.transform); //LEGS if (C[73].IndexOf("LEG")!=-1) { Vector3 P; Vector3 R = new(0, 0, 0); P = new(P1.x+2, PosyK, P1.z+2); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); P = new(P2.x+2, PosyK, P2.z-2); LEGS.Standard(BASE, "L2", K, P, R, BLACK_G); P = new(P3.x-2, PosyK, P3.z - 2); LEGS.Standard(BASE, "L3", K, P, R, BLACK_G); P = new(P4.x- 2, PosyK, P4.z + 2); LEGS.Standard(BASE, "L4", K, P, R, BLACK_G); P = new(P5.x-2, PosyK,P5.z+2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); if(Vector3.Distance(P5,P6)>6){ P = new(P6.x-2, PosyK, P6.x+2); LEGS.Standard(BASE, "L6", K, P, R, BLACK_G); } } } public static void B10(){ of =t*0.5f; //SIDE PANELS CODE.GetDiv(C[25]); DOSIDE.PNLNew(BASE, nO,K / 2 - T / 2,DB*0.5f,HB,K,kf,t,CenterBox,Back45); //Create Doors float DW = W - sr - 0.5f; C[25] = DC.Resize(C[25], DW, HB, nO); codeD1 = C[25].Split("_"[0]); DOOR1 = Createdoor.Patern(codeD1, nO); DOOR1.transform.position = new(leftBox+ DW *0.5f+ 0.25f, PosyS, frontBox-DoorThickness*0.5f); DOOR1.transform.parent = BASE.transform; valueX=leftBox + DW *0.5f+ 0.25f; valueZ=frontBox+ 2; //Finger Grip edge float e1ay= HBKT*0.5f-T-1.375f *0.5f; float e1by= HBKT*0.5f-T -2f +0.625f*0.5f; DOSIDE.AddFrontEdges(BASE, C, DW, e1ay, e1by, leftBox+ DW *0.5f + 0.25f,backBox, DB); //COUNTER if (T != 0) { if (pr == 0) pr = pf; P1 = new(leftBox - pl, 0, frontBox - pf); P2 = new(leftBox - pl, 0, backBox + pbl); P3 = new(rightBox + pbr, 0, backBox + pbl); P4 = new(rightBox + pbr, 0, frontBox - pr); P5 = new(rightBox - BaseDeptCabinet - pf, 0, P4.z); P6 = new(P5.x, 0, P1.z); COUNTER = CounterMCX.MCX6VR("CounterTop", T, sr + 0, W, P1, P2, P3, P4, P5, P6, C[41]); COUNTER.transform.position = new(0, HBKT * 0.5f, 0); COUNTER.transform.localRotation = Quaternion.Euler(0, 0, 0); COUNTER.transform.parent = BASE.transform; COUNTER.name = "CABCOUNTER"; } //FILLER if (_G.OBJs[nO][50] != "NONE") { FR = CreateBoxPnl.Filler("FR", fw50, HB, t, leftBox- fw50 *0.5f, PosyS,frontBox+t*0.5f, 0, 0, 0, C[50]); FR.transform.parent = BASE.transform; } if (_G.OBJs[nO][51] != "NONE") { FL = CreateBoxPnl.Filler("FL", fw51, HB, t, rightBox- BaseDeptCabinet, PosyS,frontBox- fw51 *0.5f, 0, 90, 0, C[51]); FL.transform.parent = BASE.transform; } //ANCHORE POINT // CREATE.EmptyPoint(BASE, "P1", leftBox, 0, backBox-sl); // CREATE.EmptyPoint(BASE, "P2", leftBox, 0, backBox); // CREATE.EmptyPoint(BASE, "P3", rightBox, 0, backBox); // CREATE.EmptyPoint(BASE, "P4", rightBox, 0, frontBox); // CREATE.EmptyPoint(BASE, "P5", rightBox-sr, 0, frontBox); // CREATE.EmptyPoint(BASE, "P6", rightBox-sr, 0, backBox-sl); //SPLASH DOBS.SplashC(BASE, C[55], W, HBK, DB, C[54]); DOBS.SplashR(BASE, C[56], W, HBK, DB, C[54]); //RECOVER Recover.AddRecoverOnCornerCab(BASE,C,leftBox,backBox,rightBox); // //SHOW CAPS // string Unique_Name = UIT.Value(Library.Cabinet,C[1],Header.ID); // string Captext = Unique_Name + "\n" + DOIT.CSs(C[6]) + "x" + DOIT.CSs(C[7]); //CAPS.Show(Captext, BASE, DB, W*0.5f, frontBox); //KICK P1 = new(leftBox+RL, PosyK, frontBox+kf); P2 = new(leftBox+RL, PosyK, backBox); P3 = new(rightBox, PosyK, backBox); P4 = new(rightBox, PosyK, frontBox-DoorThickness); P5 = new(rightBox- BaseDeptCabinet+kf, PosyK, frontBox-DoorThickness); P6 = new(rightBox- BaseDeptCabinet+kf, PosyK, frontBox+kf); Pf50=P1; Pf51=P5; if(fw50!=0){Pf50=new(P1.x-fw50,P1.y,P1.z);} if(fw51!=0){Pf51=new(P5.x,P5.y,P5.z-fw51);} //----------------------K1------------------------------------------------------------ Kw = Vector3.Distance( P1,P2); Kpos = ( P1 + P2) *0.5f; if (CK[1] != "0") { K1 = Createkick.Mcx("K1", Kw, K, t, Kpos.x+ of, PosyK, Kpos.z, 0, -90, 0, KT[int.Parse(CK[1]) - 1]); K1.transform.SetParent(KICK.transform); } //----------------------K2------------------------------------------------------------ Kw = Vector3.Distance(P2,P3); Kpos = (P2 + P3) *0.5f; if (CK[2] != "0") { K2 = Createkick.Mcx("K2", Kw, K, t, Kpos.x, PosyK, Kpos.z- of, 0, 0, 0, KT[int.Parse(CK[2]) - 1]); K2.transform.SetParent(KICK.transform); } //----------------------K3------------------------------------------------------------ Kw = Vector3.Distance(P3,P4); Kpos = (P3 + P4) *0.5f; if (CK[3] != "0") { K3 = Createkick.Mcx("K3", Kw, K, t, Kpos.x- of, PosyK, Kpos.z, 0, -90, 0, KT[int.Parse(CK[3]) - 1]); K3.transform.SetParent(KICK.transform); } //----------------------K4------------------------------------------------------------ Kw = Vector3.Distance(P4,P5); Kpos = (P4 + P5) *0.5f; if (CK[4] != "0") { K4 = Createkick.Mcx("K4", Kw, K, t, Kpos.x, PosyK, Kpos.z+ of, 0, 0, 0, KT[int.Parse(CK[4]) - 1]); K4.transform.SetParent(KICK.transform); } //----------------------K5------------------------------------------------------------ Kw = Vector3.Distance(Pf51,P6); Kpos = (Pf51 + P6) *0.5f; if (CK[5] != "0") { K5 = Createkick.Mcx("K5", Kw, K, t, Kpos.x+ of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[5]) - 1]); K5.transform.SetParent(KICK.transform); } //----------------------K6------------------------------------------------------------ Kw = Vector3.Distance(Pf50,P6); Kpos = (Pf50 + P6) *0.5f; if (CK[6] != "0") { K5 = Createkick.Mcx("K6", Kw, K, t, Kpos.x, PosyK, Kpos.z+ of, 0, 0, 0, KT[int.Parse(CK[6]) - 1]); K5.transform.SetParent(KICK.transform); } KICK.transform.SetParent(BASE.transform); //LEGS if (C[73].IndexOf("LEG")!=-1 ) { Vector3 P; Vector3 R = new(0, 0, 0); P = new(P1.x+2, PosyK, P1.z+2); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); P = new(P2.x+2, PosyK, P2.z-2); LEGS.Standard(BASE, "L2", K, P, R, BLACK_G); P = new(P3.x-2, PosyK, P3.z - 2); LEGS.Standard(BASE, "L3", K, P, R, BLACK_G); P = new(P4.x- 2, PosyK, P4.z + 2); LEGS.Standard(BASE, "L4", K, P, R, BLACK_G); if(Vector3.Distance(P5,P6)>6){ P = new(P5.x-2, PosyK,P5.z+2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } P = new(P6.x-2, PosyK, P6.x+2); LEGS.Standard(BASE, "L6", K, P, R, BLACK_G); } } public static void B11(){ //CONTOUR// CODE.GetDiv(C[25]); DOSIDE.PNLNew(BASE, nO,K / 2 - T / 2,DB*0.5f,HB,K,kf,t,CenterBox,Back45); //DOOR dr = (DB - sr); dl = (W - sl); float DW = Mathf.Sqrt((dr * dr) + (dl * dl)); C[25] = DC.Resize(C[25], DW, HB, nO); codeD1 = C[25].Split("_"[0]); GameObject DP = Createdoor.Patern(codeD1, nO); DOOR1 = new ("DP"); float A = Mathf.Atan(dl / dr) * Mathf.Rad2Deg; DP.transform.localRotation = Quaternion.Euler(0, A - 90, 0); DP.transform.SetParent(DOOR1.transform); DOOR1.transform.position = new(rightBox- dl *0.5f, PosyS, frontBox+ dr *0.5f); DOOR1.transform.parent = BASE.transform; DW2 = DB - sr - 0.25f; C[26] = DC.Resize(C[26], DW2, HB, nO); codeD2 = C[26].Split("_"[0]); DOOR2 = Createdoor.Patern(codeD2, nO); DOOR2.transform.position = new(leftBox+ DW2*0.5f+0.25f, PosyS, frontBox-DoorThickness*0.5f); DOOR2.transform.parent = BASE.transform; valueX=rightBox- dl *0.5f; valueZ=frontBox + dr *0.5f; //FILLER if (_G.OBJs[nO][50] != "NONE") { FL = CreateBoxPnl.Filler("FL", fw50, HB, t, leftBox - fw50 * 0.5f, PosyS, frontBox+t*0.5f, 0, 0, 0, C[50]); FL.transform.parent = BASE.transform; } if (_G.OBJs[nO][51] != "NONE") { FR = CreateBoxPnl.Filler("FR", fw51, HB, t, rightBox-t*0.5f, PosyS, backBox + fw51 * 0.5f, 0, 90, 0, C[51]); FR.transform.parent = BASE.transform; } //ANCHORE POINT // CREATE.EmptyPoint(BASE, "P1", leftBox, 0, frontBox); // CREATE.EmptyPoint(BASE, "P2", leftBox+sl, 0, frontBox); // CREATE.EmptyPoint(BASE, "P3", rightBox, 0, backBox-sr); // CREATE.EmptyPoint(BASE, "P4", rightBox, 0, backBox); // CREATE.EmptyPoint(BASE, "P5", leftBox, 0, backBox); //SPLASH DOBS.SplashC(BASE, C[55], W, HBK, DB, C[54]); DOBS.SplashL(BASE, C[56], W, HBK, DB, C[54]); //SINK//FAUCET if (C[67] != "NONE") { ConstructSink.AddSink(nO); } if (C[68] != "NONE") { ConstructFaucet.addfaucet(nO); } // //SHOW CAPS // string Unique_Name = _G.LibraryCabinets[C[1]].Unique_Name; // string Captext = Unique_Name + "\n" + DOIT.CSs(C[6]) + "x" + DOIT.CSs(C[7]); //Show(Captext, BASE, DB, rightBox- 5, frontBox+ 5); //BOTTOM Vector3[] Points=new Vector3[5]{ new(leftBox+ t, 0, frontBox+ t), new(leftBox+ t, 0, backBox- t), new(rightBox- t, 0, backBox- t), new(rightBox- t, 0, backBox- sr), new(leftBox+ sl, 0, frontBox+ t) }; GameObject UNDER = MCXMP.MCXV("Shelf",t, Points, C[62],"Untagged");//MCXMP.MCX5VL(t, sr, W, P1, P2, P3, P4, P5, C[62]); UNDER.transform.position = new(0, -HBK *0.5f+ K, 0); UNDER.transform.parent = BASE.transform; UNDER.name = "UNDER"; //Shelf string texself = Get.BoxTex(C, 7); if (C[25].IndexOf("o") != -1 || C[25].IndexOf("w") != -1 || C[25].IndexOf("c") != -1) { CODE.GetDiv(C[25]); //ROW1 of = 0.625f; P1 = new(-W / 2 + of, 0, -DB / 2 + of); P2 = new(-W / 2 + of, 0, DB / 2 - of); P3 = new(W / 2 - of, 0, DB / 2 - of); P4 = new(W / 2 - of, 0, DB / 2 - sr); P5 = new(-W / 2 + sl, 0, -DB / 2 + of); AddShelf.Set(codeD1, BASE, DB - t * 2, W, texself, P5, P4, P3, P2, P1,K*0.5f-T*0.05f,CenterBox); } if (C[25].IndexOf("w") != -1) { if (_G.Rdiv1.Count != 0) { addWinner.AddingOnWinner(BASE, _G.Rdiv1, DB - t * 2, _G.ROWY1[0]+OY, DOIT.ConvertStringToNumber(C[6]), texself); } if (_G.Rdiv2.Count != 0) { addWinner.AddingOnWinner(BASE, _G.Rdiv2, DB - t * 2, _G.ROWY1[1]+OY, DOIT.ConvertStringToNumber(C[6]), texself); } if (_G.Rdiv3.Count != 0) { addWinner.AddingOnWinner(BASE, _G.Rdiv3, DB - t * 2, _G.ROWY1[2]+OY, DOIT.ConvertStringToNumber(C[6]), texself); } if (_G.Rdiv4.Count != 0) { addWinner.AddingOnWinner(BASE, _G.Rdiv4, DB - t * 2, _G.ROWY1[3]+OY, DOIT.ConvertStringToNumber(C[6]), texself); } if (_G.Rdiv5.Count != 0) { addWinner.AddingOnWinner(BASE, _G.Rdiv5, DB - t * 2, _G.ROWY1[4]+OY, DOIT.ConvertStringToNumber(C[6]), texself); } if (_G.Rdiv6.Count != 0) { addWinner.AddingOnWinner(BASE, _G.Rdiv6, DB - t * 2, _G.ROWY1[4]+OY, DOIT.ConvertStringToNumber(C[6]), texself); } } //KICK P1 = new(leftBox+RBL, PosyK, frontBox+kf); P2 = new(leftBox+RBL, PosyK, backBox-RBR); P3 = new(rightBox-kf, PosyK, backBox-RBR); P4 = new(rightBox-kf, PosyK, backBox-sr); P5 = new(leftBox+ sl, PosyK, frontBox+kf); if(RBL>Vector3.Distance(P1,P5))RBL=Vector3.Distance(P1,P5); if(RBR>Vector3.Distance(P3,P4))RBL=Vector3.Distance(P3,P4); P1 = new(leftBox+RBL, PosyK, frontBox+kf); P2 = new(leftBox+RBL, PosyK, backBox-RBR); P3 = new(rightBox-kf, PosyK, backBox-RBR); Pf50= P1; Pf51= P3; if( fw50!=0)Pf50= new(leftBox-fw50, PosyK, P1.z); if( fw51!=0)Pf51= new(P3.x, PosyK, backBox+fw51); A = Mathf.Rad2Deg * Mathf.Atan2(P4.x - P5.x, P4.z - P5.z); //----------------------K1------------------------------------------------------------ Kw = Vector3.Distance(Pf50,P5); Kpos = (Pf50 + P5) *0.5f; if (CK[1] != "0") { K1 = Createkick.Mcx("K1", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[int.Parse(CK[1]) - 1]); K1.transform.SetParent(KICK.transform); } //----------------------K2------------------------------------------------------------ Kw = Vector3.Distance(P1,P2); Kpos = (P1 + P2) *0.5f; if (CK[2] != "0") { K2 = Createkick.Mcx("K2", Kw, K, t, Kpos.x+of, PosyK, Kpos.z, 0, -90, 0, KT[int.Parse(CK[2]) - 1]); K2.transform.SetParent(KICK.transform); } //----------------------K3------------------------------------------------------------ Kw = Vector3.Distance(P2,P3); Kpos = (P2 + P3) *0.5f; if (CK[3] != "0") { K3 = Createkick.Mcx("K3", Kw, K, t, Kpos.x, PosyK, Kpos.z-of, 0, 0, 0, KT[int.Parse(CK[3]) - 1]); K3.transform.SetParent(KICK.transform); } //----------------------K4------------------------------------------------------------ Kw = Vector3.Distance(Pf51,P4); Kpos = (Pf51 + P4) *0.5f; if (CK[4] != "0") { K4 = Createkick.Mcx("K4", Kw, K, t, Kpos.x-of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[4]) - 1]); K4.transform.SetParent(KICK.transform); } //----------------------K5------------------------------------------------------------ Kw = Vector3.Distance(P4,P5); Kpos = (P4 + P5) *0.5f; if (CK[5] != "0") { K5 = Createkick.Mcx("K5", Kw, K, t, Kpos.x-of*0.5f, PosyK, Kpos.z+of*0.5f, 0, A-90, 0, KT[int.Parse(CK[5]) - 1]); K5.transform.SetParent(KICK.transform); } KICK.transform.SetParent(BASE.transform); //LEGS if (C[73].IndexOf("LEG")!=-1 ) { Vector3 R = new(0, 0, 0); Vector3 P; P = new(P1.x+2, PosyK, P1.z+2); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); if(sl>=12){ P = new(P5.x-2, PosyK,P5.z+2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } P = new(P2.x + 2, PosyK, P2.z-2); LEGS.Standard(BASE, "L2", K, P, R, BLACK_G); P = new(P3.x-2, PosyK, P3.z-2); LEGS.Standard(BASE, "L4", K, P, R, BLACK_G); if(sr>=12){ P = new(P4.x-2, PosyK, P4.z+ 2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } } //COUNTER if (T != 0) { float pfr=Mathf.Max(pr, pf); float pfl=Mathf.Max(pl, pf); P1 = new(leftBox- pbl, 0, frontBox- pfl); P2 = new(leftBox- pbl, 0, backBox+ pbr); P3 = new(rightBox+ pfr, 0, backBox+ pbr); P4 = new(rightBox+ pfr, 0, backBox- sr - pfl); P5 = new(leftBox+ sl + pf , 0, frontBox- pfl); COUNTER = CounterMCX.MCX5VL("CounterTop",T, sr, W, P1, P2, P3, P4, P5, C[41]); COUNTER.transform.position = new(0, HBKT *0.5f, 0); COUNTER.transform.localRotation = Quaternion.Euler(0, 0, 0); COUNTER.transform.parent = BASE.transform; COUNTER.name = "CABCOUNTER"; } } public static void B12(){ //CONTOUR// CODE.GetDiv(C[25]); DOSIDE.PNLNew(BASE, nO,K / 2 - T / 2,DB*0.5f,HB,K,kf,t,CenterBox,Back45); //DOOR dr = W - sr; dl = DB - sl; float DW = Mathf.Sqrt((dr * dr) + (dl * dl)); C[25] = DC.Resize(C[25], DW, HB, nO); codeD1 = C[25].Split("_"[0]); GameObject DP = Createdoor.Patern(codeD1, nO); DOOR1 = new ("DP"); float A = Mathf.Atan(dr / dl) * Mathf.Rad2Deg; DP.transform.localRotation = Quaternion.Euler(0, 90 - A, 0); DP.transform.SetParent(DOOR1.transform); DOOR1.transform.position = new(leftBox+ dr *0.5f, PosyS, frontBox+ dl *0.5f); DOOR1.transform.parent = BASE.transform; DW2 = DB - sr - 0.25f; C[26] = DC.Resize(C[26], DW2, HB, nO); codeD2 = C[26].Split("_"[0]); DOOR2 = Createdoor.Patern(codeD2, nO); DOOR2.transform.position = new(rightBox- DW2*0.5f-.25f, PosyS, frontBox-DoorThickness*0.5f); DOOR2.transform.parent = BASE.transform; valueX=leftBox+ dr *0.5f; valueZ=frontBox+ dl *0.5f; //FILLER if (_G.OBJs[nO][50] != "NONE") { FL = CreateBoxPnl.Filler("FL", fw50, HB, t, leftBox+t*0.5f, PosyS, backBox+fw50*0.5f, 0, 90, 0, C[50]); FL.transform.parent = BASE.transform; } if (_G.OBJs[nO][51] != "NONE") { FR = CreateBoxPnl.Filler("FR", fw51, HB, t, rightBox+fw51*0.5f, PosyS, frontBox+t *0.5f, 0, 0, 0, C[51]); FR.transform.parent = BASE.transform; } //ANCHORE POINT // CREATE.EmptyPoint(BASE, "P1", leftBox, 0, backBox); // CREATE.EmptyPoint(BASE, "P2", leftBox, 0, backBox-sl); // CREATE.EmptyPoint(BASE, "P3", rightBox-sr, 0, frontBox); // CREATE.EmptyPoint(BASE, "P4", rightBox, 0, frontBox); // CREATE.EmptyPoint(BASE, "P5", rightBox, 0, backBox); //SPLASH DOBS.SplashC(BASE, C[55], W, HBK, DB, C[54]); DOBS.SplashR(BASE, C[56], W, HBK, DB, C[54]); //SINK//FAUCET if (C[67] != "NONE") { ConstructSink.AddSink(nO); } if (C[68] != "NONE") { ConstructFaucet.addfaucet(nO); } // //SHOW CAPS // string Unique_Name = _G.LibraryCabinets[C[1]].Unique_Name; // string Captext = Unique_Name + "\n" + DOIT.CSs(C[6]) + "x" + DOIT.CSs(C[7]); //CAPS.Show(Captext, BASE, DB, leftBox+ 5, frontBox+ 5); //BOTTOM Vector3[] Points=new Vector3[5]{ new(leftBox + t, 0, backBox- sl), new(leftBox + t, 0, backBox-t), new(rightBox- t, 0, backBox- t), new(rightBox- t, 0, frontBox+ t), new(rightBox- sr, 0, frontBox+ t) }; GameObject UNDER = MCXMP.MCXV("Shelf",t, Points, C[62],"Untagged");//MCXMP.MCX5VL(t, sr, W, P1, P2, P3, P4, P5, C[62]); UNDER.transform.position = new(0, -HBKT *0.5f+ K+t, 0); UNDER.transform.parent = BASE.transform; UNDER.name = "UNDER"; //KICK P1 = new(leftBox+kf, PosyK, backBox-sl); P2 = new(leftBox+kf, PosyK, backBox-RBL); P3 = new(rightBox-RBR, PosyK, backBox-RBL); P4 = new(rightBox-RBR, PosyK,frontBox+kf); P5 = new(rightBox-sr, PosyK, frontBox+kf); if(RBL>Vector3.Distance(P1,P2))RBL=Vector3.Distance(P1,P2); if(RBR>Vector3.Distance(P4,P5))RBR=Vector3.Distance(P4,P5); P2 = new(leftBox+kf, PosyK, backBox-RBL); P3 = new(rightBox-RBR, PosyK, backBox-RBL); P4 = new(rightBox-RBR, PosyK,frontBox+kf); Pf50= P2; Pf51= P4; if( fw50!=0)Pf50= new(P2.x, PosyK, P2.z+fw50); if( fw51!=0)Pf51= new(P4.x+fw51, PosyK, P4.z); A = Mathf.Rad2Deg * Mathf.Atan2(P5.x - P1.x, P5.z - P1.z); //----------------------K1------------------------------------------------------------ Kw = Vector3.Distance(P1,Pf50); Kpos = (P1+ Pf50) *0.5f; if (CK[1] != "0") { K1 = Createkick.Mcx("K1", Kw, K, t, Kpos.x+of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[1]) - 1]); K1.transform.SetParent(KICK.transform); } //----------------------K2------------------------------------------------------------ Kw = Vector3.Distance(P2,P3); Kpos = (P2 + P3) *0.5f; if (CK[2] != "0") { K2 = Createkick.Mcx("K2", Kw, K, t, Kpos.x, PosyK, Kpos.z-of, 0, 0, 0, KT[int.Parse(CK[2]) - 1]); K2.transform.SetParent(KICK.transform); } //----------------------K3------------------------------------------------------------ Kw = Vector3.Distance(P3,P4); Kpos = (P3 + P4) *0.5f; if (CK[3] != "0") { K3 = Createkick.Mcx("K3", Kw, K, t, Kpos.x-of, PosyK, Kpos.z, 0, -90, 0, KT[int.Parse(CK[3]) - 1]); K3.transform.SetParent(KICK.transform); } //----------------------K4------------------------------------------------------------ Kw = Vector3.Distance(Pf51,P5); Kpos = (Pf51 + P5) *0.5f; if (CK[4] != "0") { K4 = Createkick.Mcx("K4", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[int.Parse(CK[4]) - 1]); K4.transform.SetParent(KICK.transform); } //----------------------K5------------------------------------------------------------ Kw = Vector3.Distance(P1,P5); Kpos = (P1 + P5) *0.5f; if (CK[5] != "0") { K5 = Createkick.Mcx("K5", Kw, K, t, Kpos.x+of*0.5f, PosyK, Kpos.z+of*0.5f, 0, A-90, 0, KT[int.Parse(CK[5]) - 1]); K5.transform.SetParent(KICK.transform); } KICK.transform.SetParent(BASE.transform); if (C[73].IndexOf("LEG")!=-1) { Vector3 R = new(0, 0, 0); Vector3 P; P = new(P2.x+2, PosyK, P2.z-2); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); if(sl>=12){ P = new(P1.x+ 2, PosyK, P1.z + 2); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); } P = new(P3.x-2, PosyK,P3.z-2); LEGS.Standard(BASE, "L3", K, P, R, BLACK_G); P = new(P4.x-2, PosyK, P4.z+ 2); LEGS.Standard(BASE, "L4", K, P, R, BLACK_G); if(sr>=12){ P = new(P5.x+ 2, PosyK, P5.z+ 2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } } //COUNTER if (T != 0) { float pfr=Mathf.Max(pr, pf); float pfl=Mathf.Max(pl, pf); P1 = new(leftBox- pfl, 0, backBox- sl - pf); P2 = new(leftBox- pfl, 0, backBox+ pbl); P3 = new(rightBox+ pbr, 0, backBox+ pbl); P4 = new(rightBox+ pbr, 0, frontBox- pfr); P5 = new(rightBox- sr - pf , 0, frontBox- pfr); COUNTER = CounterMCX.MCX5VR("CounterTop",T, sr + 1, W, P1, P2, P3, P4, P5, C[41]); COUNTER.transform.position = new(0, HBKT *0.5f, 0); COUNTER.transform.localRotation = Quaternion.Euler(0, 0, 0); COUNTER.transform.parent = BASE.transform; COUNTER.name = "CABCOUNTER"; } } public static void B19(){ //CONTOUR Panneau de contour P1=new(leftBox,PosyS,-DB*0.5f); P2=new(leftBox,PosyS,DB*0.5f-12); P3=new(leftBox+12,PosyS,DB*0.5f); P4=new(rightBox,PosyS,DB*0.5f); P5=new(rightBox,PosyS,DB*0.5f-sr); P6=new(leftBox+sl,PosyS,-DB*0.5f); float sw; Vector3 ps; sw = Vector3.Distance(P1,P6);ps = (P1 + P6) *0.5f; S1 = CreateBoxPnl.Side("S1", sw, HB, t, ps.x+of, PosyS, ps.z+of, 0, 0, 0, Get.BoxTex(C, 1)); S1.transform.parent = BASE.transform; sw = Vector3.Distance(P1,P2);ps = (P1 + P2) *0.5f; S2 = CreateBoxPnl.Side("S2", sw, HB, t, ps.x+of, PosyS, ps.z, 0, 90, 0, Get.BoxTex(C, 2));S2.transform.parent = BASE.transform; sw = Vector3.Distance(P2,P3);ps = (P2 + P3) *0.5f; S3 = CreateBoxPnl.Side("S3", sw, HB, t, ps.x+of*0.5f, PosyS, ps.z-of*0.5f, 0, -45, 0, Get.BoxTex(C, 3));S3.transform.parent = BASE.transform; sw = Vector3.Distance(P3,P4);ps = (P3 + P4) *0.5f; S4 = CreateBoxPnl.Side("S4", sw, HB, t, ps.x, PosyS, ps.z-of, 0, 0, 0, Get.BoxTex(C, 4));S4.transform.parent = BASE.transform; sw = Vector3.Distance(P4,P5);ps = (P4 + P5) *0.5f; S5 = CreateBoxPnl.Side("S5", sw, HB, t, ps.x-of, PosyS, ps.z, 0, 90, 0, Get.BoxTex(C, 5));S5.transform.parent = BASE.transform; sw = Vector3.Distance(P1,P6);ps = (P1 + P6) *0.5f; if(SideModel[0]=="N1" || SideModel[0]=="N0"){S1B = CreateBoxPnl.Side("S1B", sw-kf, K, t, ps.x-kf*0.5f, PosyK, ps.z+of, 0, 0, 0, Get.BoxTex(C, 1)); S1B.transform.parent = BASE.transform;} sw = Vector3.Distance(P1,P2);ps = (P1 + P2) *0.5f; if(SideModel[1]=="N1" || SideModel[1]=="N0"){S2B = CreateBoxPnl.Side("S2B", sw, K, t, ps.x+of, PosyK, ps.z, 0, 90, 0, Get.BoxTex(C, 2));S2B.transform.parent = BASE.transform;} sw = Vector3.Distance(P2,P3);ps = (P2 + P3) *0.5f; if(SideModel[2]=="N1" || SideModel[2]=="N0"){S3B = CreateBoxPnl.Side("S3B", sw, K, t, ps.x-of, PosyK, ps.z+of, 0, -45, 0, Get.BoxTex(C, 3));S3B.transform.parent = BASE.transform;} sw = Vector3.Distance(P3,P4);ps = (P3 + P4) *0.5f; if(SideModel[3]=="N1" || SideModel[3]=="N0"){S4B = CreateBoxPnl.Side("S4B", sw, K, t, ps.x, PosyK, ps.z-of, 0, 0, 0, Get.BoxTex(C, 4));S4B.transform.parent = BASE.transform;} sw = Vector3.Distance(P4,P5);ps = (P4 + P5) *0.5f; if(SideModel[4]=="N1" || SideModel[4]=="N0"){S5B = CreateBoxPnl.Side("S5B", sw-kf, K, t, ps.x-of, PosyK, ps.z+kf*0.5f, 0, 90, 0, Get.BoxTex(C, 5));S5B.transform.parent = BASE.transform;} //TOP if (_P.TopPnlUnder == "full" && C[67] == "NONE") { Vector3[] Point=new Vector3[5]{ new(leftBox+ of, 0, backBox- sl), new(leftBox+ of, 0, backBox- of), new(rightBox- of, 0, backBox- of), new(rightBox- of, 0, frontBox+ of), new(rightBox- sr, 0, frontBox+ of), }; TOP = MCXMP.MCXV("Shelf",t, Point, Get.BoxTex(C, 5),"Untagged");//MCXMP.MCX5VL(T, sr, W, P1, P2, P3, P4, P5, Get.BoxTex(C, 5)); TOP.transform.position = new(0, HBKT *0.5f-T-t*0.5f, 0); TOP.transform.parent = BASE.transform; } //DOOR dr = DB - sr; dl = W - sl; float DW = Mathf.Sqrt((dr * dr) + (dl * dl)); C[25] = DC.Resize(C[25], DW, HB, nO); codeD1 = C[25].Split("_"[0]); GameObject DP = Createdoor.Patern(codeD1, nO); DOOR1 = new ("DP"); float A = Mathf.Atan(dl / dr) * Mathf.Rad2Deg; DP.transform.localRotation = Quaternion.Euler(0, A - 90, 0); DP.transform.SetParent(DOOR1.transform); DOOR1.transform.position = new(rightBox- dl *0.5f, PosyS, frontBox+ dr *0.5f); DOOR1.transform.parent = BASE.transform; valueX=rightBox- dl *0.5f; valueZ=frontBox + dr *0.5f; //FILLER P1=new(leftBox+sl-t*0.5f,PosyS,-DB*0.5f-fw50*0.5f); P6=new(rightBox+fw51*0.5f,PosyS,DB*0.5f-sr+t*0.5f); if (_G.OBJs[nO][50] != "NONE") { FL = CreateBoxPnl.Filler("FL", fw50, HB, t, P1.x, PosyS,P1.z, 0, 90, 0, C[50]); FL.transform.parent = BASE.transform; } if (_G.OBJs[nO][51] != "NONE") { FR = CreateBoxPnl.Filler("FR", fw51, HB, t, P6.x, PosyS,P6.z, 0, 0, 0, C[51]); FR.transform.parent = BASE.transform; } //SPLASH DOBS.SplashC(BASE, C[55], W, HBK, DB, C[54]); DOBS.SplashR(BASE, C[56], W, HBK, DB, C[54]); //SINK//FAUCET if (C[67] != "NONE") { ConstructSink.AddSink(nO); } if (C[68] != "NONE") { ConstructFaucet.addfaucet(nO); } // //SHOW CAPS // string Unique_Name = _G.LibraryCabinets[C[1]].Unique_Name; // string Captext = Unique_Name + "\n" + DOIT.CSs(C[6]) + "x" + DOIT.CSs(C[7]); //CAPS.Show(Captext, BASE, DB, leftBox+ 5, frontBox+ 5); // //KICK //float kf_RR=Mathf.Max(kf, RR); P1 = new(leftBox, PosyK, frontBox+RL); P2 = new(leftBox, PosyK, backBox-12); P3 = new(leftBox+12, PosyK, backBox); P4 = new(rightBox-RR, PosyK, backBox); P5 = new(rightBox-RR, PosyK, backBox-sr+kf); P6 = new(leftBox+sl-kf, PosyK, frontBox+RR); P7 = new(leftBox+sl-kf, PosyK, frontBox+RR); P8 = new(leftBox+sl-kf, PosyK, frontBox+RR); A = Mathf.Rad2Deg * Mathf.Atan2(P6.x - P5.x, P6.z - P5.z); //print("C[34]====="+C[34]); //----------------------K1------------------------------------------------------------ Kw = Vector3.Distance(P1,P6); Kpos = (P1 + P6) *0.5f; if (CK[1] != "0") { K1 = Createkick.Mcx("K1", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[int.Parse(CK[1]) - 1]); K1.transform.SetParent(KICK.transform); } // //----------------------K2--------------------------------------------------------- Kw = Vector3.Distance(P1,P2); Kpos = (P1 + P2) *0.5f; if (CK[2] != "0") { K2 = Createkick.Mcx("K2", Kw, K, t, Kpos.x+of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[2]) - 1]); K2.transform.SetParent(KICK.transform); } //----------------------K3------------------------------------------------------------ Kw = Vector3.Distance(P2,P3); Kpos = (P2 + P3) *0.5f; if (CK[3] != "0") { K3 = Createkick.Mcx("K3", Kw, K, t, Kpos.x+of, PosyK, Kpos.z-of, 0, -45, 0, KT[int.Parse(CK[3]) - 1]); K3.transform.SetParent(KICK.transform); } //----------------------K4------------------------------------------------------------ Kw = Vector3.Distance(P3,P4); Kpos = (P3 + P4) *0.5f; if (CK[4] != "0") { K4 = Createkick.Mcx("K4", Kw, K, t, Kpos.x, PosyK, Kpos.z-of, 0, 0, 0, KT[int.Parse(CK[4]) - 1]); K4.transform.SetParent(KICK.transform); } //----------------------K5------------------------------------------------------------ Kw = Vector3.Distance(P4,P5); Kpos = (P4 + P5) *0.5f; if (CK[5] != "0") { K5 = Createkick.Mcx("K5", Kw, K, t, Kpos.x-of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[5]) - 1]); K5.transform.SetParent(KICK.transform); } //----------------------K6------------------------------------------------------------ Kw = Vector3.Distance(P5,P6); Kpos = (P5 + P6) *0.5f; if (CK[6] != "0") { K6 = Createkick.Mcx("K6", Kw, K, t, Kpos.x-of*0.5f, PosyK, Kpos.z+of*0.5f, 0, A-90 , 0, KT[int.Parse(CK[6]) - 1]); K6.transform.SetParent(KICK.transform);} if(fw50!=0 && CK[6] != "0"){ Kw = fw50; Pf50=new(P6.x,P6.y,P6.z-fw50); Kpos = (P6 + Pf50) *0.5f; K7 = Createkick.Mcx("K7", Kw, K, t, Kpos.x-of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[6]) - 1]); K7.transform.SetParent(KICK.transform); } if(fw51!=0 && CK[6] != "0"){ Kw = fw51; Pf51=new(P5.x+fw51,P5.y,P5.z); Kpos = (P5 + Pf51) *0.5f; K8 = Createkick.Mcx("K8", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[int.Parse(CK[6]) - 1]); K8.transform.SetParent(KICK.transform); } KICK.transform.SetParent(BASE.transform); //LEGS if (C[73].IndexOf("LEG")!=-1) { Vector3 R = new(0, 0, 0); Vector3 P; P = new(P1.x+ 2, PosyK, P1.z+2); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); P = new(P2.x+ 2, PosyK, P2.z-2); LEGS.Standard(BASE, "L2", K, P, R, BLACK_G); P = new(P3.x+ 2, PosyK, P3.z-2); LEGS.Standard(BASE, "L3", K, P, R, BLACK_G); P = new(P4.x-2, PosyK, P4.z-2); LEGS.Standard(BASE, "L4", K, P, R, BLACK_G); if(sr>=12){ P = new(P5.x-2, PosyK,P5.z+2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } if(sl>=12){ P = new(P6.x-2, PosyK,P6.z+2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } } //COUNTER if (T != 0) { //("C[42]===="+C[42]); string[] CP = C[42].Split("_");//Counter projection float cp1=DOIT.ConvertStringToNumber(CP[1]); float cp2=DOIT.ConvertStringToNumber(CP[2]); float cp3=DOIT.ConvertStringToNumber(CP[3]); float cp4=DOIT.ConvertStringToNumber(CP[4]); float cp5=DOIT.ConvertStringToNumber(CP[5]); float cp6=DOIT.ConvertStringToNumber(CP[6]); float bd=12;//back distance float pfr=Mathf.Max(pr, pf); float pfl=Mathf.Max(pl, pf); P1 = new(leftBox- cp2, 0, frontBox- cp1); P2 = new(leftBox- cp2, 0, backBox-bd+cp3/0.707f); P3 = new(leftBox+ 12, 0, backBox+ cp4); P4 = new(rightBox+ cp5, 0, backBox+ cp4); P5 = new(rightBox+ cp5, 0, backBox- sr-cp6); P6 = new(leftBox+ sl + cp6 , 0, frontBox- cp1); COUNTER = CounterMCX.MCX6VL("CounterTop",T, sl, W, P1, P2, P3, P4, P5, P6, C[41]); COUNTER.transform.position = new(0, HBKT *0.5f, 0); COUNTER.transform.localRotation = Quaternion.Euler(0, 0, 0); COUNTER.transform.parent = BASE.transform; COUNTER.name = "CABCOUNTER"; } //BOTTOM Vector3[] Points=new Vector3[6]{ new(leftBox+ t, 0, frontBox+t), new(leftBox+ t, 0, backBox-12-t ), new(leftBox+12+t, 0, backBox-t), new(rightBox-t, 0, backBox-t), new(rightBox-t, 0, backBox-sr+t), new(leftBox+sl-t, 0, frontBox+of) }; GameObject UNDER = MCXMP.MCXV("Shelf",t, Points, C[62],"Untagged"); UNDER.transform.position = new(0, -HBKT *0.5f+ K, 0); UNDER.transform.parent = BASE.transform; UNDER.name = "UNDER"; } public static void B20(){ //CONTOUR Panneau de contour P1=new(leftBox,PosyS,DB*0.5f-sl); P2=new(leftBox,PosyS,DB*0.5f); P3=new(rightBox-12,PosyS,DB*0.5f); P4=new(rightBox,PosyS,DB*0.5f-12); P5=new(rightBox,PosyS,-DB*0.5f); P6=new(rightBox-sr,PosyS,-DB*0.5f); of =t*0.5f; float sw; Vector3 ps; sw = Vector3.Distance(P1,P2);ps = (P1 + P2) *0.5f; S1 = CreateBoxPnl.Side("S1", sw, HB, t, ps.x+of, PosyS, ps.z, 0, -90, 0, Get.BoxTex(C, 1)); S1.transform.parent = BASE.transform; sw = Vector3.Distance(P2,P3);ps = (P2 + P3) *0.5f; S2 = CreateBoxPnl.Side("S2", sw, HB, t, ps.x, PosyS, ps.z-of, 0, 0, 0, Get.BoxTex(C, 2));S2.transform.parent = BASE.transform; sw = Vector3.Distance(P3,P4);ps = (P3 + P4) *0.5f; S3 = CreateBoxPnl.Side("S3", sw, HB, t, ps.x-of*0.5f, PosyS, ps.z-of*0.5f, 0, 45, 0, Get.BoxTex(C, 3));S3.transform.parent = BASE.transform; sw = Vector3.Distance(P4,P5);ps = (P4 + P5) *0.5f; S4 = CreateBoxPnl.Side("S4", sw, HB, t, ps.x-of, PosyS, ps.z, 0, 90, 0, Get.BoxTex(C, 4));S4.transform.parent = BASE.transform; sw = Vector3.Distance(P5,P6);ps = (P5 + P6) *0.5f; S5 = CreateBoxPnl.Side("S5", sw, HB, t, ps.x, PosyS, ps.z+of, 0, 0, 0, Get.BoxTex(C, 5));S5.transform.parent = BASE.transform; // //CONTOUR Panneau de contour sw = Vector3.Distance(P1,P2);ps = (P1 + P2) *0.5f; if(SideModel[0]=="N1" || SideModel[0]=="N0"){S1B = CreateBoxPnl.Side("S1B", sw-kf, K, t, ps.x+of, PosyK, ps.z+kf*0.5f, 0, -90, 0, Get.BoxTex(C, 1)); S1B.transform.parent = BASE.transform;} sw = Vector3.Distance(P2,P3);ps = (P2 + P3) *0.5f; if(SideModel[1]=="N1" || SideModel[1]=="N0"){S4B = CreateBoxPnl.Side("S4B", sw, K, t, ps.x, PosyK, ps.z-of, 0, 0, 0, Get.BoxTex(C, 2));S4B.transform.parent = BASE.transform;} sw = Vector3.Distance(P3,P4);ps = (P3 + P4) *0.5f; if(SideModel[2]=="N1" || SideModel[2]=="N0"){S2B = CreateBoxPnl.Side("S2B", sw, K, t, ps.x-of*0.5f, PosyK, ps.z-of*0.5f, 0, 45, 0, Get.BoxTex(C, 3)); S2B.transform.parent = BASE.transform;} sw = Vector3.Distance(P4,P5);ps = (P4 + P5) *0.5f; if(SideModel[3]=="N1" || SideModel[3]=="N0"){S3B = CreateBoxPnl.Side("S3B", sw, K, t, ps.x-of, PosyK, ps.z, 0, 90, 0, Get.BoxTex(C, 4)); S3B.transform.parent = BASE.transform;} sw = Vector3.Distance(P5,P6);ps = (P5 + P6) *0.5f; if(SideModel[4]=="N1" || SideModel[4]=="N0"){S5B = CreateBoxPnl.Side("S5B", sw-kf, K, t, ps.x+kf*0.5f, PosyK, ps.z+of, 0, 0, 0, Get.BoxTex(C, 5));S5B.transform.parent = BASE.transform;} //TOP if (_P.TopPnlUnder == "full" && C[67] == "NONE") { Vector3[] Point=new Vector3[5]{ P1 = new(leftBox+ of, 0, backBox- sl), P2 = new(leftBox+ of, 0, backBox- of), P3 = new(rightBox- of, 0, backBox- of), P4 = new(rightBox- of, 0, frontBox+ of), P5 = new(rightBox- sr, 0, frontBox+ of) }; TOP = MCXMP.MCXV("Shelf",T, Point, Get.BoxTex(C, 5),"Untagged");//MCXMP.MCX5VL(T, sr, W, P1, P2, P3, P4, P5, Get.BoxTex(C, 5)); TOP.transform.position = new(0, HBKT *0.5f-T-t*0.5f, 0); TOP.transform.parent = BASE.transform; } //DOOR dr = W - sr; dl = DB - sl; float DW = Mathf.Sqrt((dr * dr) + (dl * dl)); C[25] = DC.Resize(C[25], DW, HB, nO); codeD1 = C[25].Split("_"[0]); GameObject DP = Createdoor.Patern(codeD1, nO); DOOR1 = new ("DP"); float A = Mathf.Atan(dr / dl) * Mathf.Rad2Deg; DP.transform.localRotation = Quaternion.Euler(0, 90 - A, 0); DP.transform.SetParent(DOOR1.transform); DOOR1.transform.position = new(leftBox+ dr *0.5f, PosyS, frontBox+ dl *0.5f); DOOR1.transform.parent = BASE.transform; valueX=leftBox+ dr *0.5f; valueZ=frontBox+ dl *0.5f; //COUNTER if (T != 0) { string[] CP = C[42].Split("_");//Counter projection float cp1=DOIT.ConvertStringToNumber(CP[1]); float cp2=DOIT.ConvertStringToNumber(CP[2]); float cp3=DOIT.ConvertStringToNumber(CP[3]); float cp4=DOIT.ConvertStringToNumber(CP[4]); float cp5=DOIT.ConvertStringToNumber(CP[5]); float cp6=DOIT.ConvertStringToNumber(CP[6]); P1 = new(leftBox- cp1, 0, backBox- sl - cp6); P2 = new(leftBox- cp1, 0, backBox+ cp2); P3 = new(rightBox+ cp3, 0, backBox+ cp2); P4 = new(rightBox+ cp4, 0, frontBox- pr); P5 = new(rightBox- sr - pf - DoorThickness, 0, frontBox- pr); P6 = new(rightBox- sr - pf - DoorThickness, 0, frontBox- pr); COUNTER = CounterMCX. MCX6VR("CounterTop",T, sr + 1, W, P1, P2, P3, P4, P5, P6, C[41]); COUNTER.transform.position = new(0, HBKT *0.5f, 0); COUNTER.transform.localRotation = Quaternion.Euler(0, 0, 0); COUNTER.transform.parent = BASE.transform; COUNTER.name = "CABCOUNTER"; } //FILLER P1=new(leftBox-fw50*0.5f, PosyS, DB*0.5f-sl+t*0.5f); P6=new(rightBox-sr+t*0.5f, PosyS, -DB*0.5f-fw51*0.5f); if (_G.OBJs[nO][50] != "NONE") { FL = CreateBoxPnl.Filler("FL", fw50, HB, t, P1.x, PosyS,P1.z, 0, 0, 0, C[50]); FL.transform.parent = BASE.transform; } if (_G.OBJs[nO][51] != "NONE") { FR = CreateBoxPnl.Filler("FR", fw51, HB, t, P6.x, PosyS,P6.z, 0, 90, 0, C[51]); FR.transform.parent = BASE.transform; } // //ANCHORE POINT // CREATE.EmptyPoint(BASE, "P1", leftBox, 0, backBox); // CREATE.EmptyPoint(BASE, "P2", leftBox, 0, backBox-sl); // CREATE.EmptyPoint(BASE, "P3", rightBox-sr, 0, frontBox); // CREATE.EmptyPoint(BASE, "P4", rightBox, 0, frontBox); // CREATE.EmptyPoint(BASE, "P5", rightBox, 0, backBox-12); // CREATE.EmptyPoint(BASE, "P6", rightBox-12, 0, backBox); //SPLASH DOBS.SplashC(BASE, C[55], W, HBK, DB, C[54]); DOBS.SplashR(BASE, C[56], W, HBK, DB, C[54]); //SINK//FAUCET if (C[67] != "NONE") { ConstructSink.AddSink(nO); } if (C[68] != "NONE") { ConstructFaucet.addfaucet(nO); } // //SHOW CAPS // string Unique_Name = _G.LibraryCabinets[C[1]].Unique_Name; // string Captext = Unique_Name + "\n" + DOIT.CSs(C[6]) + "x" + DOIT.CSs(C[7]); //CAPS.Show(Captext, BASE, DB, leftBox+ 5, frontBox+ 5); // //KICK P1 = new(leftBox+RL, PosyK, backBox-sl+RR+kf); P2 = new(leftBox+RL, PosyK, backBox); P3 = new(rightBox-12, PosyK, backBox); P4 = new(rightBox, PosyK, backBox-12); P5 = new(rightBox, PosyK, frontBox+RR); P6 = new(rightBox-sr+kf, PosyK, frontBox+RR); A = Mathf.Rad2Deg * Mathf.Atan2(P6.x - P1.x, P6.z - P1.z); //----------------------K1------------------------------------------------------------ Kw = Vector3.Distance(P1,P2); Kpos = (P1 + P2) *0.5f; if (CK[1] != "0") { K1 = Createkick.Mcx("K1", Kw, K, t, Kpos.x+of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[1]) - 1]); K1.transform.SetParent(KICK.transform); } // //----------------------K2--------------------------------------------------------- Kw = Vector3.Distance(P2,P3); Kpos = (P2 + P3) *0.5f; if (CK[2] != "0") { K2 = Createkick.Mcx("K2", Kw, K, t, Kpos.x, PosyK, Kpos.z-of, 0, 0, 0, KT[int.Parse(CK[2]) - 1]); K2.transform.SetParent(KICK.transform); } //----------------------K3------------------------------------------------------------ Kw = Vector3.Distance(P3,P4); Kpos = (P3 + P4) *0.5f; if (CK[3] != "0") { K3 = Createkick.Mcx("K3", Kw, K, t, Kpos.x-of, PosyK, Kpos.z-of, 0, 45, 0, KT[int.Parse(CK[3]) - 1]); K3.transform.SetParent(KICK.transform); } //----------------------K4------------------------------------------------------------ Kw = Vector3.Distance(P4,P5); Kpos = (P4 + P5) *0.5f; if (CK[4] != "0") { K4 = Createkick.Mcx("K4", Kw, K, t, Kpos.x-of, PosyK, Kpos.z, 0, -90, 0, KT[int.Parse(CK[4]) - 1]); K4.transform.SetParent(KICK.transform); } //----------------------K5------------------------------------------------------------ Kw = Vector3.Distance(P5,P6); Kpos = (P5 + P6) *0.5f; if (CK[5] != "0") { K5 = Createkick.Mcx("K5", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[int.Parse(CK[5]) - 1]); K5.transform.SetParent(KICK.transform); } //----------------------K6------------------------------------------------------------ Kw = Vector3.Distance(P1,P6); Kpos = (P1 + P6) *0.5f; if (CK[6] != "0") { K6 = Createkick.Mcx("K6", Kw, K, t, Kpos.x+of*0.5f, PosyK, Kpos.z+of*0.5f, 0, A-90 , 0, KT[0]); K6.transform.SetParent(KICK.transform); } if(fw50!=0){ Kw = fw50; Pf50=new(P1.x-fw50,P1.y,P1.z); Kpos = (P1 + Pf50) *0.5f; K6 = Createkick.Mcx("K6", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[0]); K6.transform.SetParent(KICK.transform); } if(fw51!=0){ Kw = fw51; Pf51=new(P6.x,P6.y,P6.z-fw51); Kpos = (P6 + Pf51) *0.5f; //("CK[5]===="+CK[5]); K7 = Createkick.Mcx("K7", Kw, K, t, Kpos.x+of, PosyK, Kpos.z, 0, 90, 0, KT[0]); K7.transform.SetParent(KICK.transform); } KICK.transform.SetParent(BASE.transform); //LEGS if (C[73].IndexOf("LEG")!=-1) { Vector3 R = new(0, 0, 0); Vector3 P; P = new(P1.x+ 2, PosyK, P1.z+2); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); P = new(P2.x+ 2, PosyK, P2.z-2); LEGS.Standard(BASE, "L2", K, P, R, BLACK_G); P = new(P3.x-2, PosyK, P3.z-2); LEGS.Standard(BASE, "L3", K, P, R, BLACK_G); P = new(P4.x-2, PosyK, P4.z-2); LEGS.Standard(BASE, "L4", K, P, R, BLACK_G); if(sr>=12){ P = new(P5.x-2, PosyK,P5.z+2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } if(sl>=12){ P = new(P6.x+2, PosyK,P6.z+2); LEGS.Standard(BASE, "L6", K, P, R, BLACK_G); } } //BOTTOM float bl=W-sl; float br=DB-sr; Vector3[] Points=new Vector3[6]{ new(leftBox+ of, 0, backBox- sl+of), new(leftBox+ of, 0, backBox- of), new(rightBox- bl-of, 0, backBox-of), new(rightBox-of, 0, backBox- br-of), new(rightBox-of, 0, frontBox+of), new(rightBox- sr+of, 0, frontBox+of), }; GameObject UNDER = MCXMP.MCXV("Shelf",-t, Points, C[62],"Untagged"); UNDER.transform.position = new(0, -HBKT *0.5f+ K, 0); UNDER.transform.parent = BASE.transform; UNDER.name = "UNDER"; } public static void B26(){ //CONTOUR S2 = CreateBoxPnl.Side("S2", DB - t, HB, t, leftBox+ t *0.5f, PosyS, t *0.5f, 0, -90, 0, Get.BoxTex(C, 2)); S2.transform.parent = BASE.transform; S3 = CreateBoxPnl.Side("S3", W - t * 2, HB, t, 0, PosyS, backBox- t *0.5f, 0, 0, 0, Get.BoxTex(C, 3)); S3.transform.parent = BASE.transform; if(SideModel[1]=="N1" || SideModel[1]=="N0"){ S2B = CreateBoxPnl.Side("S2B", DB - t-kf, K, t, leftBox+ t *0.5f, PosyK, t *0.5f+kf*0.5f, 0, -90, 0, Get.BoxTex(C, 2));S2B.transform.parent = BASE.transform;} if(SideModel[2]=="N1" || SideModel[2]=="N0"){ S3B = CreateBoxPnl.Side("S3B", W - t * 2-kf, K, t, 0-kf*0.5f, PosyK, backBox- t *0.5f, 0, 0, 0, Get.BoxTex(C, 3));S3B.transform.parent = BASE.transform;} //TOP UNDER Vector3[] Points=new Vector3[5]{ new(leftBox+ t, 0, frontBox+ t), new(leftBox+ t, 0, backBox- t), new(rightBox- t, 0, backBox- t), new(rightBox- t, 0, backBox- sr), new(leftBox+ sl, 0, frontBox+ t) }; TOP = MCXMP.MCXV("Shelf",t, Points, Get.BoxTex(C, 5),"Untagged");//MCXMP.MCX5VL(t, sl, W, P1, P2, P3, P4, P5, Get.BoxTex(C, 5)); TOP.transform.position = new(0, HBKT *0.5f-T, 0); UNDER=Instantiate(TOP); UNDER.transform.position = new(0, -HBKT *0.5f+ K+t, 0); TOP.transform.parent = BASE.transform; TOP.name = "TOP"; UNDER.transform.parent = BASE.transform; UNDER.name = "UNDER"; //DOOR dr = DB - sr; dl = W - sl; float DW = Mathf.Sqrt((dr * dr) + (dl * dl)); C[25] = DC.Resize(C[25], DW, HB, nO); codeD1 = C[25].Split("_"[0]); valueX=rightBox- dl *0.5f; valueZ=frontBox + dr *0.5f; //LEGS if (C[73].IndexOf("LEG")!=-1) { Vector3 R = new(0, 0, 0); Vector3 P = new(leftBox+ sl*0.5f, PosyK, frontBox + _G.caKD + 3); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); P = new(leftBox+ 2, PosyK, backBox- 2); LEGS.Standard(BASE, "L2", K, P, R, BLACK_G); P = new(rightBox- _G.caKD - 3, PosyK, backBox-sr*0.5f); LEGS.Standard(BASE, "L3", K, P, R, BLACK_G); } // //ANCHORE POINT // CREATE.EmptyPoint(BASE, "P1", leftBox, 0, frontBox); // CREATE.EmptyPoint(BASE, "P2", leftBox+sl, 0, frontBox); // CREATE.EmptyPoint(BASE, "P3", rightBox, 0, backBox-sr); // CREATE.EmptyPoint(BASE, "P4", rightBox, 0, backBox); // CREATE.EmptyPoint(BASE, "P5", leftBox, 0, backBox); //SPLASH DOBS.SplashC(BASE, C[55], W, HBK, DB, C[54]); DOBS.SplashR(BASE, C[56], W, HBK, DB, C[54]); //Shelf string texself = Get.BoxTex(C, 7); if (C[25].IndexOf("o") != -1 || C[25].IndexOf("w") != -1 || C[25].IndexOf("c") != -1) { CODE.GetDiv(C[25]); AddShelf.Set(codeD1, BASE, DB - t * 2, W, texself, P5, P4, P3, P2, P1,K*0.5f-T*0.05f,CenterBox); } ///FILLER P1=new(leftBox,PosyS,frontBox); P3=new(rightBox,PosyS,backBox); if (_G.OBJs[nO][50] != "NONE") { FL = CreateBoxPnl.Filler("FL", fw50, HB, t, P1.x-fw50*0.5f, P1.y, P1.z+t*0.5f, 0, 0, 0, C[50]); FL.transform.parent = BASE.transform; } if (_G.OBJs[nO][51] != "NONE") { FR = CreateBoxPnl.Filler("FR", fw51, HB, t, P3.x-t *0.5f, P3.y, P3.z+fw51*0.5f , 0, 90, 0, C[51]); FR.transform.parent = BASE.transform; } //KICK P1 = new(leftBox+RBL, PosyK, frontBox+kf); P2 = new(leftBox+RBL, PosyK, backBox-RBR); P3 = new(rightBox-kf, PosyK, backBox-RBR); P4 = new(rightBox-kf, PosyK, backBox-sr); P5 = new(leftBox+ sl, PosyK, frontBox+kf); if(RBL>Vector3.Distance(P1,P5))RBL=Vector3.Distance(P1,P5); if(RBR>Vector3.Distance(P3,P4))RBL=Vector3.Distance(P3,P4); P1 = new(leftBox+RBL, PosyK, frontBox+kf); P2 = new(leftBox+RBL, PosyK, backBox-RBR); P3 = new(rightBox-kf, PosyK, backBox-RBR); Pf50= P1; Pf51= P3; if( fw50!=0)Pf50= new(leftBox-fw50, PosyK, P1.z); if( fw51!=0)Pf51= new(P3.x, PosyK, backBox+fw51); float A = Mathf.Rad2Deg * Mathf.Atan2(P4.x - P5.x, P4.z - P5.z); //----------------------K1------------------------------------------------------------ Kw = Vector3.Distance(Pf50,P5); Kpos = (Pf50 + P5) *0.5f; if (CK[1] != "0") { K1 = Createkick.Mcx("K1", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[int.Parse(CK[1]) - 1]); K1.transform.SetParent(KICK.transform); } //----------------------K2------------------------------------------------------------ Kw = Vector3.Distance(P1,P2); Kpos = (P1 + P2) *0.5f; if (CK[2] != "0") { K2 = Createkick.Mcx("K2", Kw, K, t, Kpos.x+of, PosyK, Kpos.z, 0, -90, 0, KT[int.Parse(CK[2]) - 1]); K2.transform.SetParent(KICK.transform); } //----------------------K3------------------------------------------------------------ Kw = Vector3.Distance(P2,P3); Kpos = (P2 + P3) *0.5f; if (CK[3] != "0") { K3 = Createkick.Mcx("K3", Kw, K, t, Kpos.x, PosyK, Kpos.z-of, 0, 0, 0, KT[int.Parse(CK[3]) - 1]); K3.transform.SetParent(KICK.transform); } //----------------------K4------------------------------------------------------------ Kw = Vector3.Distance(Pf51,P4); Kpos = (Pf51 + P4) *0.5f; if (CK[4] != "0") { K4 = Createkick.Mcx("K4", Kw, K, t, Kpos.x-of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[4]) - 1]); K4.transform.SetParent(KICK.transform); } //----------------------K5------------------------------------------------------------ Kw = Vector3.Distance(P4,P5); Kpos = (P4 + P5) *0.5f; if (CK[5] != "0") { K5 = Createkick.Mcx("K5", Kw, K, t, Kpos.x-of*0.5f, PosyK, Kpos.z+of*0.5f, 0, A-90, 0, KT[int.Parse(CK[5]) - 1]); K5.transform.SetParent(KICK.transform); } KICK.transform.SetParent(BASE.transform); //LEGS if (C[73].IndexOf("LEG")!=-1 ) { Vector3 R = new(0, 0, 0); Vector3 P; P = new(P1.x+2, PosyK, P1.z+2); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); if(sl>=12){ P = new(P5.x-2, PosyK,P5.z+2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } P = new(P2.x + 2, PosyK, P2.z-2); LEGS.Standard(BASE, "L2", K, P, R, BLACK_G); P = new(P3.x-2, PosyK, P3.z-2); LEGS.Standard(BASE, "L4", K, P, R, BLACK_G); if(sr>=12){ P = new(P4.x-2, PosyK, P4.z+ 2); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } } //SINK//FAUCET if (C[67] != "NONE") { ConstructSink.AddSink(nO); } if (C[68] != "NONE") { ConstructFaucet.addfaucet(nO); } // //SHOW CAPS // string Unique_Name = _G.LibraryCabinets[C[1]].Unique_Name; // string Captext = Unique_Name + "\n" + DOIT.CSs(C[6]) + "x" + DOIT.CSs(C[7]); //CAPS.Show(Captext, BASE, DB, leftBox+ 5, frontBox+ 5); //COUNTER if (T != 0) { float pfr=Mathf.Max(pr, pf); float pfl=Mathf.Max(pl, pf); P1 = new(leftBox- pbl, 0, frontBox- pfl); P2 = new(leftBox- pbl, 0, backBox+ pbr); P3 = new(rightBox+ pfr, 0, backBox+ pbr); P4 = new(rightBox+ pfr, 0, backBox- sr - pfl); P5 = new(leftBox+ sl + pf , 0, frontBox- pfl); COUNTER = CounterMCX.MCX5VL("CounterTop",T, sl, W, P1, P2, P3, P4, P5, C[41]); COUNTER.transform.position = new(0, HBKT *0.5f, 0); COUNTER.transform.localRotation = Quaternion.Euler(0, 0, 0); COUNTER.transform.parent = BASE.transform; COUNTER.name = "CABCOUNTER"; } } public static void B27(){ //CONTOUR// CODE.GetDiv(C[25]); DOSIDE.PNLNew(BASE, nO,K / 2 - T / 2,DB*0.5f,HB,K,kf,t,CenterBox,Back45); //DOOR dr = W - sr; dl = DB - sl; float DW = Mathf.Sqrt((dr * dr) + (dl * dl)); C[25] = DC.Resize(C[25], DW, HB, nO); codeD1 = C[25].Split("_"[0]); valueX=leftBox+ dr *0.5f; valueZ=frontBox+ dl *0.5f; // //ANCHORE POINT // CREATE.EmptyPoint(BASE, "P1", leftBox, 0, backBox); // CREATE.EmptyPoint(BASE, "P2", leftBox, 0, backBox-sl); // CREATE.EmptyPoint(BASE, "P3", rightBox-sr, 0, frontBox); // CREATE.EmptyPoint(BASE, "P4", rightBox, 0, frontBox); // CREATE.EmptyPoint(BASE, "P5", rightBox, 0, backBox); //SPLASH DOBS.SplashC(BASE, C[55], W, HBK, DB, C[54]); DOBS.SplashR(BASE, C[56], W, HBK, DB, C[54]); //Shelf AddShelf.OnOpening(C,BASE,0, W, 0 ,DB, t,"45_Right",CenterBox); //FILLER if (_G.OBJs[nO][50] != "NONE") { FL = CreateBoxPnl.Filler("FL", fw50, HB, t, leftBox+t*0.5f, PosyS, backBox+fw50*0.5f, 0, 90, 0, C[50]); FL.transform.parent = BASE.transform; } if (_G.OBJs[nO][51] != "NONE") { FR = CreateBoxPnl.Filler("FR", fw51, HB, t, rightBox+fw51*0.5f, PosyS, frontBox+t *0.5f, 0, 0, 0, C[51]); FR.transform.parent = BASE.transform; } // //SHOW CAPS // string Unique_Name = _G.LibraryCabinets[C[1]].Unique_Name; // string Captext = Unique_Name + "\n" + DOIT.CSs(C[6]) + "x" + DOIT.CSs(C[7]); //CAPS.Show(Captext, BASE, DB, leftBox+ 5, frontBox+ 5); //KICK P1 = new(leftBox+kf, PosyK, backBox-sl); P2 = new(leftBox+kf, PosyK, backBox-RBL); P3 = new(rightBox-RBR, PosyK, backBox-RBL); P4 = new(rightBox-RBR, PosyK,frontBox+kf); P5 = new(rightBox-sr, PosyK, frontBox+kf); if(RBL>Vector3.Distance(P1,P2))RBL=Vector3.Distance(P1,P2); if(RBR>Vector3.Distance(P4,P5))RBR=Vector3.Distance(P4,P5); P2 = new(leftBox+kf, PosyK, backBox-RBL); P3 = new(rightBox-RBR, PosyK, backBox-RBL); P4 = new(rightBox-RBR, PosyK,frontBox+kf); Pf50= P2; Pf51= P4; if( fw50!=0)Pf50= new(P2.x, PosyK, P2.z+fw50); if( fw51!=0)Pf51= new(P4.x+fw51, PosyK, P4.z); float A = Mathf.Rad2Deg * Mathf.Atan2(P5.x - P1.x, P5.z - P1.z); //----------------------K1------------------------------------------------------------ Kw = Vector3.Distance(P1,Pf50); Kpos = (P1+ Pf50) *0.5f; if (CK[1] != "0") { K1 = Createkick.Mcx("K1", Kw, K, t, Kpos.x+of, PosyK, Kpos.z, 0, 90, 0, KT[int.Parse(CK[1]) - 1]); K1.transform.SetParent(KICK.transform); } //----------------------K2------------------------------------------------------------ Kw = Vector3.Distance(P2,P3); Kpos = (P2 + P3) *0.5f; if (CK[2] != "0") { K2 = Createkick.Mcx("K2", Kw, K, t, Kpos.x, PosyK, Kpos.z-of, 0, 0, 0, KT[int.Parse(CK[2]) - 1]); K2.transform.SetParent(KICK.transform); } //----------------------K3------------------------------------------------------------ Kw = Vector3.Distance(P3,P4); Kpos = (P3 + P4) *0.5f; if (CK[3] != "0") { K3 = Createkick.Mcx("K3", Kw, K, t, Kpos.x-of, PosyK, Kpos.z, 0, -90, 0, KT[int.Parse(CK[3]) - 1]); K3.transform.SetParent(KICK.transform); } //----------------------K4------------------------------------------------------------ Kw = Vector3.Distance(Pf51,P5); Kpos = (Pf51 + P5) *0.5f; if (CK[4] != "0") { K4 = Createkick.Mcx("K4", Kw, K, t, Kpos.x, PosyK, Kpos.z+of, 0, 0, 0, KT[int.Parse(CK[4]) - 1]); K4.transform.SetParent(KICK.transform); } //----------------------K5------------------------------------------------------------ Kw = Vector3.Distance(P1,P5); Kpos = (P1 + P5) *0.5f; if (CK[5] != "0") { K5 = Createkick.Mcx("K5", Kw, K, t, Kpos.x, PosyK, Kpos.z, 0, A-90, 0, KT[int.Parse(CK[5]) - 1]); K5.transform.SetParent(KICK.transform); } KICK.transform.SetParent(BASE.transform); //LEGS if (C[73].IndexOf("LEG")!=-1) { Vector3 R = new(0, 0, 0); Vector3 P; P = new(P2.x+4, PosyK, P2.z-2); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); if(sl>=12){ P = new(P1.x+ 2, PosyK, P1.z +4); LEGS.Standard(BASE, "L1", K, P, R, BLACK_G); } P = new(P3.x-2, PosyK,P3.z-2); LEGS.Standard(BASE, "L3", K, P, R, BLACK_G); P = new(P4.x-2, PosyK, P4.z+ 4); LEGS.Standard(BASE, "L4", K, P, R, BLACK_G); if(sr>=12){ P = new(P5.x+ 2, PosyK, P5.z+ 4); LEGS.Standard(BASE, "L5", K, P, R, BLACK_G); } } //COUNTER if (T != 0) { float pfr=Mathf.Max(pr, pf); float pfl=Mathf.Max(pl, pf); P1 = new(leftBox- pfl, 0, backBox- sl - pf); P2 = new(leftBox- pfl, 0, backBox+ pbl); P3 = new(rightBox+ pbr, 0, backBox+ pbl); P4 = new(rightBox+ pbr, 0, frontBox- pfr); P5 = new(rightBox- sr - pf , 0, frontBox- pfr); COUNTER = CounterMCX.MCX5VR("CounterTop",T, sr + 1, W, P1, P2, P3, P4, P5, C[41]); COUNTER.transform.position = new(0, HBKT *0.5f, 0); COUNTER.transform.localRotation = Quaternion.Euler(0, 0, 0); COUNTER.transform.parent = BASE.transform; COUNTER.name = "CABCOUNTER"; } } }