using UnityEngine.UI; using UnityEngine; using System; public class SidePanel : MonoBehaviour { public void Add() { print("---ADD SIDE TO CABINET---"); GameObject List = Get.o2("EDITCABpnl/EDITOR/SidePanel", "List"); //Get new Side_Panel_Recipe string S1 = GetSideDropValue(List, "S1"); string S2 = GetSideDropValue(List, "S2"); string S3 = GetSideDropValue(List, "S3"); string S4 = GetSideDropValue(List, "S4"); string S5 = GetSideDropValue(List, "S5"); string Under = "Std"; string Top = GetTopDropValue(List, "Top"); string Side_Panel_Recipe = S1 + "_" + S2 + "_" + S3 + "_" + S4 + "_" + S5 + "_" + Under + "_" + Top; //Get Exterior_Finish_Recipe string E1 = GetSwitchBool(List, "Exterior", "S1"); string E2 = GetSwitchBool(List, "Exterior", "S2"); string E3 = GetSwitchBool(List, "Exterior", "S3"); string E4 = GetSwitchBool(List, "Exterior", "S4"); string E5 = GetSwitchBool(List, "Exterior", "S5"); string EUnder = GetSwitchBool(List, "Exterior", "Under"); string ETop = GetSwitchBool(List, "Exterior", "Top"); string Exterior_Finish_Recipe = E1 + "_" + E2 + "_" + E3 + "_" + E4 + "_" + E5 + "_" + EUnder + "_" + ETop; //Get Exterior_Finish_Recipe string I1 = GetSwitchBool(List, "Interior", "S1"); string I2 = GetSwitchBool(List, "Interior", "S2"); string I3 = GetSwitchBool(List, "Interior", "S3"); string I4 = GetSwitchBool(List, "Interior", "S4"); string I5 = GetSwitchBool(List, "Interior", "S5"); string IUnder = GetSwitchBool(List, "Interior", "Under"); string ITop = GetSwitchBool(List, "Interior", "Top"); string Interior_Finish_Recipe = I1 + "_" + I2 + "_" + I3 + "_" + I4 + "_" + I5 + "_" + IUnder + "_" + ITop; //ADD to OBJECT string On = Get.ToggleOnInChild("EDITCABpnl/EDITOR/SidePanel/FINNISH"); string[] C = _G.OBJs[_G.nO]; C[83] = Exterior_Finish_Recipe; C[87] = Interior_Finish_Recipe; C[78] = Side_Panel_Recipe; if (On.StartsWith("G")) { C[82] = UIT.Global(Header.Ext_Finish,int.Parse(On[1..]));//GlobalSelectionManager.GetValue(GlobalOption.EXTPNL_2, int.Parse(On[1..])); C[69] = UIT.Global(Header.Ext_Finish,int.Parse(On[1..]));//GlobalSelectionManager.GetValue(GlobalOption.EXTPNL_2, int.Parse(On[1..])); } DOIT.REDOCAB(_G.nO); DOIT.CloseALLPNL(); //_MOL.SetMolding(); // print("RC==="+SC); } public string GetSideDropValue(GameObject List,string NamePanel){ if(List.transform.Find(NamePanel)!=null){ Dropdown DROP=List.transform.Find(NamePanel).transform.Find("Drop").gameObject.GetComponent(); string TextShow= DROP.options[DROP.value].text; return TextShow switch { "Standard" => "Std", "Estándar" => "Std", "Over" => "Over", "Plein" => "Over", "Encima" => "Over", "Notched" => "Notch", "Entaillé" => "Notch", "Mellado" => "Notch", "None" => "None", "Aucun" => "None", "Ninguno" => "None", "Finger Grip" => "FG", "Finger Grip Notched"=> "FGN", "Finger Grip Entaillé" => "FGN", "Finger Grip Mellado"=> "FGN", _ => throw new NotImplementedException(), }; } return "None"; } public string GetSideDropValueFingerGrip(GameObject List,string NamePanel){ if(List.transform.Find(NamePanel)!=null){ Dropdown DROP=List.transform.Find(NamePanel).transform.Find("Drop").gameObject.GetComponent(); int value=DROP.value; return value switch { 0 => "FGN", 1 => "FG", _ => throw new NotImplementedException(), }; } return "None"; } public string GetTopDropValue(GameObject List,string NamePanel){ if(List.transform.Find(NamePanel)!=null){ Dropdown DROP=List.transform.Find(NamePanel).transform.Find("Drop").gameObject.GetComponent(); int value=DROP.value; return value switch { 0 => "Stretch", 1 => "BackStretch", 2 => "Full", 3 => "None", _ => throw new NotImplementedException(), }; } return "None"; } public string GetSwitchBool(GameObject List, string CategoryFinish, string NamePanel) { if (List.transform.Find(NamePanel) != null) { if (List.transform.Find(NamePanel).transform.Find(CategoryFinish).gameObject.GetComponent().isOn) return "1"; } return "0"; } public static string GetSide_Panel_Recipe(string[] C) { return GetSide_Panel_Recipe(C[4], _G.LibraryCabinets[C[1]].GetPropertyValue(CsvHeaders.Unique_Name)); } public static string GetSide_Panel_Recipe(string C4,string Unique_Name){ string C78="Std_Std_Std_Std_Std_Std_Std"; if(C4 == "B1"){C78="Std_Std_Std_None_None_Std_Stretch";} if(C4 == "W1"){C78="Std_Std_Std_None_None_Std_Full";} if(C4 == "T1"){C78="Std_Std_Std_None_None_Std_Full";} if(Get.Bool(C4,"B9_B10_B2_B3_B5_B6_B7_W9_W10_W2_W3_W5_W6_W7")){C78="Std_Std_Std_Std_None_Std_Full";} if( _G.PATH=="atelier_jacob" || _G.PATH=="cuisines_action" ) { if(C4 == "B1" ){C78="Notch_Std_Notch_None_None_Std_Stretch";} if(C4 == "B1" && Unique_Name.IndexOf("FG")!=-1 &&_G.PATH=="atelier_jacob"){C78="FGN_Std_FGN_None_None_Std_Stretch";} if(C4 == "B1" && Unique_Name.IndexOf("FG")!=-1 &&_G.PATH=="atelier_jacob" && Unique_Name.IndexOf("SUP")!=-1 ){C78="FG_Std_FG_None_None_Std_Stretch";} if(C4 == "W1"){C78="Std_Std_Std_None_None_Std_Full";} if(C4 == "T1"){C78="Notch_Std_Notch_None_None_Std_Full";} if(Get.Bool(C4,"B9")){C78="Std_Notch_Std_Notch_None_Std_Strtch";} if(Get.Bool(C4,"B10")){C78="Notch_Std_Notch_Std_None_Std_Strtch";} if(C4 == "B9" && Unique_Name.IndexOf("FG")!=-1 &&_G.PATH=="atelier_jacob"){C78="Std_Notch_Std_FGN_None_Std_Strtch";} if(C4 == "B10"&& Unique_Name.IndexOf("FG")!=-1 &&_G.PATH=="atelier_jacob"){C78="FGN_Std_Notch_Std_None_Std_Strtch";} if(Get.Bool(C4,"B2_B3_B4_B5")){C78="Notch_Std_Std_Notch_None_Std_Full";} if(Get.Bool(C4,"W2_W3_W4_W5_W6_W7_W9_W10")){C78="Std_Std_Std_Std_None_Std_Full";} if(Get.Bool(C4,"W26_W27")){C78="None_Std_Std_None_None_Std_Full";} if(Get.Bool(C4,"B6_B7")){C78="Std_Notch_Notch_Std_None_Std_Full";} if(Get.Bool(C4,"B26_B27")){C78="None_Notch_Notch_None_None_Std_Full";} } return C78; } }