private void FilterSlots(int indexStruc) { //Get the cloth slots from the selected body structure int idStruc = bodyStrucList [indexStruc].ID; bodyStrucSlots = bodyStrucTable.GetClothSlotList(idStruc); selectedSlots = new bool[bodyStrucSlots.Count]; //Get the body subtypes from the selected structure modelsList.Clear(); List <BodySubtypeTable.BodySubtype> tList = bodySubType.GetList(); BodyStructureTable.BodyStructure tRecord = bodyStrucTable.GetRecord(idStruc); for (int i = 0; i < tRecord.IDBodySubtype.Count; i++) { ModelPrefab toAdd = new ModelPrefab(); toAdd.IDSubtype = tRecord.IDBodySubtype [i]; toAdd.SubtypeName = tList.Find(x => x.ID == tRecord.IDBodySubtype [i]).Name; modelsList.Add(toAdd); } }
private void FilterSlots(int indexStruc) { //Get the cloth slots from the selected body structure int idStruc = bodyStrucList [indexStruc].ID; bodyStrucSlots = bodyStrucTable.GetPropSlotList(idStruc); System.Array.Resize(ref propSlotsOptions, bodyStrucSlots.Count); for (int i = 0; i < bodyStrucSlots.Count; i++) { propSlotsOptions [i] = bodyStrucSlots [i].SlotName; } modelsList.Clear(); List <BodySubtypeTable.BodySubtype> tList = bodySubType.GetList(); BodyStructureTable.BodyStructure tRecord = bodyStrucTable.GetRecord(idStruc); for (int i = 0; i < tRecord.IDBodySubtype.Count; i++) { ModelPrefab toAdd = new ModelPrefab(); toAdd.IDSubtype = tRecord.IDBodySubtype [i]; toAdd.SubtypeName = tList.Find(x => x.ID == tRecord.IDBodySubtype [i]).Name; modelsList.Add(toAdd); } }
void SelectRecord(int ID) { //Select structure record recordSelected = ID; bStrucRec = bodyStrucTable.GetRecord(ID); //Body type bodyTypeSelected = bodyTypes.FindIndex(x => x.ID == bStrucRec.IDBodyType); //Body subtypes for (int i = 0; i < bolSubTypes.Length; i++) { bolSubTypes [i] = false; } int index = 0; for (int i = 0; i < bStrucRec.IDBodySubtype.Count; i++) { index = bodySubtypes.FindIndex(x => x.ID == bStrucRec.IDBodySubtype [i]); if (index > -1) { bolSubTypes [index] = true; } } //Load slots clothSlots = bodyStrucTable.GetClothSlotList(recordSelected); propSlots = bodyStrucTable.GetPropSlotList(recordSelected); skinSlots = bodyStrucTable.GetSkinSlotList(recordSelected); flagEdit = 2; }
private void GetModelsList() { modelsList.Clear(); bodyModelList = bodyModelTable.GetList(true); BodyStructureTable.BodyStructure searchStruct = new BodyStructureTable.BodyStructure(); BodySubtypeTable.BodySubtype searchSubtype = new BodySubtypeTable.BodySubtype(); for (int i = 0; i < bodyModelList.Count; i++) { ListModels toAdd = new ListModels(); toAdd.IDModel = bodyModelList [i].ID; toAdd.Name = bodyModelList [i].Name; searchStruct = bodyStrucList.Find(x => x.ID == bodyModelList [i].IDBodyStructure); if (searchStruct != null) { toAdd.Structure = searchStruct.Name; } searchSubtype = bodySubtList.Find(x => x.ID == bodyModelList [i].IDBodySubtype); if (searchSubtype != null) { toAdd.BodySubtype = searchSubtype.Name; } GameObject prefabToLoad = (GameObject)Resources.Load(_config.GetPathName(CSConfig.PathTypeEnum.BodyModelsPath) + "/" + bodyModelList[i].ModelName); if (prefabToLoad == null) { toAdd.PrefabError = true; } modelsList.Add(toAdd); } }
void NewRecord() { bStrucRec = new BodyStructureTable.BodyStructure(); propSlots = new List <BodyStructureTable.BodyPropsSlots> (); skinSlots = new List <BodyStructureTable.BodySkinsSlots> (); clothSlots = new List <BodyStructureTable.BodyClothSlots> (); for (int i = 0; i < bolSubTypes.Length; i++) { bolSubTypes [i] = false; } recordSelected = 0; bodyTypeSelected = 0; flagEdit = 1; }