using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class EditSelect : MonoBehaviour { // [SerializeField] GameObject PNL; // [SerializeField] Text Tittle; // [SerializeField] GameObject OptionsList; // [SerializeField] GameObject Editor; // [SerializeField] GameObject SideSelector; // [SerializeField] GameObject Left; // [SerializeField] GameObject Right; // [SerializeField] GameObject Back; // [SerializeField] GameObject Back_Right; // [SerializeField] GameObject Back_Left; // public void SelectionClick(){ // string ClickName=Get.TogOn(OptionsList).name; // print("Click is======"+ClickName); // DOIT.AllChildOff(Editor); // SideSelector.SetActive(false); // if(ClickName=="FILLER"){ // SideSelector.SetActive(true); // if(_G.SC[1]=="B1")AddOptionsOnList(new (){Left,Right,Back}); // if(_G.SC[1]=="B2")AddOptionsOnList(new (){Left,Right,Back_Right,Back_Left}); // } // } // public void AddOptionsOnList(List ListOptions){ // DOIT.AllChildOff(SideSelector); // foreach(GameObject o in ListOptions){ // o.SetActive(true); // } // } // List Optionslist = new(); // if (_G.OBJs[NumberObject][2] == "Cabinet") // { // if (_P.ListSwith["ALLOW_EDIT_DOOR"]) Optionslist.Add("DOOR"); // if (_P.ListSwith["ALLOW_EDIT_SIDE"]) Optionslist.Add("SIDEPANEL");//AllowSidePanelEdit // if (_P.ListSwith["ALLOW_EDIT_RECOVER"]) Optionslist.Add("RECOVERPANEL");//AllowReecoverPanelEdit // Optionslist.Add("BACKSPLASH");//AllowBAckSplashEdit // } // GameObject OptionCanvas = Get.o2("EDITCABpnl", "OPTIONS"); // DOIT.AllChildOff(OptionCanvas); // foreach (string option in Optionslist) // { // OptionCanvas.transform.Find(option).gameObject.SetActive(true); // } // bool IsSwitchActive=false; // GameObject SwitchLight = Get.o2("EDITCABpnl/OBJSELECT", "SWITCH"); // if(_G.OBJs[NumberObject][2] == "Cabinet" || _G.OBJs[NumberObject][4] == "hood"){IsSwitchActive=true;} // SwitchLight.SetActive(IsSwitchActive); // public void Click() // used by BoxMatch, // { // print("----------------Editselect click----------" + name); // DOIT.AllChildOff(Get.o2("EDITCABpnl", "EDITOR")); // GameObject.Find("EDITOR").transform.Find(name).gameObject.SetActive(true); // //if (name.Substring(0, 2) == "FR"){SetG(DataTypes.Filler);} // //if (name.Substring(0, 2) == "FL"){SetG(DataTypes.Filler);} // if (name == "KICK") { SetSGN(); SetG(DataTypes.Kick); EditKick.SetKick(); } // if (name == "OGEE") { SetSGN(); SetG(DataTypes.Ogee); EditOgee.set(); } // if (name == "HEAD") { SetSGN(); SetG(DataTypes.Fascia); EditFacia.set(); } // } // public void setFiller() // used by FL, // { // //print("----------------Editselect click----------"+this.name); // DOIT.AllChildOff(Get.o2("EDITCABpnl", "EDITOR")); // Get.o2("EDITCABpnl/EDITOR","FILLER").SetActive(true); // //Get.o2("EDITCABpnl/EDITOR/FILLER/Selection","G").GetComponent().isOn=true; // //Set drop selection // int indCat=UIT.Ind(Library.Molding,Header.Category);//ID====ID // List FillerSelection= new(); // foreach(string sel in _G.UIT_LibraryMoldings){ // if(!string.IsNullOrEmpty(sel) && sel.Split(',')[0].IndexOf("ID")==-1 && sel.Split(',')[indCat]=="Filler"){ // string ID=sel.Split(',')[0]; // print( "ID===="+ ID); // string[] C = _G.OBJs[_G.nO]; // string Category =sel.Split(',')[indCat]; // float Cabinet_Height=DOIT.ConvertStringToNumber(C[7])-DOIT.ConvertStringToNumber(C[35]); // float Filler_Height=DOIT.ConvertStringToNumber(UIT.Value(Library.Molding,ID,Header.Height)); // string uniqueName=UIT.Value(Library.Molding,ID,Header.Unique_Name); // if(Filler_Height>=Cabinet_Height){FillerSelection.Add(uniqueName);} // } // } // GameObject DropSel=Get.o2("EDITCABpnl/EDITOR/FILLER","Drop"); // DropSel.GetComponent().ClearOptions(); // DropSel.GetComponent().AddOptions(FillerSelection); // Get.o3("EDITOR", "FILLER", "TITTLE").transform.GetComponent().text = name; // SetGlobalCabTexture(); // } // public void setRECOVERPANEL() // used by B1W1T1, B1W1T1, B1W1T1, B1W1T1,B1W1T1, // { // Get.o2("EDITCABpnl/EDITOR/OPTIONS/", "RECOVERPANEL").SetActive(true); // // DOIT.AllChildOff(Get.o2("EDITCABpnl", "EDITOR")); // // DOIT.AllChildOff(Get.o2("EDITOR", "RECOVERPANEL")); // // Get.o2("EDITOR", "RECOVERPANEL").SetActive(true); // // Get.o3("EDITOR", "RECOVERPANEL", name).SetActive(true); // // SetSGN(); // // SetGlobalCabTexture(); // // if(gameObject.transform.parent.name.IndexOf("B")!=-1 || gameObject.transform.parent.name=="T1")Get.o2("EDITOR","OptionsPnlRecover").SetActive(true); // } // public void setSIDEPANEL() // used by B1W1T1, B1W1T1, B1W1T1,B1W1T1 // { // DOIT.AllChildOff(Get.o2("EDITCABpnl", "EDITOR")); // DOIT.AllChildOff(Get.o2("EDITOR", "SIDEPANEL")); // Get.o2("EDITOR", "SIDEPANEL").SetActive(true); // Get.o3("EDITOR", "SIDEPANEL", this.name).SetActive(true); // SetSGN(); // SetGlobalCabTexture(); // if(gameObject.transform.parent.name.IndexOf("B")!=-1|| gameObject.transform.parent.name=="T1")Get.o2("EDITOR","OptionsPnlSide").SetActive(true); // } // public void setBACKSLASH() // used by BSB1, // { // print("this.name====" + this.name); // _G.EDITCAT = "G_SP"; // DOIT.AllChildOff(Get.o2("EDITCABpnl", "EDITOR")); // DOIT.AllChildOff(Get.o2("EDITOR", "BACKSLASH")); // Get.o2("EDITOR", "BACKSLASH").SetActive(true); // Get.o3("EDITOR", "BACKSLASH", this.name).SetActive(true); // Get.o2("EDITOR", "SGNBS").SetActive(true); // Material MAT; // for (int i = 0; i < _P.Listfloat[ "GLOBAL_QTY"]; i++) // { // MAT = CREATE.GetMatfromRawCode(UIT.Global(Header.Splash,i), "PNL");//GlobalSelectionManager.GetValue(GlobalOption.SPLA_9, i), "PNL"); // GameObject.Find($"G{i}").transform.Find("Background").GetComponent().material = MAT; // } // string global = _G.OBJs[Get.GetObjectIndex(SceneModeManager.SelectedName)][60]; // if (global.StartsWith("GLOBAL")) // { // GameObject.Find(global.Replace("GLOBAL", "G")).transform.GetComponent().isOn = true; // } // else // { // GameObject.Find("SETCOL").transform.GetComponent().isOn = true; // } // GameObject.Find("G").transform.GetComponent().isOn = true; // } // public void setCOUNTER() // used by CounterB1, // { // _G.EDITCAT = "G_CT"; // DOIT.AllChildOff(Get.o2("EDITCABpnl", "EDITOR")); // DOIT.AllChildOff(Get.o2("EDITOR", "COUNTER")); // Get.o2("EDITOR", "COUNTER").SetActive(true); // Get.o3("EDITOR", "COUNTER", this.name).SetActive(true); // string[] code = UIT.Global(Header.Splash,_G.G).Split(',');//GlobalSelectionManager.GetValue(GlobalOption.COUN_8).Split(','); // if (name == "COUNTERB1") // { // string[] CSi = _G.OBJs[_G.nO][42].Split('_'); // GameObject.Find("mH").GetComponent().text = CSi[0] + _G.Sys; // GameObject.Find("mL").GetComponent().text = CSi[1] + _G.Sys; // GameObject.Find("mB").GetComponent().text = CSi[2] + _G.Sys; // GameObject.Find("mR").GetComponent().text = CSi[3] + _G.Sys; // GameObject.Find("mF").GetComponent().text = CSi[4] + _G.Sys; // GameObject.Find("mBL").GetComponent().text = CSi[5] + _G.Sys; // GameObject.Find("mBR").GetComponent().text = CSi[6] + _G.Sys; // SetSGNCounter(); // } // if (name == "COUNTERB2" || name == "COUNTERB3" || name == "COUNTERB4" || name == "COUNTERB5" || name == "COUNTERB9" || name == "COUNTERB10" || name == "COUNTERB19" || name == "COUNTERB20") // { // string[] CSi = _G.OBJs[_G.nO][42].Split('_'); // GameObject.Find("mH").GetComponent().text = CSi[0] + _G.Sys; // GameObject.Find("mL").GetComponent().text = CSi[1] + _G.Sys; // GameObject.Find("mBL").GetComponent().text = CSi[2] + _G.Sys; // GameObject.Find("mBR").GetComponent().text = CSi[3] + _G.Sys; // GameObject.Find("mR").GetComponent().text = CSi[5] + _G.Sys; // GameObject.Find("mF").GetComponent().text = CSi[4] + _G.Sys; // SetSGNCounter(); // } // //print("This.name=C=="+this.name); // //SetSGN();name=C=="+this.name); // //SetSGN(); // } // void SetSGN()//Selection,Global,None // { // Get.o2("EDITOR", "SGNSIDEPNL").SetActive(true); // } // void SetG(DataTypes cat) // { // string[] G1 = UIT.Global(Header.Ext,1).Split('?');//GlobalSelectionManager.GetValue(GlobalOption.EXTPNL_2, 0).Split('?'); // string[] G2 = UIT.Global(Header.Ext,2).Split('?');//GlobalSelectionManager.GetValue(GlobalOption.EXTPNL_2, 1).Split('?'); // string[] G3 = UIT.Global(Header.Ext,3).Split('?');//GlobalSelectionManager.GetValue(GlobalOption.EXTPNL_2, 2).Split('?'); // string MatchG1=Get.CabTextureMatch(G1[0],cat); // string MatchG2=Get.CabTextureMatch(G2[0],cat); // string MatchG3=Get.CabTextureMatch(G3[0],cat); // string rl0 = G1[1]; // string rl1 = G2[1]; // string rl2 = G3[1]; // Set.alpha(Get.o1("G0"),false); // Set.alpha(Get.o1("G1"),false); // Set.alpha(Get.o1("G2"),false); // if(MatchG1!=""){ // //Get.o2("G0", "Background").GetComponent().material = CREATE.Texture_CAB(MatchG1, 12, 12, rl0, cat,"PNL"); // Set.alpha(Get.o1("G0"),true); // } // if( MatchG2!=""){ // //Get.o2("G1", "Background").GetComponent().material = CREATE.Texture_CAB(MatchG2, 12, 12, rl1, cat,"PNL"); // Set.alpha(Get.o1("G1"),true); // } // if(MatchG3!=""){ // //et.o2("G2", "Background").GetComponent().material = CREATE.Texture_CAB(MatchG3, 12, 12, rl2, cat,"PNL"); // Set.alpha(Get.o1("G2"),true); // } } // void SetGlobalCabTexture() // { // //All Global false // DOIT.AllChildOff(Get.o2("Selection", "Global")); // for(int i=1; i<_P.Listfloat["GLOBAL_QTY"]+1; i++){ // string[] G=UIT.Global(Header.Ext,i).Split('?'); // Get.o2("Selection/Global", "G"+_G.G.ToString()).SetActive(true); // Get.o2("Selection/Global", "G"+_G.G.ToString()).GetComponent().isOn=true; // Get.o2("G"+i.ToString(), "Background").GetComponent().material = UIT_MATERIAL.GetCabTexture(G[0],"PNL"); // } // } // void SetSGNCounter()//Selection,Global,None // { // GameObject SGN = Get.o2("EDITOR", "SGNCOUNTERTOP"); // SGN.SetActive(true); // Get.o2("SGNCOUNTERTOP", "U").SetActive(false); // string model0 = UIT.Global(Header.Counter,1); // string model1 = UIT.Global(Header.Counter,2); // string model2 = UIT.Global(Header.Counter,3); // int GLOBAL_QTY =int.Parse(_P.List["GLOBAL_QTY"]); // GameObject G2=Get.o2("SGNCOUNTERTOP", "G2"); // GameObject G3=Get.o2("SGNCOUNTERTOP", "G3"); // G2.SetActive(false); // G3.SetActive(false); // Get.o2("G1", "Background").GetComponent().material = UIT_MATERIAL.GetCounterTexture(model0,"PNL"); // if(GLOBAL_QTY>=2){ // G2.SetActive(true); // Get.o2("G2", "Background").GetComponent().material = UIT_MATERIAL.GetCounterTexture(model1,"PNL"); // } // if(GLOBAL_QTY>=3){ // G3.SetActive(true); // Get.o2("G3", "Background").GetComponent().material = UIT_MATERIAL.GetCounterTexture(model2,"PNL"); // } // //Unique color // //Get selected global // int nO = Get.GetObjectIndex(SceneModeManager.SelectedName); // string GL = _G.OBJs[nO][60]; // switch (GL) // { // case "UNIQUE": GameObject.Find("SETCOL").transform.GetComponent().isOn = true; break; // case "GLOBAL1": GameObject.Find("G1").transform.GetComponent().isOn = true; break; // case "GLOBAL2": GameObject.Find("G2").transform.GetComponent().isOn = true; break; // case "GLOBAL3": GameObject.Find("G3").transform.GetComponent().isOn = true; break; // default: Debug.LogError("Invalid global/unique setting for counter used."); break; // } // } // //void SetSGNBS(string Tex, string col, string sel)//Selection,Global,None // //{ // // GameObject SGNBS = GameObject.Find("EDITOR").transform.Find(sel).gameObject; // // SGNBS.SetActive(true); // // //foreach (Transform child in SGN.transform) { child.transform.Find("Image").gameObject.SetActive(false); } // // Sprite TexG = Resources.Load("ICONS/FINISH/" + Tex) as Sprite; // // GameObject.Find("G").transform.Find("Background").GetComponent().sprite = TexG; // // GameObject.Find("G").transform.Find("Background").GetComponent().color = DOIT.CSc(col, 255); // // GameObject.Find("G").transform.GetComponent().isOn = true; // //} // public void NONEClick() // used by NONE, // { // if (GameObject.Find("mH")) GameObject.Find("mH").GetComponent().text = 0 + _G.Sys; // if (GameObject.Find("mB")) GameObject.Find("mB").GetComponent().text = 0 + _G.Sys; // if (GameObject.Find("mL")) GameObject.Find("mL").GetComponent().text = 0 + _G.Sys; // if (GameObject.Find("mR")) GameObject.Find("mR").GetComponent().text = 0 + _G.Sys; // if (GameObject.Find("mHL")) GameObject.Find("mHL").GetComponent().text = 0 + _G.Sys; // if (GameObject.Find("mHR")) GameObject.Find("mHR").GetComponent().text = 0 + _G.Sys; // if (GameObject.Find("mBL")) GameObject.Find("mBL").GetComponent().text = 0 + _G.Sys; // if (GameObject.Find("mBR")) GameObject.Find("mBR").GetComponent().text = 0 + _G.Sys; // } // //public void GLOBALClick() //{ // _G.SC[0] = "G_BS"; // if (_G.EDITCAT.Substring(0, 2) == "BS") { _G.SC[0] = "G_BSC"; } // if (_G.EDITCAT.Substring(0, 2) == "BL") { _G.SC[0] = "G_BLC"; } // if (_G.EDITCAT.Substring(0, 2) == "CO") { _G.SC[0] = "G_CTC"; } // if (_G.EDITCAT.Substring(0, 2) == "SI") { _G.SC[0] = "G_SPC"; } //} }