using UnityEngine; using System.Globalization; public class RecoverPanel : MonoBehaviour { public void Add() { string On=Get.ToggleOnInChild("EDITCABpnl/EDITOR/SGNSIDEPNL"); string[] C= _G.OBJs[_G.nO]; if(C[81].Length==7)C[81]+=",0,0"; string[] C81 =C[81].Split(','); string RC="Over"; GameObject RecoverCat=Get.o2("EDITCABpnl/EDITOR","OptionsPnlRecover"); if(RecoverCat.activeInHierarchy) { RC=Get.ToggleOnInChild("EDITCABpnl/EDITOR/OptionsPnlRecover"); }//Recover category Over ,Notch ,Floor if(On.StartsWith("G")) { if (Check.togOn(On)) { C[80] = UIT.Global( Header.Ext,int.Parse(On[1..]+1) );//GlobalSelectionManager.GetValue(GlobalOption.EXTPNL_2, int.Parse(On[1..])); } if(Check.togOn("PR1")) {C81[0] = RC; } if(Check.togOn("PR2")) {C81[1] = RC; } if(Check.togOn("PR3")) {C81[2] = RC; } if(GameObject.Find("PR4")!= null) { if (Check.togOn("PR4")) C81[3] = RC; } if(GameObject.Find("PR5")!= null) { if (Check.togOn("PR5")) C81[4] = RC; } if(GameObject.Find("PUN")!= null) { if (Check.togOn("PUN")) C81[4] = RC; } } if(On=="NONE") { if(Check.togOn("PR1")){C81[0] = "0";} if(Check.togOn("PR2")){C81[1] = "0";} if(Check.togOn("PR3")){C81[2] = "0";} if(GameObject.Find("PR4")!= null) { if (Check.togOn("PR4")) C81[3] = "0"; } if(GameObject.Find("PR5")!= null) { if (Check.togOn("PR5")) C81[4] = "0"; } if(GameObject.Find("PUN")!= null) { if (Check.togOn("PUN")) C81[5] = "0"; } } //COUNTER if(Check.togOn("PR1"))add42(1); if(Check.togOn("PR2"))add42(2); if(Check.togOn("PR3"))add42(3); if(C[4]!="B1" && C[4]!="W1"&& C[4]!="T1" && C[4]!="wine" && C[4]!="dish"){if (Check.togOn("PR4"))add42(5);} if(Check.togOn("PR1") && On=="NONE")sub42(1); if(Check.togOn("PR2") && On=="NONE")sub42(2); if(Check.togOn("PR3") && On=="NONE")sub42(3); if(C[4]!="B1" && C[4]!="W1"&& C[4]!="T1"&& C[4]!="wine" && C[4]!="dish"){if (Check.togOn("PR4") && On=="NONE")sub42(5);} if(On=="SETCOL"){ if(Check.togOn("PR1")) {C81[0] = RC; } if(Check.togOn("PR2")) {C81[1] = RC; } if(Check.togOn("PR3")) {C81[2] = RC; } if(GameObject.Find("PR4")!= null) { if (Check.togOn("PR4")) C81[3] = "1"; } if(GameObject.Find("PR5")!= null) { if (Check.togOn("PR5")) C81[4] = "1"; } C[81] = C81[0] + "," + C81[1] + "," + C81[2] + "," + C81[3]+ "," + C81[4]+ "," + C81[5]; Get.o3("Panel_SCENE","PNL","UNIVERSALpnl").SetActive(true); //UNIVERSALPNL.StartPNL("BtnFinishTextureRecover"); Get.o3("Panel_SCENE","PNL","EDITCABpnl").SetActive(false); } if(On!="SETCOL"){ C[81] = C81[0] + "," + C81[1] + "," + C81[2] + "," + C81[3]+ "," + C81[4]+ "," + C81[5]; DOIT.REDOCAB(_G.nO); DOIT.CloseALLPNL(); } SceneModeManager.Instance.SetSceneMode(SceneModes.Navigate); //SAVING.scene(); } public static void AddOnCab(string[] C){ print("C1===="+C[1]); print("C4===="+C[4]); print("C81===="+C[81]); } public string add42(int p){ string[] C= _G.OBJs[_G.nO]; string[] C42=C[42].Split(","[0]); string v="0"; float P=DOIT.ConvertStringToNumber( C42[(int)p] ); if(P==0)P+=1; C42[p]=P.ToString(CultureInfo.InvariantCulture); C[42] = C42[0] + "," + C42[1] + "," + C42[2] + "," + C42[3]+ "," + C42[4] + "," + C42[5]+ "," + C42[6]; return v; } public string sub42(int p){ string[] C= _G.OBJs[_G.nO]; string[] C42=C[42].Split(","[0]); string v="0"; float P=DOIT.ConvertStringToNumber( C42[(int)p] ); if(P>=1 && P<2)P-=1; C42[p]=P.ToString(CultureInfo.InvariantCulture); C[42] = C42[0] + "," + C42[1] + "," + C42[2] + "," + C42[3]+ "," + C42[4] + "," + C42[5]+ "," + C42[6]; return v; } public void getSides() { _G.SC[5] = "0"; _G.SC[6] = "0"; _G.SC[7] = "0"; _G.SC[8] = "0"; if (Check.togOn("PR1")) _G.SC[5] = "1"; if (Check.togOn("PR2")) _G.SC[6] = "1"; if (Check.togOn("PR3")) _G.SC[7] = "1"; if (GameObject.Find("PR4")!= null) { if (Check.togOn("PR4")) _G.SC[8] = "1"; } } }