void LoadCard(string path) { switch (currentType) { case 0: { confirmpanel.gameObject.SetActive(false); optionspanel.gameObject.SetActive(false); StartCoroutine(Studio.Studio.Instance.LoadSceneCoroutine(path)); if (cardTypes[currentType].autoClose) { UISystem.gameObject.SetActive(false); } break; } case 1: { confirmpanel.gameObject.SetActive(false); optionspanel.gameObject.SetActive(false); var ocicharFemale = AddObjectFemale.Add(path); if (Studio.Studio.optionSystem.autoSelect && ocicharFemale != null) { Studio.Studio.Instance.treeNodeCtrl.SelectSingle(ocicharFemale.treeNodeObject); } if (cardTypes[currentType].autoClose) { UISystem.gameObject.SetActive(false); } break; } case 2: { var list = (from v in GuideObjectManager.Instance.selectObjectKey select Studio.Studio.GetCtrlInfo(v) as OCIChar into v where v != null //where v.oiCharInfo.sex == 1 select v).ToList(); if (list.Count > 0) { confirmpanel.gameObject.SetActive(false); optionspanel.gameObject.SetActive(false); list.ForEach(x => x.LoadClothesFile(path)); if (cardTypes[currentType].autoClose) { UISystem.gameObject.SetActive(false); } } break; } } }
private void FixSkirtFk() { var ocic = ChaControl.GetOCIChar(); //ocic.female.UpdateBustSoftnessAndGravity(); var active = ocic.oiCharInfo.activeFK[6]; ocic.ActiveFK(OIBoneInfo.BoneGroup.Skirt, false, ocic.oiCharInfo.enableFK); ocic.fkCtrl.ResetUsedBone(ocic); ocic.skirtDynamic = AddObjectFemale.GetSkirtDynamic(ocic.charInfo.objClothes); ocic.ActiveFK(OIBoneInfo.BoneGroup.Skirt, active, ocic.oiCharInfo.enableFK); }
private void FixSkirtFk() { var ocic = ChaControl.GetOCIChar(); //ocic.female.UpdateBustSoftnessAndGravity(); var active = ocic.oiCharInfo.activeFK[6]; ocic.ActiveFK(OIBoneInfo.BoneGroup.Skirt, false, ocic.oiCharInfo.enableFK); Traverse.Create(ocic.fkCtrl).Method("ResetUsedBone", new[] { typeof(OCIChar) }).GetValue(ocic); ocic.skirtDynamic = AddObjectFemale.GetSkirtDynamic(ocic.charInfo.objClothes); ocic.ActiveFK(OIBoneInfo.BoneGroup.Skirt, active, ocic.oiCharInfo.enableFK); }
private static void UpdateBustAndSkirt(OCICharMale __instance) { if (__instance.charInfo.fileParam.sex == 0) { return; } __instance.charInfo.UpdateBustSoftnessAndGravity(); __instance.skirtDynamic = AddObjectFemale.GetSkirtDynamic(__instance.charInfo.objClothes); __instance.ActiveFK(OIBoneInfo.BoneGroup.Skirt, __instance.oiCharInfo.activeFK[6], __instance.oiCharInfo.enableFK); }
private static bool Studio_AddFemale(string _path) { if (IsStudio) { return(true); } AddObjectFemale.Add(_path); Singleton <UndoRedoManager> .Instance.Clear(); return(false); }
//按鈕邏輯 internal static void OnButtonClick(CharaList __instance, int sex) { CharaFileSort charaFileSort = __instance.GetField("charaFileSort") as CharaFileSort; ChaFileControl chaFileControl = new ChaFileControl(); string fullPath = chaFileControl.ConvertCharaFilePath(charaFileSort.selectPath, (byte)sex, false); chaFileControl = null; OCIChar[] array = (from v in Singleton <GuideObjectManager> .Instance.selectObjectKey select Studio.Studio.GetCtrlInfo(v) as OCIChar into v where v != null select v).ToArray(); foreach (OCIChar ocichar in array) { ChaControl chaCtrl = ocichar.charInfo; foreach (OCIChar.BoneInfo boneInfo in (from v in ocichar.listBones where v.boneGroup == OIBoneInfo.BoneGroup.Hair select v).ToList <OCIChar.BoneInfo>()) { Singleton <GuideObjectManager> .Instance.Delete(boneInfo.guideObject, true); } ocichar.listBones = (from v in ocichar.listBones where v.boneGroup != OIBoneInfo.BoneGroup.Hair select v).ToList <OCIChar.BoneInfo>(); int[] array2 = (from b in ocichar.oiCharInfo.bones where b.Value.@group == OIBoneInfo.BoneGroup.Hair select b.Key).ToArray <int>(); for (int j = 0; j < array2.Length; j++) { ocichar.oiCharInfo.bones.Remove(array2[j]); } ocichar.hairDynamic = null; ocichar.skirtDynamic = null; string oldName = ocichar.charInfo.chaFile.parameter.fullname; //用這種方式初始化不會觸發其他鉤子 ChaControl tmpCtrl = new ChaControl(); tmpCtrl.SetProperty("chaFile", new ChaFileControl()); if (null != MoreAccessories) { CopyAllMoreAccessoriesData(ocichar.charInfo, tmpCtrl); } //Main Load Control if (chaCtrl.chaFile.LoadFileLimited(fullPath, (byte)sex, true, true, true, true, false) || !LoadExtendedData(ocichar, charaFileSort.selectPath, (byte)sex) || !UpdateTreeNodeObjectName(ocichar)) { Logger.LogError("Load Body FAILED"); } else { if (null != MoreAccessories) { CopyAllMoreAccessoriesData(tmpCtrl, ocichar.charInfo); } } GameObject.Destroy(tmpCtrl); ocichar.charInfo.AssignCoordinate((ChaFileDefine.CoordinateType)ocichar.charInfo.fileStatus.coordinateType); chaCtrl.Reload(false, false, false, false); AddObjectAssist.InitHairBone(ocichar, Singleton <Info> .Instance.dicBoneInfo); ocichar.hairDynamic = AddObjectFemale.GetHairDynamic(ocichar.charInfo.objHair); ocichar.skirtDynamic = AddObjectFemale.GetSkirtDynamic(ocichar.charInfo.objClothes); ocichar.InitFK(null); foreach (var tmp in FKCtrl.parts.Select((OIBoneInfo.BoneGroup p, int i2) => new { p, i2 })) { ocichar.ActiveFK(tmp.p, ocichar.oiCharInfo.activeFK[tmp.i2], ocichar.oiCharInfo.activeFK[tmp.i2]); } ocichar.ActiveKinematicMode(OICharInfo.KinematicMode.FK, ocichar.oiCharInfo.enableFK, true); ocichar.UpdateFKColor(new OIBoneInfo.BoneGroup[] { OIBoneInfo.BoneGroup.Hair }); ocichar.ChangeEyesOpen(ocichar.charFileStatus.eyesOpenMax); ocichar.ChangeBlink(ocichar.charFileStatus.eyesBlink); ocichar.ChangeMouthOpen(ocichar.oiCharInfo.mouthOpen); Logger.LogInfo($"Load Body: {oldName} -> {ocichar.charInfo.chaFile.parameter.fullname}"); } }