using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class BlocPNL : MonoBehaviour { public GameObject _BlocPnl; public GameObject _ModelContainer; public GameObject _BTNMODEL; public GameObject _EdgeBtn; public Text _W; public Text _H; public Text _D; public Text _FF; public GameObject _ColorPicker2; public void StartPNL() { print("--------Bloc panell reach---------------"); _G.PON="DECOpnl"; DOIT.CloseALLPNL(); _BlocPnl.SetActive(true); DOIT.DELETEAllObjectChild(_ModelContainer); //Add IconBtn DOIT.DELETEAllObjectChild(_ModelContainer); int qty=17; List Object_list =new(); for(int i=1; i().text = TRANS.This("T_BLOC") + " " + (i + 1).ToString(); O.transform.Find("Background").GetComponent().sprite = Resources.Load("ICONS/BLOC/BLOC" + (101 + i).ToString()); } Set.ToggleGroupToAllChild(_G.PON + "/MODEL/Viewport/Content"); _ColorPicker2.SetActive(false); // _G.SC[0] = ""; // _G.SC[4] = "D2D2D2"; // _G.SC[8] = "M"; // _G.ff = "0"; // SceneModeManager.Instance.SetSceneMode(SceneModes.Panel);//"PNL"; // float NO = 16; // float maxw = 8; // DOIT.BTNPNL("TOG1", 100, "MODEL", "BLOC", NO, maxw, "BLOC/"); // DOIT.Sizebackground(NO, maxw); // GameObject.Find("EMPTYLpnl/MODEL").transform.localPosition = new Vector3(0, 5, 0); // float HBG = 140 + (NO / maxw) * 110f; // DOIT.OffMODIFYER(); // GameObject.Find("EMPTYLpnl").transform.Find("CATEGORY").gameObject.SetActive(true); // //Category // DOIT.BTNCAT("BLOCK", 1, "BLOCK", "", "", "","",""); // GameObject.Find("EMPTYLpnl").transform.Find("CATEGORY").transform.localPosition = new Vector3(0, HBG / 2 - 35, 1); // //Modifiyer // GameObject Modifier=Get.o2("EMPTYLpnl","MODIFYER"); // Modifier.transform.Find("WHDFF").gameObject.SetActive(true); // Modifier.transform.localPosition = new Vector3(0, -HBG / 2 + 50, 1); // Modifier.transform.Find("WHDFF/MoR").gameObject.SetActive(false); // Modifier.transform.Find("WHDFF").GetComponent().sizeDelta=new(460,50); // _G.SC[1] = "30"; _G.SC[2] = "60"; _G.SC[3] = "24"; // GameObject.Find("mW").GetComponent().text = _G.SC[1] + _G.Sys; // GameObject.Find("mH").GetComponent().text = _G.SC[2] + _G.Sys; // GameObject.Find("mD").GetComponent().text = _G.SC[3] + _G.Sys; // GameObject.Find("mFF").GetComponent().text = _G.ff + _G.Sys; } public void ModelSelected(){ print("name===="+name); string w="",h="",d=""; switch (name) { case "BLOC101": w = "6"; h = _G.HEIGHT.ToString(); d = "6"; _G.ff = "0"; break; case "BLOC102": w = _G.WIDE.ToString(); h = "6"; d = "6"; _G.ff = (_G.HEIGHT - 6).ToString(); break; case "BLOC103": w = "30"; h = _G.HEIGHT.ToString(); d = "1.5"; _G.ff = "0"; break; case "BLOC104": w = "24"; h = "2"; d = "10"; _G.ff = "60"; break; case "BLOC105": w = "24"; h = "24"; d = "24"; _G.ff = "0"; break; case "BLOC106": w = "72"; h = "24"; d = "1"; _G.ff = "36"; break; case "BLOC107": w = "2"; h = "84"; d = "24"; _G.ff = "0"; break; case "BLOC108": w = "12"; h = "84"; d = "12"; _G.ff = "0"; break; case "BLOC109": w = "12"; h = "84"; d = "12"; _G.ff = "0"; break; case "BLOC110": w = "36"; h = "12"; d = "12"; _G.ff = "0"; break; case "BLOC111": w = "36"; h = "12"; d = "12"; _G.ff = "0"; break; case "BLOC112": w = "36"; h = "30"; d = "36"; _G.ff = "0"; break; case "BLOC113": w = "36"; h = "30"; d = "36"; _G.ff = "0"; break; case "BLOC114": w = "36"; h = "30"; d = "36"; _G.ff = "0"; break; case "BLOC115": w = "4"; h = "34"; d = "4"; _G.ff = "0"; break; case "BLOC116": w = "36"; h = "4"; d = "4"; _G.ff = "36"; break; } _W.text=w; _H.text=h; _D.text=d; _FF.text=_G.ff; } public static void Add() { _G.SC[1] = GameObject.Find("mW").GetComponent().text; _G.SC[2] = GameObject.Find("mH").GetComponent().text; _G.SC[3] = GameObject.Find("mD").GetComponent().text; _G.ff = GameObject.Find("mFF").GetComponent().text; print("from add _G.SC[0]===="+_G.SC[0]); if(Get.Bool(_G.SC[0],"BLOC112_BLOC113_BLOC114")){ _G.SC[9]=DOIT.CSss( Get.o2("DECOpnl/SIZE/MoR/Btn Mesure","mRadius").GetComponent().text); print("_G.SC[9]===="+_G.SC[9]); } DOIT.CloseALLPNL(); _M.PH(3,230, "ffffff", 1, 1); PAINT.SEL = "ON"; SceneModeManager.Instance.SetSceneMode(SceneModes.Install); _G.addOBJ = "bloc"; } public void ColorChange() { _G.SC[4] = name; } public static int GetArchAssetIndex(int number) { return number switch { 1 => 17, 2 => 18, 3 => 19, _ => -1, }; } public static Vector3 GetBlockAssetScale(string blockModel) { float width = 0.0f; float height = 0.0f; float depth = 0.0f; switch (blockModel) { case "BLOC117": width = 24.1875f; height = 24.1875f; depth = 1.5f; break; case "BLOC118": width = 28.375f; height = 28.375f; depth = 1.5f; break; case "BLOC119": width = 28.9375f; height = 96.0f; depth = 1.5f; break; } return new Vector3(width, height, depth); } }