using UnityEngine.UI; using System.Collections.Generic; using UnityEngine; using System.Collections; public class UIT_AddToPNL : MonoBehaviour { static GameObject BTN; static GameObject List; public static void AddModel(){ StaticCoroutine.Start(WaitHideScroller("MODELS")); } public static void SetFilter(){ GameObject List = Get.o2(_G.PON+"/FILTERS/Viewport","Content"); DOIT.DELETEAllObjectChild(List); GameObject BTNFILTERS=Instantiate(Get.o2(_G.PON+"BASEBTN","UIT_BTNFILTERS")); GameObject Filter1 = Instantiate(BTNFILTERS); Filter1.name = "Standard"; Filter1.transform.SetParent(List.transform, false); Filter1.SetActive(true); Filter1.transform.Find("Background/text").GetComponent().text = "Standard"; // GameObject Filter2 = Instantiate(BTNFILTERS); // Filter2.name = "YourLibrary"; // Filter2.transform.SetParent(List.transform, false); // Filter2.SetActive(true); // Filter2.transform.Find("Background/text").GetComponent().text = "Your Library"; // GameObject Filter3 = Instantiate(BTNFILTERS); // Filter3.name = "CreateIt"; // Filter3.transform.SetParent(List.transform, false); // Filter3.SetActive(true); // Filter3.transform.Find("Background/text").GetComponent().text = "Create it"; Set.ToggleGroupToAllChild(_G.PON + "/FILTERS/Viewport/Content"); List.transform.GetChild(0).GetComponent().isOn = true; } public static void ShowLibrary(string filter){ if(filter=="Standard"){ Standard(); } if(filter=="YourLibrary"){ YourLibrary(); } if(filter=="CreateIt"){ CreateIt();} //Rotation //if(_G.PNL=="Kick" || _G.PNL=="Fascia" || _G.PNL=="Ogee"|| _G.PNL=="Cornice" || _G.PNL=="Valance")MoldingPNL.Rotate(90); //if(_G.PNL=="Filler")MoldingPNL.Rotate(0); } public static void Standard(){ SetFilterSelect(); List L=UIT.GetLibrary("CabTexture"); for(int i=1; i L=UIT.GetLibrary("CabTexture"); for(int i=1; i().color=DOIT.CSc("ffffff",255); Get.o2(_G.PON+"/COLORS/ColorPickerTexture_2/Button","Image").GetComponent().color=DOIT.CSc("393A39",255); Get.o2(_G.PON+"/COLORS/ColorPickerTexture_3/Button","Image").GetComponent().color=DOIT.CSc("ffffff",255); StaticCoroutine.Start(WaitHideScroller("TEXTCOL")); //if(_G.PON=="CABDOORpnl")UIT_DOORCAB.ShowSelecded("TEXT.1.1"); if(_G.PON=="UNIVERSALpnl")UIT_UNIVERSALPnl.Showselecded(); if(_G.PON=="MOLDINGpnl")UIT_MOLDING.ShowSelecded("TEXT.1.1"); //if(_G.PON=="PANELpnl")UIT_PANELPnl.ShowSelecded("TEXT.1.1"); } public static void AddbtntoList(GameObject List,GameObject btn,int i){ GameObject C = Instantiate(btn); string filter= UIT.TogOn("FILTERS"); string IDTexture; string finish=""; string Texture=""; if(filter=="YourLibrary" || filter=="Standard" ){ List L=UIT.GetLibrary("CabTexture"); IDTexture=L[i].Split(',')[0]; C.name=IDTexture; finish=UIT.Value("CabTexture",IDTexture,"Finish"); if(finish=="M")finish=TRANS.This("T_Mat"); if(finish=="S")finish=TRANS.This("T_Semi"); if(finish=="G")finish=TRANS.This("T_Gloss"); Texture=UIT.Value("CabTexture",IDTexture,"L"+_G.L); } else {C.name="TEXT.1."+(i+1).ToString();} C.transform.SetParent(List.transform, false); if (List.transform.childCount < 20) {C.SetActive(true);} if(filter=="CreateIt"){ // C.transform.Find("Background").GetComponent().material = UIT_MATERIAL.GetMaterialCreateIt(C.name,"PNL"); // Texture=TRANS.This("T_Grain"); } else C.transform.Find("Background").GetComponent().material = UIT_MATERIAL.GetMaterial(C.name); C.transform.Find("Image").transform.Find("Text").gameObject.GetComponent().text =Texture+" "+(i+0).ToString()+" "+finish; Texture=TRANS.This("T_Grain"); } public static void SetFilterSelect(){ PRESET.addPRESET(_G.PON); BTN = Get.o2(_G.PON + "/BASEBTN","UIT_BTNTEXCOL"); List = Get.o1(_G.PON + "/TEXTCOL/Viewport/Content"); DOIT.DELETEAllObjectChild(List); } public void DeleteFromList(){ _M.PH(22, 0, "ffffff", 1, 1); Get.o2("HIDER/MESSAGE","btnOK").SetActive(true); GameObject.Find("btnOK").GetComponent().onClick.AddListener(() => YesDelete()); } public void YesDelete(){ string Oname=UIT.TogOn("TEXTCOL"); List L=UIT.GetLibrary("CabTexture"); for(int i=0; i 0){ listpnl.transform.GetChild(0).GetComponent().isOn=true; Set.ToggleGroupToAllChild(_G.PON+"/"+PnlName+"/Viewport/Content"); } //Rotation //if(_G.PNL=="Kick" || _G.PNL=="Fascia" || _G.PNL=="Ogee"|| _G.PNL=="Cornice" || _G.PNL=="Valance")MoldingPNL.Rotate(90); //if(_G.PNL=="Filler")MoldingPNL.Rotate(0); } }