//using Microsoft.SqlServer.Server; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class EditKick : MonoBehaviour { // public void add() // { // string model=Get.o2("EDITCABpnl","TITTLE").GetComponent().text; // string _kicks=Get.ToggleOnInChild("EDITCABpnl/EDITOR/OptionsUnder"); // int nO=Get.GetObjectIndex(SceneModeManager.SelectedName); // string[] C= _G.OBJs[nO]; // string[] C34 =C[34].Split('_'); // if(_kicks!="SUSPENDED" && _kicks!="LEG"){ // string On=Get.ToggleOnInChild("EDITCABpnl/EDITOR/SGNSIDEPNL"); // string Under=Get.ToggleOnInChild("EDITOR/OptionsUnder"); // //Retraction // string path="EDITCABpnl/EDITOR/KICK/MODELS/"+model+"/"; // string RL="0"; // string RR="0"; // GameObject mRL=Get.o1(path+"RL/Btn Mesure/mRL"); // GameObject mRR=Get.o1(path+"RR/Btn Mesure/mRR"); // if(mRL!=null)RL=Get.o1(path+"RL/Btn Mesure/mRL").GetComponent().text; // if(mRR!=null)RR=Get.o1(path+"RR/Btn Mesure/mRR").GetComponent().text; // string[] C39=C[39].Split(','); // int indRL=0; // int indRR=3; // if(model=="B1" || model=="T1" ){indRR=2;} // if(model=="B6" || model=="B7" || model=="B26" || model=="B27" || model=="B11" || model=="B12" ){indRL=1;indRR=2; } // C39[indRL] = DOIT.CSs(RL); C39[indRR] = DOIT.CSs(RR); // C[39] = C39[0] + "_" + C39[1] + "_" + C39[2] + "_" + C39[3]+ "_" + C39[4]+ "_" + C39[5]; // if(Under.IndexOf("LEG")!=-1)C[73]="LEG"; // else C[73]="NONE"; // if(On=="G0" || On=="G1" || On=="G2"){ // if(On=="G0") { C[63] = UIT.Global(Header.Kick,1);}//GlobalSelectionManager.GetValue(GlobalOption.KICK_3, 0); } // if(On=="G1") { C[63] = UIT.Global(Header.Kick,2);}//GlobalSelectionManager.GetValue(GlobalOption.KICK_3, 1); } // if(On=="G2") { C[63] = UIT.Global(Header.Kick,3);}//GlobalSelectionManager.GetValue(GlobalOption.KICK_3, 2); } // if(Check.togOn("KK1")) {C34[1] = "1"; } // if(Check.togOn("KK2")) {C34[2] = "1"; } // if(Check.togOn("KK3")) {C34[3] = "1"; } // if(Check.togOn("KK4")) {C34[4] = "1"; } // if(GameObject.Find("KK5")!= null) { if(Check.togOn("KK5")) C34[5] = "1"; } // if(GameObject.Find("KK56")!= null) { if(Check.togOn("KK56")) C34[5] = "1"; C34[6] = "1";} // } // if(On=="NONE" ) // { // if(Check.togOn("KK1")) {C34[1] = "0"; } // if(Check.togOn("KK2")) {C34[2] = "0"; } // if(Check.togOn("KK3")) {C34[3] = "0"; } // if(Check.togOn("KK4")) {C34[4] = "0"; } // if(GameObject.Find("KK5")!= null) { if(Check.togOn("KK5")) C34[5] = "0"; } // if(GameObject.Find("KK56")!= null) { if(Check.togOn("KK56")) C34[5] = "0"; C34[6] = "0";} // } // if(On=="INTERIOR") // { // if(Check.togOn("KK1")) {C34[1] = "2"; } // if(Check.togOn("KK2")) {C34[2] = "2"; } // if(Check.togOn("KK3")) {C34[3] = "2"; } // if(Check.togOn("KK4")) {C34[4] = "2"; } // if(GameObject.Find("KK5")!= null) { if(Check.togOn("KK5")) C34[3] = "2"; } // if(GameObject.Find("KK56")!= null) { if(Check.togOn("KK56")) C34[5] = "2"; C34[6] = "2";} // } // if(On!="SETCOL"){ // C[34] = C34[0] + "_" + C34[1] + "_" + C34[2] + "_" + C34[3]+ "_" + C34[4]+ "_" + C34[5]+ "_" + C34[6]; // DOIT.REDOCAB(_G.nO); // DOIT.CloseALLPNL(); // } // if(On=="SETCOL"){ // if(Check.togOn("KK1")) {C34[1] = "1"; } // if(Check.togOn("KK2")) {C34[2] = "1"; } // if(Check.togOn("KK3")) {C34[3] = "1"; } // if(Check.togOn("KK4")) {C34[4] = "1"; } // if(GameObject.Find("KK5")!= null) { if(Check.togOn("KK5")) C34[5] = "1"; } // if(GameObject.Find("KK56")!= null) { if(Check.togOn("KK56")) C34[5] = "1"; C34[6] = "1";} // C[34] = C34[0] + "_" + C34[1] + "_" + C34[2] + "_" + C34[3]+ "_" + C34[4]+ "_" + C34[5]+ "_" + C34[6]; // Get.o3("Panel_SCENE","PNL","UNIVERSALpnl").SetActive(true); // //UNIVERSALPNL.StartPNL("BtnKick"); // Get.o3("Panel_SCENE","PNL","EDITCABpnl").SetActive(false); // } // } // else{ // C34[1] = "0"; // C34[2] = "0"; // C34[3] = "0"; // C34[4] = "0"; // if(GameObject.Find("KK5")!= null) { C34[5] = "0"; } // if(GameObject.Find("KK56")!= null) { C34[5] = "0"; C34[6] = "0";} // C[73]=_kicks; // C[34] = C34[0] + "_" + C34[1] + "_" + C34[2] + "_" + C34[3]+ "_" + C34[4]+ "_" + C34[5]+ "_" + C34[6]; // DOIT.REDOCAB(_G.nO); // DOIT.CloseALLPNL(); // } // } public static void SetKickFromEditPNL(string SideSelect,string GlobalNumberSelectedColor,string Retraction){ string modelname=Get.o2("EDITCABpnl","TITLE").GetComponent().text; string model=UIT.Value(Library.Cabinet,modelname,Header.Model); int ADN=Get.GetObjectIndex(SceneModeManager.SelectedName); string[] C= _G.OBJs[ADN]; string[] C34 =C[34].Split('_'); string[] C39=C[39].Split('_'); string On= GlobalNumberSelectedColor; int indRL=0; int indRBL=1; int indRBR=2; int indRR=3; int indRB=1; if(model=="B1" || model=="T1" ){indRR=2;} if(model=="B6" || model=="B7" || model=="B26" || model=="B27" || model=="B11" || model=="B12" ){indRL=1;indRR=2; } if(SideSelect=="LEFT"){C39[indRL] = DOIT.CSs(Retraction);} else if(SideSelect=="RIGHT"){C39[indRR] = DOIT.CSs(Retraction);} else if(SideSelect=="BACK"){C39[indRB] = DOIT.CSs(Retraction);} else if(SideSelect=="BACK_LEFT"){C39[indRBL] = DOIT.CSs(Retraction);} else if(SideSelect=="BACK_RIGHT"){C39[indRBR] = DOIT.CSs(Retraction);} C[39] = C39[0] + "_" + C39[1] + "_" + C39[2] + "_" + C39[3]+ "_" + C39[4]+ "_" + C39[5]; if(On=="G1" || On=="G2" || On=="G3"){ print("kick function C[34]==="+C[34]); if(On=="G1") { C[63] = UIT.Global(Header.Kick,1);}//GlobalSelectionManager.GetValue(GlobalOption.KICK_3, 0); } if(On=="G2") { C[63] = UIT.Global(Header.Kick,2);}//GlobalSelectionManager.GetValue(GlobalOption.KICK_3, 1); } if(On=="G3") { C[63] = UIT.Global(Header.Kick,3);}//GlobalSelectionManager.GetValue(GlobalOption.KICK_3, 2); } if(SideSelect=="LEFT") {C34[1] = "1"; } if(SideSelect=="BACK") {C34[2] = "1"; } if(SideSelect=="RIGHT") { if(model=="B1" || model=="T1" ){C34[3] = "1"; } if(new List(){"B2","B3","B4","B5","B9","B10"}.Contains(model)){C34[4] = "1"; } } if(SideSelect=="BACK_LEFT") {C34[2] = "1"; } if(SideSelect=="BACK_RIGHT") {C34[3] = "1"; } //if(Check.togOn("KK4")) {C34[4] = "1"; } //if(GameObject.Find("KK5")!= null) { if(Check.togOn("KK5")) C34[5] = "1"; } //if(GameObject.Find("KK56")!= null) { if(Check.togOn("KK56")) C34[5] = "1"; C34[6] = "1";} } if(On=="NONE" ) { if(SideSelect=="LEFT") {C34[1] = "0"; } if(SideSelect=="BACK") {C34[2] = "0"; } if(SideSelect=="RIGHT") {C34[3] = "0"; } // if(Check.togOn("KK4")) {C34[4] = "0"; } // if(GameObject.Find("KK5")!= null) { if(Check.togOn("KK5")) C34[5] = "0"; } // if(GameObject.Find("KK56")!= null) { if(Check.togOn("KK56")) C34[5] = "0"; C34[6] = "0";} } C[34] = C34[0] + "_" + C34[1] + "_" + C34[2] + "_" + C34[3]+ "_" + C34[4]+ "_" + C34[5]+ "_" + C34[6]; DOIT.REDOCAB(_G.nO); DOIT.CloseALLPNL(); } public static void SetKick(){ DOIT.AllChildOff(Get.o3("EDITOR","KICK","MODELS")); //print("SceneModeManager.SelectedName===="+SceneModeManager.SelectedName); int nO=Get.GetObjectIndex(SceneModeManager.SelectedName); GameObject Mod=Get.o3("EDITOR/KICK","MODELS",_G.OBJs[nO][4]); Mod.SetActive(true); if(_G.kicks=="LEGKICK"){ if(_G.OBJs[nO][4]=="B1" || _G.OBJs[nO][4]=="T1" )Mod.transform.Find("KK4").gameObject.GetComponent().isOn=true; if(_G.OBJs[nO][4]=="B2" || _G.OBJs[nO][4]=="B3" )Mod.transform.Find("KK56").gameObject.GetComponent().isOn=true; if(_G.OBJs[nO][4]=="B9" || _G.OBJs[nO][4]=="B10" )Mod.transform.Find("KK56").gameObject.GetComponent().isOn=true; if(_G.OBJs[nO][4]=="B4" || _G.OBJs[nO][4]=="B5" )Mod.transform.Find("KK5").gameObject.GetComponent().isOn=true; } Set.alpha(Get.o1("KICK/MODELS"),true); Set.alpha(Get.o1("EDITOR/SGNSIDEPNL"),true); GameObject Options=Get.o2("EDITOR","OptionsUnder"); Options.SetActive(true); DOIT.AllChildOff( Options); //Set options if(_P.LegOnly) Options.transform.Find("LEG").gameObject.SetActive(true); if(_P.LegKick) Options.transform.Find("LEGKICK").gameObject.SetActive(true); if(_P.KickOnly) Options.transform.Find("KICK").gameObject.SetActive(true); if(_P.Suspended) Options.transform.Find("SUSPENDED").gameObject.SetActive(true); Get.o2("OptionsUnder",_G.kicks).GetComponent().isOn = true; } public void OptionClick(){ print("name===="+name); if(name=="LEG" || name=="SUSPENDED"){ Set.alpha(Get.o1("KICK/MODELS"),false); Set.alpha(Get.o1("EDITOR/SGNSIDEPNL"),false); } else{ Set.alpha(Get.o1("KICK/MODELS"),true); Set.alpha(Get.o1("EDITOR/SGNSIDEPNL"),true); } Get.o2("OBJSELECT","TXTTOADD").SetActive(true); } // public static string GetModelActive(){ // string ModdeName=et.o2("EDITCABpnl","TITTLE").GetComponent // foreach(Transform child in Get.o2("EDITCABpnl","OBJSELECT").transform){ // if(child.gameObject.activeInHierarchy && child.gameObject.name!="TXTTOADD")return child.name; // } // return null; // } }