using System.Collections.Generic; using System.Runtime.InteropServices; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.UI; public class PRESET : MonoBehaviour { public static void addPRESET(string path){ Set.alpha(Get.o2(path,"COLOR_SLIDER"),false); Set.alpha(Get.o2(path,"COLORS"),false); Set.alpha(Get.o2(path+"/SHOWSELECTION","CREATETEXTURE"),false); Set.alpha(Get.o2(path+"/SHOWSELECTION","DELETEFROMLIST"),false); Set.alpha(Get.o2(path,"FINISH"),false); if(Get.ToggleOnInChild(path+"FILTERS/Viewport/Content")=="CreateIt"){ Set.alpha(Get.o2(path,"COLORS"),true); Set.alpha(Get.o2(path,"COLOR_SLIDER"),true); Set.alpha(Get.o2(path,"FINISH"),true); } if(Get.ToggleOnInChild(path+"FILTERS/Viewport/Content")=="YourLibrary"){ Set.alpha(Get.o2(_G.PON+"/SHOWSELECTION","DELETEFROMLIST"),true); } } public static void AddColor(string path, Dictionary DIC){ Set.alpha(Get.o1(path),true); GameObject PresetPNL=Get.o2(path+"/Viewport","ContentPreset"); DOIT.DELETEAllObjectChild(PresetPNL); for(int i=0; i().color=DOIT.CSc(Code[0],255); P.transform.SetSiblingIndex(DIC.Count); } Set.ToggleGroupToAllChild(path+"/Viewport/ContentPreset"); PresetPNL.transform.GetChild(0).GetComponent().isOn = true; } //CabTextures public static void AddColorCabTexture(string path, Dictionary DIC){ Set.alpha(Get.o1(path).transform.parent.parent.gameObject,true); GameObject PresetPNL=Get.o1(path); DOIT.DELETEAllObjectChild(PresetPNL); for(int i=0; i().color=DOIT.CSc(Code[4],255); P.transform.SetSiblingIndex(DIC.Count); } Set.ToggleGroupToAllChild(path); PresetPNL.transform.GetChild(0).GetComponent().isOn = true; } public static string[] GetColorGrout(string path){ string name=Get.ToggleOnInChild(path+"PRESET_COLOR/Viewport/ContentPreset"); return _C._PresetColorGrout["P"+name].Split('_'); } public void ClickColors(){ if(_G.PON!="TEXTUREPNL" && _G.PON!="CABDOORpnl"){ string[]code = _C._PresetColorCabTexture["P"+name].Split('_');// Color Gout Material Mat=Get.o1(_G.PON+"/SHOWSELECTION/IMAGE/Image").GetComponent().material; Mat.SetFloat("_contrast", DOIT.ConvertStringToNumber(code[0])); Mat.SetColor("_c1",DOIT.CSc(code[1],255)); Mat.SetColor("_c2",DOIT.CSc(code[2],255)); Mat.SetColor("_c3",DOIT.CSc(code[3],255)); Get.o1(_G.PON+"/SHOWSELECTION/IMAGE/Image").GetComponent().SetMaterialDirty(); } if(_G.PON=="TEXTUREPNL"){ if(transform.parent.parent.parent.name == "PRESET_COLOR") { _G.SC[3] = _C._PresetColorFloor["P"+name].Split('_')[1]; SliderColor.SetOntarget(); } if(transform.parent.parent.parent.name =="PresetGrout"){ _G.SC[4] = _C._PresetColorGrout["P"+name].Split('_')[1];// Color Gout SliderColor.SetOntarget(); } } if(_G.PON=="CABDOORpnl"){ string name=UIT.TogOn("TEXTCOL"); //UIT_DOORCAB.ShowSelecded(name); } } public void ClickColorsCabTexture(){ print(name); if (transform.parent.parent.parent.name == "PresetColor") { string name=Get.ToggleOnInChild("TEXTUREPNL/PresetColor/Viewport/ContentPresetTexture"); _G.SC[3] = _C._PresetColorFloor["P"+name].Split('_')[1]; } if(transform.parent.parent.parent.name =="PresetGrout"){ string name=Get.ToggleOnInChild("TEXTUREPNL/PresetGrout/Viewport/ContentPresetTexture"); _G.SC[4] = _C._PresetColorGrout["P"+name].Split('_')[1];// Color Gout } if(transform.parent.parent.parent.name =="PresetColorCabtexture"){ string name=Get.ToggleOnInChild("TEXTUREPNL/PresetGrout/Viewport/ContentPresetTexture"); _G.SC[4] = _C._PresetColorGrout["P"+name].Split('_')[1];// Color Gout } } }