From fdacde2fec20bfe101c46efe5cf8f848a5935d2a Mon Sep 17 00:00:00 2001 From: poi-vrc <77053052+poi-vrc@users.noreply.github.com> Date: Sun, 20 Aug 2023 13:35:59 +0800 Subject: [PATCH] refactor: add lib abstraction layer --- .../Editor/Animations/AnimationGenerator.cs | 23 +++---- .../Editor/DTEditorUtils.cs | 10 +-- .../Editor/Inspector/DTCabinetEditor.cs | 2 +- .../Integrations/VRChat/ApplyCabinetHook.cs | 1 + .../VRChat/BuildDTCabinetCallback.cs | 3 +- .../VRChat/GenerateAnimationsHook.cs | 9 +-- .../Editor/UI/DTLegacyEditorWindow.cs | 1 + .../Editor/UI/DTMainEditorWindow.cs | 10 +-- .../Editor/UI/MappingEditorWindow.cs | 1 + .../Editor/UI/Presenters/CabinetPresenter.cs | 11 ++-- .../UI/Presenters/MappingEditorPresenter.cs | 1 + ...nimationGenerationModuleEditorPresenter.cs | 2 + .../ArmatureMappingModuleEditorPresenter.cs | 7 ++- .../BlendshapeSyncModuleEditorPresenter.cs | 1 + .../Modules/MoveRootModuleEditorPresenter.cs | 1 + .../UI/Presenters/WearableConfigPresenter.cs | 7 ++- .../WearableSetupWizardPresenter.cs | 4 +- .../Editor/UI/ReportWindow.cs | 1 + .../Editor/UI/Views/CabinetSubView.cs | 2 +- .../Editor/UI/Views/DressingSubView.cs | 2 + .../Editor/UI/Views/MainView.cs | 2 +- .../Editor/UI/Views/MappingEditorView.cs | 1 + .../AnimationGenerationModuleEditor.cs | 2 + .../Modules/ArmatureMappingModuleEditor.cs | 2 + .../Modules/BlendshapeSyncModuleEditor.cs | 2 + .../UI/Views/Modules/MoveRootModuleEditor.cs | 2 + .../UI/Views/Modules/UnknownModuleEditor.cs | 4 +- .../Editor/UI/Views/WearableConfigView.cs | 2 + .../UI/Views/WearableSetupWizardView.cs | 2 + .../Editor/UIBase/Views/ICabinetSubView.cs | 1 + .../Editor/UIBase/Views/IDressingSubView.cs | 1 + .../Editor/UIBase/Views/IMainView.cs | 1 + .../Editor/UIBase/Views/IMappingEditorView.cs | 1 + .../UIBase/Views/IWearableConfigView.cs | 2 + .../UIBase/Views/IWearableConfigViewParent.cs | 1 + .../UIBase/Views/IWearableSetupWizardView.cs | 3 +- .../IAnimationGenerationModuleEditorView.cs | 1 + .../IArmatureMappingModuleEditorView.cs | 1 + .../IBlendshapeSyncModuleEditorView.cs | 1 + .../Modules/IMoveRootModuleEditorView.cs | 1 + ...m.chocopoi.vrc.dressingtools.Editor.asmdef | 4 +- .../com.chocopoi.vrc.dressingtools/Lib.meta | 8 +++ .../Lib/Editor.meta | 8 +++ .../Lib/Editor/UI.meta | 8 +++ .../Views => Lib/Editor/UI}/EditorViewBase.cs | 3 +- .../Editor/UI}/EditorViewBase.cs.meta | 2 +- .../Views => Lib/Editor/UI}/IEditorView.cs | 2 +- .../Editor/UI}/IEditorView.cs.meta | 2 +- .../Editor/UI}/IModuleEditorViewParent.cs | 4 +- .../UI}/IModuleEditorViewParent.cs.meta | 2 +- .../Modules => Lib/Editor/UI}/ModuleEditor.cs | 12 ++-- .../Editor/UI}/ModuleEditor.cs.meta | 2 +- .../Editor/UI}/ModuleEditorAttribute.cs | 2 +- .../Editor/UI}/ModuleEditorAttribute.cs.meta | 2 +- ...ocopoi.vrc.dressingtools.api.Editor.asmdef | 18 ++++++ ...i.vrc.dressingtools.api.Editor.asmdef.meta | 7 +++ .../Lib/README.md | 4 ++ .../Lib/README.md.meta | 7 +++ .../Lib/Runtime.meta | 8 +++ .../Lib/Runtime/Cabinet.meta | 8 +++ .../Runtime/Cabinet/DTCabinetWearable.cs | 2 +- .../Runtime/Cabinet/DTCabinetWearable.cs.meta | 2 +- .../Lib/Runtime/Cabinet/ICabinet.cs | 38 +++++++++++ .../Runtime/Cabinet/ICabinet.cs.meta} | 2 +- .../Lib/Runtime/DTBaseComponent.cs | 31 +++++++++ .../Lib/Runtime/DTBaseComponent.cs.meta | 11 ++++ .../Lib/Runtime/DTLibRuntimeUtils.cs | 51 +++++++++++++++ .../Lib/Runtime/DTLibRuntimeUtils.cs.meta | 11 ++++ .../Lib/Runtime/Dresser.meta | 8 +++ .../Lib/Runtime/Dresser/DTDresserSettings.cs | 58 +++++++++++++++++ .../Runtime/Dresser/DTDresserSettings.cs.meta | 11 ++++ .../Runtime/Dresser/IDTDresser.cs} | 22 +++---- .../Lib/Runtime/Dresser/IDTDresser.cs.meta | 11 ++++ .../Lib/Runtime/Logging.meta | 8 +++ .../{ => Lib}/Runtime/Logging/DTReport.cs | 39 +----------- .../Runtime/Logging/DTReport.cs.meta | 2 +- .../Lib/Runtime/Proxy.meta | 8 +++ .../{ => Lib}/Runtime/Proxy/IDynamicsProxy.cs | 2 +- .../Runtime/Proxy/IDynamicsProxy.cs.meta | 2 +- .../Lib/Runtime/Wearable.meta | 8 +++ .../Wearable/AnimationBlendshapeSync.cs | 2 +- .../Wearable/AnimationBlendshapeSync.cs.meta | 2 +- .../Wearable/AnimationBlendshapeValue.cs | 2 +- .../Wearable/AnimationBlendshapeValue.cs.meta | 2 +- .../Runtime/Wearable/AnimationToggle.cs | 2 +- .../Runtime/Wearable/AnimationToggle.cs.meta | 2 +- .../Runtime/Wearable/AvatarConfig.cs | 2 +- .../Runtime/Wearable/AvatarConfig.cs.meta | 2 +- .../{ => Lib}/Runtime/Wearable/BoneMapping.cs | 2 +- .../Runtime/Wearable/BoneMapping.cs.meta | 2 +- .../Lib/Runtime/Wearable/Modules.meta | 8 +++ .../Runtime/Wearable/Modules/UnknownModule.cs | 12 ++-- .../Wearable/Modules/UnknownModule.cs.meta | 0 .../Wearable/Modules/WearableModuleBase.cs | 28 ++++----- .../Modules/WearableModuleBase.cs.meta | 0 .../Wearable/WearableAnimationPreset.cs | 2 +- .../Wearable/WearableAnimationPreset.cs.meta | 2 +- .../Runtime/Wearable/WearableConfig.cs | 8 +-- .../Runtime/Wearable/WearableConfig.cs.meta | 2 +- .../Runtime/Wearable/WearableCustomizable.cs | 2 +- .../Wearable/WearableCustomizable.cs.meta | 2 +- .../Runtime/Wearable/WearableInfo.cs | 2 +- .../Runtime/Wearable/WearableInfo.cs.meta | 2 +- ...copoi.vrc.dressingtools.api.Runtime.asmdef | 16 +++++ ....vrc.dressingtools.api.Runtime.asmdef.meta | 7 +++ .../Runtime/Cabinet/CabinetApplier.cs | 47 +++++++------- .../Runtime/Cabinet/DTCabinet.cs | 31 ++++----- .../Runtime/DTRuntimeUtils.cs | 6 +- .../Runtime/Dresser/Default/DefaultDresser.cs | 8 ++- .../Dresser/Default/Hooks/ArmatureHook.cs | 27 ++++---- .../Default/Hooks/NoMissingScriptsHook.cs | 9 +-- .../Dresser/Default/IDefaultDresserHook.cs | 4 +- .../Runtime/Dresser/IDTDresser.cs | 4 +- .../VRChat/VRChatIntegrationModule.cs | 14 ++--- .../Runtime/Logging/DTReportUtils.cs | 63 +++++++++++++++++++ .../Runtime/Logging/DTReportUtils.cs.meta | 11 ++++ .../Runtime/Proxy/DynamicBoneProxy.cs | 1 + .../Runtime/Proxy/PhysBoneProxy.cs | 1 + .../Modules/AnimationGenerationModule.cs | 10 +-- .../Wearable/Modules/ArmatureMappingModule.cs | 21 ++++--- .../Wearable/Modules/BlendshapeSyncModule.cs | 10 +-- .../Wearable/Modules/MoveRootModule.cs | 10 +-- ....chocopoi.vrc.dressingtools.Runtime.asmdef | 4 +- 123 files changed, 717 insertions(+), 249 deletions(-) create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib.meta create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Editor.meta create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI.meta rename Packages/com.chocopoi.vrc.dressingtools/{Editor/UIBase/Views => Lib/Editor/UI}/EditorViewBase.cs (99%) rename Packages/com.chocopoi.vrc.dressingtools/{Editor/UIBase/Views => Lib/Editor/UI}/EditorViewBase.cs.meta (83%) rename Packages/com.chocopoi.vrc.dressingtools/{Editor/UIBase/Views => Lib/Editor/UI}/IEditorView.cs (96%) rename Packages/com.chocopoi.vrc.dressingtools/{Editor/UIBase/Views => Lib/Editor/UI}/IEditorView.cs.meta (83%) rename Packages/com.chocopoi.vrc.dressingtools/{Editor/UIBase/Views => Lib/Editor/UI}/IModuleEditorViewParent.cs (90%) rename Packages/com.chocopoi.vrc.dressingtools/{Editor/UIBase/Views => Lib/Editor/UI}/IModuleEditorViewParent.cs.meta (83%) rename Packages/com.chocopoi.vrc.dressingtools/{Editor/UI/Views/Modules => Lib/Editor/UI}/ModuleEditor.cs (83%) rename Packages/com.chocopoi.vrc.dressingtools/{Editor/UI/Views/Modules => Lib/Editor/UI}/ModuleEditor.cs.meta (83%) rename Packages/com.chocopoi.vrc.dressingtools/{Editor/UI/Views/Modules => Lib/Editor/UI}/ModuleEditorAttribute.cs (95%) rename Packages/com.chocopoi.vrc.dressingtools/{Editor/UI/Views/Modules => Lib/Editor/UI}/ModuleEditorAttribute.cs.meta (83%) create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/com.chocopoi.vrc.dressingtools.api.Editor.asmdef create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/com.chocopoi.vrc.dressingtools.api.Editor.asmdef.meta create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/README.md create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/README.md.meta create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime.meta create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Cabinet.meta rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Cabinet/DTCabinetWearable.cs (95%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Cabinet/DTCabinetWearable.cs.meta (83%) create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Cabinet/ICabinet.cs rename Packages/com.chocopoi.vrc.dressingtools/{Runtime/Wearable/Modules/IWearableModule.cs.meta => Lib/Runtime/Cabinet/ICabinet.cs.meta} (83%) create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/DTBaseComponent.cs create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/DTBaseComponent.cs.meta create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/DTLibRuntimeUtils.cs create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/DTLibRuntimeUtils.cs.meta create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser.meta create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser/DTDresserSettings.cs create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser/DTDresserSettings.cs.meta rename Packages/com.chocopoi.vrc.dressingtools/{Runtime/Wearable/Modules/IWearableModule.cs => Lib/Runtime/Dresser/IDTDresser.cs} (62%) create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser/IDTDresser.cs.meta create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Logging.meta rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Logging/DTReport.cs (77%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Logging/DTReport.cs.meta (83%) create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Proxy.meta rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Proxy/IDynamicsProxy.cs (96%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Proxy/IDynamicsProxy.cs.meta (83%) create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable.meta rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/AnimationBlendshapeSync.cs (96%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/AnimationBlendshapeSync.cs.meta (83%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/AnimationBlendshapeValue.cs (95%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/AnimationBlendshapeValue.cs.meta (83%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/AnimationToggle.cs (95%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/AnimationToggle.cs.meta (83%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/AvatarConfig.cs (98%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/AvatarConfig.cs.meta (83%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/BoneMapping.cs (97%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/BoneMapping.cs.meta (83%) create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Modules.meta rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/Modules/UnknownModule.cs (78%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/Modules/UnknownModule.cs.meta (100%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/Modules/WearableModuleBase.cs (79%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/Modules/WearableModuleBase.cs.meta (100%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/WearableAnimationPreset.cs (96%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/WearableAnimationPreset.cs.meta (83%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/WearableConfig.cs (93%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/WearableConfig.cs.meta (83%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/WearableCustomizable.cs (97%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/WearableCustomizable.cs.meta (83%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/WearableInfo.cs (97%) rename Packages/com.chocopoi.vrc.dressingtools/{ => Lib}/Runtime/Wearable/WearableInfo.cs.meta (83%) create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/com.chocopoi.vrc.dressingtools.api.Runtime.asmdef create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/com.chocopoi.vrc.dressingtools.api.Runtime.asmdef.meta create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Runtime/Logging/DTReportUtils.cs create mode 100644 Packages/com.chocopoi.vrc.dressingtools/Runtime/Logging/DTReportUtils.cs.meta diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/Animations/AnimationGenerator.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/Animations/AnimationGenerator.cs index b8724f20..48a9c432 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/Animations/AnimationGenerator.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/Animations/AnimationGenerator.cs @@ -17,9 +17,10 @@ using System.Collections.Generic; using Chocopoi.AvatarLib.Animations; +using Chocopoi.DressingTools.Lib.Logging; +using Chocopoi.DressingTools.Lib.Proxy; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.Logging; -using Chocopoi.DressingTools.Proxy; -using Chocopoi.DressingTools.Wearable; using Chocopoi.DressingTools.Wearable.Modules; using UnityEngine; @@ -69,21 +70,21 @@ private bool TryGetBlendshapeValue(GameObject obj, string blendshapeName, out fl SkinnedMeshRenderer smr; if ((smr = obj.GetComponent()) == null) { - _report.LogWarnLocalized(LogLabel, MessageCode.IgnoredObjectHasNoSkinnedMeshRendererAttached, obj.name); + DTReportUtils.LogWarnLocalized(_report, LogLabel, MessageCode.IgnoredObjectHasNoSkinnedMeshRendererAttached, obj.name); return false; } Mesh mesh; if ((mesh = smr.sharedMesh) == null) { - _report.LogWarnLocalized(LogLabel, MessageCode.IgnoredObjectHasNoMeshAttached, obj.name); + DTReportUtils.LogWarnLocalized(_report, LogLabel, MessageCode.IgnoredObjectHasNoMeshAttached, obj.name); return false; } int blendshapeIndex; if ((blendshapeIndex = mesh.GetBlendShapeIndex(blendshapeName)) == -1) { - _report.LogWarnLocalized(LogLabel, MessageCode.IgnoredObjectHasNoSuchBlendshape, obj.name, blendshapeName); + DTReportUtils.LogWarnLocalized(_report, LogLabel, MessageCode.IgnoredObjectHasNoSuchBlendshape, obj.name, blendshapeName); return false; } @@ -98,7 +99,7 @@ private void GenerateAvatarToggleAnimations(AnimationClip enableClip, AnimationC var obj = _avatarObject.transform.Find(toggle.path); if (obj == null) { - _report.LogWarnLocalized(LogLabel, MessageCode.IgnoredAvatarToggleObjectNotFound, toggle.path); + DTReportUtils.LogWarnLocalized(_report, LogLabel, MessageCode.IgnoredAvatarToggleObjectNotFound, toggle.path); } else { @@ -118,13 +119,13 @@ private void GenerateAvatarBlendshapeAnimations(AnimationClip enableClip, Animat var obj = _avatarObject.transform.Find(blendshape.path); if (obj == null) { - _report.LogWarnLocalized(LogLabel, MessageCode.IgnoredAvatarBlendshapeObjectNotFound, _avatarObject.name, blendshape.path); + DTReportUtils.LogWarnLocalized(_report, LogLabel, MessageCode.IgnoredAvatarBlendshapeObjectNotFound, _avatarObject.name, blendshape.path); continue; } if (!TryGetBlendshapeValue(obj.gameObject, blendshape.blendshapeName, out var originalValue)) { - _report.LogWarnLocalized(LogLabel, MessageCode.IgnoredCouldNotObtainAvatarBlendshapeOriginalValue, _avatarObject.name, blendshape.path); + DTReportUtils.LogWarnLocalized(_report, LogLabel, MessageCode.IgnoredCouldNotObtainAvatarBlendshapeOriginalValue, _avatarObject.name, blendshape.path); continue; } @@ -144,7 +145,7 @@ private void GenerateWearableToggleAnimations(AnimationClip enableClip, Animatio var obj = _wearableObject.transform.Find(toggle.path); if (obj == null) { - _report.LogWarnLocalized(LogLabel, MessageCode.IgnoredWearableToggleObjectNotFound, toggle.path); + DTReportUtils.LogWarnLocalized(_report, LogLabel, MessageCode.IgnoredWearableToggleObjectNotFound, toggle.path); } else { @@ -164,12 +165,12 @@ private void GenerateWearableBlendshapeAnimations(AnimationClip enableClip, Anim var obj = _wearableObject.transform.Find(blendshape.path); if (obj == null) { - _report.LogWarnLocalized(LogLabel, MessageCode.IgnoredAvatarBlendshapeObjectNotFound, _wearableObject.name, blendshape.path); + DTReportUtils.LogWarnLocalized(_report, LogLabel, MessageCode.IgnoredAvatarBlendshapeObjectNotFound, _wearableObject.name, blendshape.path); } if (!TryGetBlendshapeValue(obj.gameObject, blendshape.blendshapeName, out var originalValue)) { - _report.LogWarnLocalized(LogLabel, MessageCode.IgnoredCouldNotObtainWearableBlendshapeOriginalValue, _wearableObject.name, blendshape.path); + DTReportUtils.LogWarnLocalized(_report, LogLabel, MessageCode.IgnoredCouldNotObtainWearableBlendshapeOriginalValue, _wearableObject.name, blendshape.path); continue; } diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/DTEditorUtils.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/DTEditorUtils.cs index 14d1bc91..ebe5427a 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/DTEditorUtils.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/DTEditorUtils.cs @@ -16,6 +16,8 @@ */ using Chocopoi.DressingTools.Cabinet; +using Chocopoi.DressingTools.Lib.Cabinet; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.Wearable; using UnityEditor; using UnityEngine; @@ -71,8 +73,8 @@ public static DTCabinet GetAvatarCabinet(GameObject avatar, bool createIfNotExis comp = avatar.AddComponent(); // TODO: read default config, scan for armature names? - comp.avatarGameObject = avatar; - comp.avatarArmatureName = "Armature"; + comp.AvatarGameObject = avatar; + comp.AvatarArmatureName = "Armature"; } return comp; @@ -101,7 +103,7 @@ public static void AddCabinetWearable(DTCabinet cabinet, WearableConfig config, public static void RemoveCabinetWearable(DTCabinet cabinet, DTCabinetWearable wearable) { - var cabinetWearables = cabinet.avatarGameObject.GetComponentsInChildren(); + var cabinetWearables = cabinet.AvatarGameObject.GetComponentsInChildren(); foreach (var cabinetWearable in cabinetWearables) { if (cabinetWearable == wearable) @@ -137,7 +139,7 @@ public static void AddWearableTargetAvatarConfig(WearableConfig config, GameObje } else { - config.targetAvatarConfig.armatureName = cabinet.avatarArmatureName; + config.targetAvatarConfig.armatureName = cabinet.AvatarArmatureName; } // can't do anything diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/Inspector/DTCabinetEditor.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/Inspector/DTCabinetEditor.cs index 849ba721..5e0c00b5 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/Inspector/DTCabinetEditor.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/Inspector/DTCabinetEditor.cs @@ -33,7 +33,7 @@ public override void OnInspectorGUI() var cabinet = (DTCabinet)target; EditorGUI.BeginDisabledGroup(true); - EditorGUILayout.ObjectField("Avatar", cabinet.avatarGameObject, typeof(GameObject), true); + EditorGUILayout.ObjectField("Avatar", cabinet.AvatarGameObject, typeof(GameObject), true); EditorGUI.EndDisabledGroup(); EditorGUILayout.Separator(); diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/Integrations/VRChat/ApplyCabinetHook.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/Integrations/VRChat/ApplyCabinetHook.cs index 49fc0456..fdf7ef13 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/Integrations/VRChat/ApplyCabinetHook.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/Integrations/VRChat/ApplyCabinetHook.cs @@ -16,6 +16,7 @@ */ #if VRC_SDK_VRCSDK3 +using Chocopoi.DressingTools.Lib.Logging; using Chocopoi.DressingTools.Cabinet; using Chocopoi.DressingTools.Logging; using UnityEditor; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/Integrations/VRChat/BuildDTCabinetCallback.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/Integrations/VRChat/BuildDTCabinetCallback.cs index 04e52d69..bf3d8217 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/Integrations/VRChat/BuildDTCabinetCallback.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/Integrations/VRChat/BuildDTCabinetCallback.cs @@ -19,6 +19,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; +using Chocopoi.DressingTools.Lib.Logging; using Chocopoi.DressingTools.Logging; using Chocopoi.DressingTools.UI; using UnityEditor; @@ -79,7 +80,7 @@ public bool OnPreprocessAvatar(GameObject avatarGameObject) } catch (System.Exception ex) { - report.LogExceptionLocalized(LogLabel, ex, "integrations.vrc.msgCode.error.exceptionProcessAvatar"); + DTReportUtils.LogExceptionLocalized(report, LogLabel, ex, "integrations.vrc.msgCode.error.exceptionProcessAvatar"); } finally { diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/Integrations/VRChat/GenerateAnimationsHook.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/Integrations/VRChat/GenerateAnimationsHook.cs index 3314f237..6763e1f5 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/Integrations/VRChat/GenerateAnimationsHook.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/Integrations/VRChat/GenerateAnimationsHook.cs @@ -20,9 +20,10 @@ using Chocopoi.AvatarLib.Animations; using Chocopoi.AvatarLib.Expressions; using Chocopoi.DressingTools.Animations; +using Chocopoi.DressingTools.Lib.Logging; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.Cabinet; using Chocopoi.DressingTools.Logging; -using Chocopoi.DressingTools.Wearable; using Chocopoi.DressingTools.Wearable.Modules; using UnityEditor; using UnityEditor.Animations; @@ -63,7 +64,7 @@ public bool OnPreprocessAvatar() EditorUtility.DisplayProgressBar("DressingTools", "Generating animations...", 0); // get the avatar descriptor - var avatarDescriptor = _cabinet.avatarGameObject.GetComponent(); + var avatarDescriptor = _cabinet.AvatarGameObject.GetComponent(); // obtain FX layer var fxController = CopyAndReplaceLayerAnimator(avatarDescriptor, VRCAvatarDescriptor.AnimLayerType.FX); @@ -112,7 +113,7 @@ public bool OnPreprocessAvatar() } catch (ParameterOverflowException ex) { - _report.LogExceptionLocalized(LogLabel, ex, "integrations.vrc.msgCode.error.parameterOverFlow"); + DTReportUtils.LogExceptionLocalized(_report, LogLabel, ex, "integrations.vrc.msgCode.error.parameterOverFlow"); return false; } @@ -157,7 +158,7 @@ public bool OnPreprocessAvatar() continue; } - var animationGenerator = new AnimationGenerator(_report, _cabinet.avatarGameObject, module, wearables[i].wearableGameObject, wearableDynamics); + var animationGenerator = new AnimationGenerator(_report, _cabinet.AvatarGameObject, module, wearables[i].wearableGameObject, wearableDynamics); // TODO: write defaults settings var wearAnimations = animationGenerator.GenerateWearAnimations(true); diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/DTLegacyEditorWindow.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/DTLegacyEditorWindow.cs index 0e1e88f4..e246c121 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/DTLegacyEditorWindow.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/DTLegacyEditorWindow.cs @@ -19,6 +19,7 @@ using System.Text.RegularExpressions; using Chocopoi.DressingTools.Dresser; using Chocopoi.DressingTools.Dresser.Default; +using Chocopoi.DressingTools.Lib.Logging; using Chocopoi.DressingTools.Localization; using Chocopoi.DressingTools.Logging; using UnityEditor; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/DTMainEditorWindow.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/DTMainEditorWindow.cs index 59102859..4c7e8730 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/DTMainEditorWindow.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/DTMainEditorWindow.cs @@ -18,6 +18,8 @@ using Chocopoi.DressingTools.Cabinet; using Chocopoi.DressingTools.Dresser; using Chocopoi.DressingTools.Dresser.Default; +using Chocopoi.DressingTools.Lib.Logging; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.UI.View; using Chocopoi.DressingTools.Wearable; using Chocopoi.DressingTools.Wearable.Modules; @@ -64,9 +66,9 @@ static void QuickAutoSetup(MenuCommand menuCommand) } var config = new WearableConfig(); - DTEditorUtils.PrepareWearableConfig(config, cabinet.avatarGameObject, wearable); + DTEditorUtils.PrepareWearableConfig(config, cabinet.AvatarGameObject, wearable); - var armatureName = cabinet.avatarArmatureName; + var armatureName = cabinet.AvatarArmatureName; // attempt to find wearable armature using avatar armature name var armature = DTRuntimeUtils.GuessArmature(wearable, armatureName); @@ -86,7 +88,7 @@ static void QuickAutoSetup(MenuCommand menuCommand) var dresserSettings = new DefaultDresserSettings() { - targetAvatar = cabinet.avatarGameObject, + targetAvatar = cabinet.AvatarGameObject, targetWearable = wearable, dynamicsOption = DefaultDresserDynamicsOption.RemoveDynamicsAndUseParentConstraint }; @@ -94,7 +96,7 @@ static void QuickAutoSetup(MenuCommand menuCommand) var dresser = new DefaultDresser(); var report = dresser.Execute(dresserSettings, out _); - if (report.HasLogType(Logging.DTReportLogType.Error)) + if (report.HasLogType(DTReportLogType.Error)) { ReportWindow.ShowWindow(report); EditorUtility.DisplayDialog("DressingTools", "Default dresser has errors processing this wearable automatically, please use the wizard instead.", "OK"); diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/MappingEditorWindow.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/MappingEditorWindow.cs index 4f3ce709..d7163011 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/MappingEditorWindow.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/MappingEditorWindow.cs @@ -16,6 +16,7 @@ */ using System.Collections.Generic; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.UI.View; using Chocopoi.DressingTools.Wearable; using Chocopoi.DressingTools.Wearable.Modules; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/CabinetPresenter.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/CabinetPresenter.cs index 9cc5f117..bb68a557 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/CabinetPresenter.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/CabinetPresenter.cs @@ -16,6 +16,7 @@ */ using Chocopoi.DressingTools.Cabinet; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.UIBase.Views; using Chocopoi.DressingTools.Wearable; using Newtonsoft.Json; @@ -75,8 +76,8 @@ private void OnCabinetSettingsChange() var cabinet = cabinets[_view.SelectedCabinetIndex]; - cabinet.avatarArmatureName = _view.CabinetAvatarArmatureName; - cabinet.avatarGameObject = _view.CabinetAvatarGameObject; + cabinet.AvatarArmatureName = _view.CabinetAvatarArmatureName; + cabinet.AvatarGameObject = _view.CabinetAvatarGameObject; } private void OnForceUpdateView() @@ -118,7 +119,7 @@ private void UpdateCabinetSelectionDropdown(DTCabinet[] cabinets) string[] cabinetOptions = new string[cabinets.Length]; for (var i = 0; i < cabinets.Length; i++) { - cabinetOptions[i] = cabinets[i].avatarGameObject != null ? cabinets[i].avatarGameObject.name : string.Format("Cabinet {0} (No GameObject Attached)", i + 1); + cabinetOptions[i] = cabinets[i].AvatarGameObject != null ? cabinets[i].AvatarGameObject.name : string.Format("Cabinet {0} (No GameObject Attached)", i + 1); } _view.AvailableCabinetSelections = cabinetOptions; } @@ -148,8 +149,8 @@ private void UpdateView() // update selected cabinet view var cabinet = cabinets[_view.SelectedCabinetIndex]; - _view.CabinetAvatarGameObject = cabinet.avatarGameObject; - _view.CabinetAvatarArmatureName = cabinet.avatarArmatureName; + _view.CabinetAvatarGameObject = cabinet.AvatarGameObject; + _view.CabinetAvatarArmatureName = cabinet.AvatarArmatureName; var wearables = cabinet.GetWearables(); diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/MappingEditorPresenter.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/MappingEditorPresenter.cs index 62562c83..52600440 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/MappingEditorPresenter.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/MappingEditorPresenter.cs @@ -17,6 +17,7 @@ using System.Collections.Generic; using Chocopoi.AvatarLib.Animations; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.UIBase.Views; using Chocopoi.DressingTools.Wearable; using Chocopoi.DressingTools.Wearable.Modules; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/Modules/AnimationGenerationModuleEditorPresenter.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/Modules/AnimationGenerationModuleEditorPresenter.cs index 6bd60ad7..a50ee8d1 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/Modules/AnimationGenerationModuleEditorPresenter.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/Modules/AnimationGenerationModuleEditorPresenter.cs @@ -16,6 +16,8 @@ */ using System.Collections.Generic; +using Chocopoi.DressingTools.Lib.UI; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.UIBase.Views; using Chocopoi.DressingTools.Wearable; using Chocopoi.DressingTools.Wearable.Modules; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/Modules/ArmatureMappingModuleEditorPresenter.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/Modules/ArmatureMappingModuleEditorPresenter.cs index ece2435d..ee0d1052 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/Modules/ArmatureMappingModuleEditorPresenter.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/Modules/ArmatureMappingModuleEditorPresenter.cs @@ -19,6 +19,9 @@ using Chocopoi.DressingTools.Cabinet; using Chocopoi.DressingTools.Dresser; using Chocopoi.DressingTools.Dresser.Default; +using Chocopoi.DressingTools.Lib.Logging; +using Chocopoi.DressingTools.Lib.UI; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.Logging; using Chocopoi.DressingTools.UIBase.Views; using Chocopoi.DressingTools.Wearable; @@ -188,8 +191,8 @@ private void UpdateDresserSettings() if (_cabinet != null) { _view.IsAvatarAssociatedWithCabinet = true; - _view.AvatarArmatureName = _cabinet.avatarArmatureName; - _view.DresserSettings.avatarArmatureName = _cabinet.avatarArmatureName; + _view.AvatarArmatureName = _cabinet.AvatarArmatureName; + _view.DresserSettings.avatarArmatureName = _cabinet.AvatarArmatureName; } else { diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/Modules/BlendshapeSyncModuleEditorPresenter.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/Modules/BlendshapeSyncModuleEditorPresenter.cs index 0a3086ec..0c26410e 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/Modules/BlendshapeSyncModuleEditorPresenter.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/Modules/BlendshapeSyncModuleEditorPresenter.cs @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License along with DressingTools. If not, see . */ +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.UIBase.Views; using Chocopoi.DressingTools.Wearable; using Chocopoi.DressingTools.Wearable.Modules; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/Modules/MoveRootModuleEditorPresenter.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/Modules/MoveRootModuleEditorPresenter.cs index b14c69be..c61e6c88 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/Modules/MoveRootModuleEditorPresenter.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/Modules/MoveRootModuleEditorPresenter.cs @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License along with DressingTools. If not, see . */ +using Chocopoi.DressingTools.Lib.UI; using Chocopoi.DressingTools.UIBase.Views; using Chocopoi.DressingTools.Wearable.Modules; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/WearableConfigPresenter.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/WearableConfigPresenter.cs index 1071b443..4e73b110 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/WearableConfigPresenter.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/WearableConfigPresenter.cs @@ -18,6 +18,9 @@ using System; using System.Collections.Generic; using System.Linq; +using Chocopoi.DressingTools.Lib.UI; +using Chocopoi.DressingTools.Lib.Wearable; +using Chocopoi.DressingTools.Lib.Wearable.Modules; using Chocopoi.DressingTools.UI.Views.Modules; using Chocopoi.DressingTools.UIBase.Views; using Chocopoi.DressingTools.Wearable; @@ -90,7 +93,7 @@ private void ApplyTargetAvatarConfigChanges() } else { - _view.Config.targetAvatarConfig.armatureName = cabinet.avatarArmatureName; + _view.Config.targetAvatarConfig.armatureName = cabinet.AvatarArmatureName; } // can't do anything @@ -177,7 +180,7 @@ private void OnAddModuleButtonClick() UpdateModulesView(); } - private ModuleEditor CreateModuleEditor(IWearableModule module) + private ModuleEditor CreateModuleEditor(WearableModuleBase module) { // prepare cache if not yet if (s_moduleEditorTypesCache == null) diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/WearableSetupWizardPresenter.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/WearableSetupWizardPresenter.cs index 9e11f4d3..05512c73 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/WearableSetupWizardPresenter.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Presenters/WearableSetupWizardPresenter.cs @@ -17,6 +17,8 @@ using System.Collections.Generic; using Chocopoi.DressingTools.Cabinet; +using Chocopoi.DressingTools.Lib.Cabinet; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.UIBase.Views; using Chocopoi.DressingTools.Wearable; using UnityEngine; @@ -75,7 +77,7 @@ private void AutoSetupMapping() var armatureName = "Armature"; if (cabinet != null) { - armatureName = cabinet.avatarArmatureName; + armatureName = cabinet.AvatarArmatureName; _view.ShowAvatarNoCabinetHelpBox = false; } else diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/ReportWindow.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/ReportWindow.cs index 9a0c6622..3dd2e3a1 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/ReportWindow.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/ReportWindow.cs @@ -16,6 +16,7 @@ */ using System.Collections.Generic; +using Chocopoi.DressingTools.Lib.Logging; using Chocopoi.DressingTools.Localization; using Chocopoi.DressingTools.Logging; using UnityEditor; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/CabinetSubView.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/CabinetSubView.cs index 0efa185b..596e9f0c 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/CabinetSubView.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/CabinetSubView.cs @@ -18,8 +18,8 @@ using System; using System.Collections.Generic; using Chocopoi.DressingTools.Cabinet; +using Chocopoi.DressingTools.Lib.UI; using Chocopoi.DressingTools.UI.Presenters; -using Chocopoi.DressingTools.UIBase; using Chocopoi.DressingTools.UIBase.Views; using UnityEngine; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/DressingSubView.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/DressingSubView.cs index cd14a690..8f5684ef 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/DressingSubView.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/DressingSubView.cs @@ -16,6 +16,8 @@ */ using System; +using Chocopoi.DressingTools.Lib.UI; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.UI.Presenters; using Chocopoi.DressingTools.UIBase; using Chocopoi.DressingTools.UIBase.Views; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/MainView.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/MainView.cs index cac1544d..bff61a93 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/MainView.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/MainView.cs @@ -16,9 +16,9 @@ */ using Chocopoi.DressingTools.Cabinet; +using Chocopoi.DressingTools.Lib.UI; using Chocopoi.DressingTools.UI.Presenters; using Chocopoi.DressingTools.UI.Views; -using Chocopoi.DressingTools.UIBase; using Chocopoi.DressingTools.UIBase.Views; using UnityEngine; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/MappingEditorView.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/MappingEditorView.cs index 325585b5..3aab5c45 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/MappingEditorView.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/MappingEditorView.cs @@ -17,6 +17,7 @@ using System; using System.Collections.Generic; +using Chocopoi.DressingTools.Lib.UI; using Chocopoi.DressingTools.UI.Presenters; using Chocopoi.DressingTools.UIBase; using Chocopoi.DressingTools.UIBase.Views; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/AnimationGenerationModuleEditor.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/AnimationGenerationModuleEditor.cs index a5858c37..282c0007 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/AnimationGenerationModuleEditor.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/AnimationGenerationModuleEditor.cs @@ -17,6 +17,8 @@ using System; using System.Collections.Generic; +using Chocopoi.DressingTools.Lib.UI; +using Chocopoi.DressingTools.Lib.Wearable.Modules; using Chocopoi.DressingTools.UI.Presenters.Modules; using Chocopoi.DressingTools.UIBase.Views; using Chocopoi.DressingTools.Wearable.Modules; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/ArmatureMappingModuleEditor.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/ArmatureMappingModuleEditor.cs index 320e1b5f..b8b7b6c6 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/ArmatureMappingModuleEditor.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/ArmatureMappingModuleEditor.cs @@ -17,6 +17,8 @@ using System; using Chocopoi.DressingTools.Dresser; +using Chocopoi.DressingTools.Lib.UI; +using Chocopoi.DressingTools.Lib.Wearable.Modules; using Chocopoi.DressingTools.UI.Presenters.Modules; using Chocopoi.DressingTools.UIBase.Views; using Chocopoi.DressingTools.Wearable.Modules; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/BlendshapeSyncModuleEditor.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/BlendshapeSyncModuleEditor.cs index 540456e4..4894844e 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/BlendshapeSyncModuleEditor.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/BlendshapeSyncModuleEditor.cs @@ -17,6 +17,8 @@ using System; using System.Collections.Generic; +using Chocopoi.DressingTools.Lib.UI; +using Chocopoi.DressingTools.Lib.Wearable.Modules; using Chocopoi.DressingTools.UI.Presenters.Modules; using Chocopoi.DressingTools.UIBase.Views; using Chocopoi.DressingTools.Wearable.Modules; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/MoveRootModuleEditor.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/MoveRootModuleEditor.cs index 0bbadebb..54d39221 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/MoveRootModuleEditor.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/MoveRootModuleEditor.cs @@ -16,6 +16,8 @@ */ using System; +using Chocopoi.DressingTools.Lib.UI; +using Chocopoi.DressingTools.Lib.Wearable.Modules; using Chocopoi.DressingTools.UI.Presenters.Modules; using Chocopoi.DressingTools.UIBase.Views; using Chocopoi.DressingTools.Wearable.Modules; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/UnknownModuleEditor.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/UnknownModuleEditor.cs index 7e5f79a2..70d80995 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/UnknownModuleEditor.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/UnknownModuleEditor.cs @@ -15,8 +15,8 @@ * You should have received a copy of the GNU General Public License along with DressingTools. If not, see . */ -using Chocopoi.DressingTools.UIBase.Views; -using Chocopoi.DressingTools.Wearable.Modules; +using Chocopoi.DressingTools.Lib.UI; +using Chocopoi.DressingTools.Lib.Wearable.Modules; using UnityEditor; namespace Chocopoi.DressingTools.UI.Views.Modules diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/WearableConfigView.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/WearableConfigView.cs index 6a2cb801..dc78fe0b 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/WearableConfigView.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/WearableConfigView.cs @@ -17,6 +17,8 @@ using System; using System.Collections.Generic; +using Chocopoi.DressingTools.Lib.UI; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.Localization; using Chocopoi.DressingTools.UI.Presenters; using Chocopoi.DressingTools.UIBase; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/WearableSetupWizardView.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/WearableSetupWizardView.cs index c628c6b8..4e3f4019 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/WearableSetupWizardView.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/WearableSetupWizardView.cs @@ -16,6 +16,8 @@ */ using System; +using Chocopoi.DressingTools.Lib.UI; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.UI.Presenters; using Chocopoi.DressingTools.UI.Views.Modules; using Chocopoi.DressingTools.UIBase; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/ICabinetSubView.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/ICabinetSubView.cs index fa18dc02..f3aa927c 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/ICabinetSubView.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/ICabinetSubView.cs @@ -17,6 +17,7 @@ using System; using System.Collections.Generic; +using Chocopoi.DressingTools.Lib.UI; using UnityEngine; namespace Chocopoi.DressingTools.UIBase.Views diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IDressingSubView.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IDressingSubView.cs index 8bd3662c..f34504b8 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IDressingSubView.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IDressingSubView.cs @@ -16,6 +16,7 @@ */ using System; +using Chocopoi.DressingTools.Lib.UI; namespace Chocopoi.DressingTools.UIBase.Views { diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IMainView.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IMainView.cs index a424aa1c..ebb68203 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IMainView.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IMainView.cs @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License along with DressingTools. If not, see . */ +using Chocopoi.DressingTools.Lib.UI; using UnityEngine; namespace Chocopoi.DressingTools.UIBase.Views diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IMappingEditorView.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IMappingEditorView.cs index 12dec1f4..ac6e711c 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IMappingEditorView.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IMappingEditorView.cs @@ -17,6 +17,7 @@ using System; using System.Collections.Generic; +using Chocopoi.DressingTools.Lib.UI; using UnityEngine; namespace Chocopoi.DressingTools.UIBase.Views diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IWearableConfigView.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IWearableConfigView.cs index 3fcc1f26..f3772166 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IWearableConfigView.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IWearableConfigView.cs @@ -17,6 +17,8 @@ using System; using System.Collections.Generic; +using Chocopoi.DressingTools.Lib.UI; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.UI.Views.Modules; using Chocopoi.DressingTools.Wearable; using UnityEngine; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IWearableConfigViewParent.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IWearableConfigViewParent.cs index fa733a8f..bd7593ce 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IWearableConfigViewParent.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IWearableConfigViewParent.cs @@ -16,6 +16,7 @@ */ using System; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.Wearable; using UnityEngine; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IWearableSetupWizardView.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IWearableSetupWizardView.cs index 5a7bc4f7..b45fad41 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IWearableSetupWizardView.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IWearableSetupWizardView.cs @@ -16,8 +16,9 @@ */ using System; +using Chocopoi.DressingTools.Lib.UI; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.UI.Views.Modules; -using Chocopoi.DressingTools.Wearable; using Chocopoi.DressingTools.Wearable.Modules; namespace Chocopoi.DressingTools.UIBase.Views diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/Modules/IAnimationGenerationModuleEditorView.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/Modules/IAnimationGenerationModuleEditorView.cs index 63d953cb..c49ea6ed 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/Modules/IAnimationGenerationModuleEditorView.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/Modules/IAnimationGenerationModuleEditorView.cs @@ -17,6 +17,7 @@ using System; using System.Collections.Generic; +using Chocopoi.DressingTools.Lib.UI; using UnityEngine; namespace Chocopoi.DressingTools.UIBase.Views diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/Modules/IArmatureMappingModuleEditorView.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/Modules/IArmatureMappingModuleEditorView.cs index 53fcc6ae..f0c62c8b 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/Modules/IArmatureMappingModuleEditorView.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/Modules/IArmatureMappingModuleEditorView.cs @@ -18,6 +18,7 @@ using System; using System.Collections.Generic; using Chocopoi.DressingTools.Dresser; +using Chocopoi.DressingTools.Lib.UI; namespace Chocopoi.DressingTools.UIBase.Views { diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/Modules/IBlendshapeSyncModuleEditorView.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/Modules/IBlendshapeSyncModuleEditorView.cs index c151b801..77c5d816 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/Modules/IBlendshapeSyncModuleEditorView.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/Modules/IBlendshapeSyncModuleEditorView.cs @@ -17,6 +17,7 @@ using System; using System.Collections.Generic; +using Chocopoi.DressingTools.Lib.UI; using UnityEngine; namespace Chocopoi.DressingTools.UIBase.Views diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/Modules/IMoveRootModuleEditorView.cs b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/Modules/IMoveRootModuleEditorView.cs index 74782776..bf1a1917 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/Modules/IMoveRootModuleEditorView.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/Modules/IMoveRootModuleEditorView.cs @@ -16,6 +16,7 @@ */ using System; +using Chocopoi.DressingTools.Lib.UI; using UnityEngine; namespace Chocopoi.DressingTools.UIBase.Views diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/com.chocopoi.vrc.dressingtools.Editor.asmdef b/Packages/com.chocopoi.vrc.dressingtools/Editor/com.chocopoi.vrc.dressingtools.Editor.asmdef index 36dd1bd0..ad4335ae 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/com.chocopoi.vrc.dressingtools.Editor.asmdef +++ b/Packages/com.chocopoi.vrc.dressingtools/Editor/com.chocopoi.vrc.dressingtools.Editor.asmdef @@ -2,7 +2,9 @@ "name": "com.chocopoi.vrc.dressingtools.Editor", "references": [ "GUID:85e555d1cc87ace4d8e14fcfe9062453", - "GUID:97650872dc498bb4597e0bbf23109900" + "GUID:97650872dc498bb4597e0bbf23109900", + "GUID:8eb5b149dedbba24490f0743a2ab1e61", + "GUID:dcaf16fd99f37914888e6e13bdf533ea" ], "includePlatforms": [ "Editor" diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib.meta new file mode 100644 index 00000000..1c986bcc --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b2a7d9099d71b984b9011c1d69f5a8fd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor.meta new file mode 100644 index 00000000..7702ce04 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 04638b0def9569540bd7d037186ce129 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI.meta new file mode 100644 index 00000000..2137c6a3 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ecbb527e4269c42469aae48f9c62392c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/EditorViewBase.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/EditorViewBase.cs similarity index 99% rename from Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/EditorViewBase.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/EditorViewBase.cs index 9a944e36..95dc59a9 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/EditorViewBase.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/EditorViewBase.cs @@ -16,11 +16,10 @@ */ using System; -using Chocopoi.DressingTools.UIBase.Views; using UnityEditor; using UnityEngine; -namespace Chocopoi.DressingTools.UIBase +namespace Chocopoi.DressingTools.Lib.UI { public abstract class EditorViewBase : IEditorView { diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/EditorViewBase.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/EditorViewBase.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/EditorViewBase.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/EditorViewBase.cs.meta index 66ffa8b8..9dd5256f 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/EditorViewBase.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/EditorViewBase.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: df9699a1381dca24ab24cd023b3e3a70 +guid: ae478162e856b644287d1f455dfc33f7 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IEditorView.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/IEditorView.cs similarity index 96% rename from Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IEditorView.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/IEditorView.cs index ba9bdc5d..9e9e8e08 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IEditorView.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/IEditorView.cs @@ -17,7 +17,7 @@ using System; -namespace Chocopoi.DressingTools.UIBase.Views +namespace Chocopoi.DressingTools.Lib.UI { public interface IEditorView { diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IEditorView.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/IEditorView.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IEditorView.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/IEditorView.cs.meta index d99a86b9..25ea8826 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IEditorView.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/IEditorView.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 17737905f46e4c543a0ed807daeacab4 +guid: c071a05b451dfa64ea196bb6a61e77be MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IModuleEditorViewParent.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/IModuleEditorViewParent.cs similarity index 90% rename from Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IModuleEditorViewParent.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/IModuleEditorViewParent.cs index 0c7a2ace..7fb6495c 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IModuleEditorViewParent.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/IModuleEditorViewParent.cs @@ -18,9 +18,9 @@ using System; using UnityEngine; -namespace Chocopoi.DressingTools.UIBase.Views +namespace Chocopoi.DressingTools.Lib.UI { - internal interface IModuleEditorViewParent : IEditorView + public interface IModuleEditorViewParent : IEditorView { event Action TargetAvatarOrWearableChange; GameObject TargetAvatar { get; } diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IModuleEditorViewParent.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/IModuleEditorViewParent.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IModuleEditorViewParent.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/IModuleEditorViewParent.cs.meta index 3db5df8a..f9812832 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UIBase/Views/IModuleEditorViewParent.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/IModuleEditorViewParent.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 37a5598df9dfdb14cb7d73f5bdc2138f +guid: 80e2fb3d8b2e7f74c80f5037361e1b90 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/ModuleEditor.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/ModuleEditor.cs similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/ModuleEditor.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/ModuleEditor.cs index cfe2c0c2..c08e8a9f 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/ModuleEditor.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/ModuleEditor.cs @@ -15,14 +15,12 @@ * You should have received a copy of the GNU General Public License along with DressingTools. If not, see . */ -using Chocopoi.DressingTools.UIBase; -using Chocopoi.DressingTools.UIBase.Views; -using Chocopoi.DressingTools.Wearable.Modules; +using Chocopoi.DressingTools.Lib.Wearable.Modules; using UnityEditor; -namespace Chocopoi.DressingTools.UI.Views.Modules +namespace Chocopoi.DressingTools.Lib.UI { - internal class ModuleEditor : EditorViewBase + public class ModuleEditor : EditorViewBase { public virtual string FriendlyName => GetType().Name; @@ -30,9 +28,9 @@ internal class ModuleEditor : EditorViewBase protected IModuleEditorViewParent parentView; - protected IWearableModule target; + protected WearableModuleBase target; - public ModuleEditor(IModuleEditorViewParent parentView, IWearableModule target) + public ModuleEditor(IModuleEditorViewParent parentView, WearableModuleBase target) { this.parentView = parentView; this.target = target; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/ModuleEditor.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/ModuleEditor.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/ModuleEditor.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/ModuleEditor.cs.meta index e883719d..68bb62c2 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/ModuleEditor.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/ModuleEditor.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: fd4e4add6a13a8c459fa6c6bad897bb5 +guid: 8854bb52d088c574c87715ab2d3b70a8 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/ModuleEditorAttribute.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/ModuleEditorAttribute.cs similarity index 95% rename from Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/ModuleEditorAttribute.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/ModuleEditorAttribute.cs index 3f8a70ee..a679053e 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/ModuleEditorAttribute.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/ModuleEditorAttribute.cs @@ -17,7 +17,7 @@ using System; -namespace Chocopoi.DressingTools.UI.Views.Modules +namespace Chocopoi.DressingTools.Lib.UI { public class CustomModuleEditor : Attribute { diff --git a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/ModuleEditorAttribute.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/ModuleEditorAttribute.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/ModuleEditorAttribute.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/ModuleEditorAttribute.cs.meta index eab2233b..f91a3876 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Editor/UI/Views/Modules/ModuleEditorAttribute.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/UI/ModuleEditorAttribute.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 37d5a09d1a00e7c4e9d65e0803b3bd06 +guid: 772a39c8aa3d1e9409a1da08fd07b379 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/com.chocopoi.vrc.dressingtools.api.Editor.asmdef b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/com.chocopoi.vrc.dressingtools.api.Editor.asmdef new file mode 100644 index 00000000..92a36aac --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/com.chocopoi.vrc.dressingtools.api.Editor.asmdef @@ -0,0 +1,18 @@ +{ + "name": "com.chocopoi.vrc.dressingtools.api.Editor", + "references": [ + "GUID:dcaf16fd99f37914888e6e13bdf533ea", + "GUID:97650872dc498bb4597e0bbf23109900" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/com.chocopoi.vrc.dressingtools.api.Editor.asmdef.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/com.chocopoi.vrc.dressingtools.api.Editor.asmdef.meta new file mode 100644 index 00000000..e39a7d6e --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Editor/com.chocopoi.vrc.dressingtools.api.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8eb5b149dedbba24490f0743a2ab1e61 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/README.md b/Packages/com.chocopoi.vrc.dressingtools/Lib/README.md new file mode 100644 index 00000000..42f4ebb6 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/README.md @@ -0,0 +1,4 @@ +# DressingTools.Lib +A library abstraction layer of DressingTools for extensibility + +This will be moved to a separate repository with a different license in the future. diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/README.md.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/README.md.meta new file mode 100644 index 00000000..3d6df740 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 50727fa3028d2704f96ee8a54940e66d +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime.meta new file mode 100644 index 00000000..62594505 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b0a8db7f08e057741b3edc6fdcc231f2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Cabinet.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Cabinet.meta new file mode 100644 index 00000000..266853e6 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Cabinet.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8600259e1342b794eaaaae9de890bd63 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Cabinet/DTCabinetWearable.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Cabinet/DTCabinetWearable.cs similarity index 95% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Cabinet/DTCabinetWearable.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Cabinet/DTCabinetWearable.cs index 79ffe737..1dc02768 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Cabinet/DTCabinetWearable.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Cabinet/DTCabinetWearable.cs @@ -17,7 +17,7 @@ using UnityEngine; -namespace Chocopoi.DressingTools.Cabinet +namespace Chocopoi.DressingTools.Lib.Cabinet { public class DTCabinetWearable : DTBaseComponent { diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Cabinet/DTCabinetWearable.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Cabinet/DTCabinetWearable.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Cabinet/DTCabinetWearable.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Cabinet/DTCabinetWearable.cs.meta index b758da74..41ae98a9 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Cabinet/DTCabinetWearable.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Cabinet/DTCabinetWearable.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d51b161a7401b7445847764012bccf5c +guid: 471d592cf41b11345a6fefb36d8c933e MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Cabinet/ICabinet.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Cabinet/ICabinet.cs new file mode 100644 index 00000000..88ca3ad2 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Cabinet/ICabinet.cs @@ -0,0 +1,38 @@ +/* + * File: DTCabinet.cs + * Project: DressingTools + * Created Date: Thursday, August 10th 2023, 11:42:41 pm + * Author: chocopoi (poi@chocopoi.com) + * ----- + * Copyright (c) 2023 chocopoi + * + * This file is part of DressingTools. + * + * DressingTools is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * DressingTools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with DressingTools. If not, see . + */ + +using System; +using Chocopoi.DressingTools.Lib.Logging; +using UnityEngine; + +namespace Chocopoi.DressingTools.Lib.Cabinet +{ + public interface ICabinet + { + GameObject AvatarGameObject { get; set; } + + string AvatarArmatureName { get; set; } + + bool GroupDynamics { get; set; } + + bool GroupDynamicsSeparateGameObjects { get; set; } + + DTCabinetWearable[] GetWearables(); + + void Apply(DTReport report); + } +} diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/IWearableModule.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Cabinet/ICabinet.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/IWearableModule.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Cabinet/ICabinet.cs.meta index dff5f519..5a851696 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/IWearableModule.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Cabinet/ICabinet.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 890f961cff3481d42ba316a0a891a7e0 +guid: 8bdf5924eb3d1c84f958e049155d8c17 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/DTBaseComponent.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/DTBaseComponent.cs new file mode 100644 index 00000000..495aea87 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/DTBaseComponent.cs @@ -0,0 +1,31 @@ +/* + * File: DTBaseComponent.cs + * Project: DressingTools + * Created Date: Saturday, July 22nd 2023, 1:00:41 am + * Author: chocopoi (poi@chocopoi.com) + * ----- + * Copyright (c) 2023 chocopoi + * + * This file is part of DressingTools. + * + * DressingTools is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * DressingTools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with DressingTools. If not, see . + */ + +using UnityEngine; + +namespace Chocopoi.DressingTools.Lib +{ + [DefaultExecutionOrder(-9999)] +#if VRC_SDK_VRCSDK3 + // Add IEditorOnly to suppress the VRCSDK builder error + public abstract class DTBaseComponent : MonoBehaviour, VRC.SDKBase.IEditorOnly +#else + public class DTBaseComponent : MonoBehaviour +#endif + { + } +} diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/DTBaseComponent.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/DTBaseComponent.cs.meta new file mode 100644 index 00000000..3417c366 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/DTBaseComponent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 88b8ae5f7cc64af4c92c79313b6829e4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/DTLibRuntimeUtils.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/DTLibRuntimeUtils.cs new file mode 100644 index 00000000..306046f8 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/DTLibRuntimeUtils.cs @@ -0,0 +1,51 @@ +/* + * File: DTLibRuntimeUtils.cs + * Project: DressingTools + * Created Date: Saturday, August 20th 2023, 01:22:50 pm + * Author: chocopoi (poi@chocopoi.com) + * ----- + * Copyright (c) 2023 chocopoi + * + * This file is part of DressingTools. + * + * DressingTools is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * DressingTools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with DressingTools. If not, see . + */ + +using System.Collections.Generic; + +namespace Chocopoi.DressingTools.Lib +{ + internal static class DTLibRuntimeUtils + { + private static Dictionary s_reflectionTypeCache = new Dictionary(); + + public static System.Type FindType(string typeName) + { + // try getting from cache to avoid scanning the assemblies again + if (s_reflectionTypeCache.ContainsKey(typeName)) + { + return s_reflectionTypeCache[typeName]; + } + + // scan from assemblies and save to cache + var assemblies = System.AppDomain.CurrentDomain.GetAssemblies(); + + foreach (var assembly in assemblies) + { + var type = assembly.GetType(typeName); + if (type != null) + { + s_reflectionTypeCache[typeName] = type; + return type; + } + } + + // no such type found + return null; + } + } +} diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/DTLibRuntimeUtils.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/DTLibRuntimeUtils.cs.meta new file mode 100644 index 00000000..d6ae34c6 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/DTLibRuntimeUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 45ee6d63760333947a9547959d19bc15 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser.meta new file mode 100644 index 00000000..fc510b06 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 08ee63e3d49b1ee4fb85e080082e6483 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser/DTDresserSettings.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser/DTDresserSettings.cs new file mode 100644 index 00000000..fd61b440 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser/DTDresserSettings.cs @@ -0,0 +1,58 @@ +/* + * File: DTDresserSettings.cs + * Project: DressingTools + * Created Date: Saturday, July 22nd 2023, 12:36:56 am + * Author: chocopoi (poi@chocopoi.com) + * ----- + * Copyright (c) 2023 chocopoi + * + * This file is part of DressingTools. + * + * DressingTools is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * DressingTools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with DressingTools. If not, see . + */ + +using Newtonsoft.Json; +using UnityEditor; +using UnityEngine; + +namespace Chocopoi.DressingTools.Lib.Dresser +{ + public class DTDresserSettings + { + [JsonIgnore] + public GameObject targetAvatar; + + [JsonIgnore] + public GameObject targetWearable; + + [JsonIgnore] + public string avatarArmatureName; + + [JsonIgnore] + public string wearableArmatureName; + + public DTDresserSettings() + { + // default settings + avatarArmatureName = "Armature"; + wearableArmatureName = "Armature"; + } + +#if UNITY_EDITOR + public virtual bool DrawEditorGUI() + { + // draws the editor GUI and returns whether it is modified or not + var newWearableArmatureName = EditorGUILayout.DelayedTextField("Wearable Armature Name", wearableArmatureName); + + var modified = wearableArmatureName != newWearableArmatureName; + wearableArmatureName = newWearableArmatureName; + + return modified; + } +#endif + } +} diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser/DTDresserSettings.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser/DTDresserSettings.cs.meta new file mode 100644 index 00000000..a0bfbc89 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser/DTDresserSettings.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2744de798be974045b8189d841a38b4d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/IWearableModule.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser/IDTDresser.cs similarity index 62% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/IWearableModule.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser/IDTDresser.cs index 1ef68e33..c1d0b799 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/IWearableModule.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser/IDTDresser.cs @@ -1,5 +1,5 @@ /* - * File: DTWearableModuleBase.cs + * File: IDTDresser.cs * Project: DressingTools * Created Date: Tuesday, August 1st 2023, 12:37:10 am * Author: chocopoi (poi@chocopoi.com) @@ -15,21 +15,17 @@ * You should have received a copy of the GNU General Public License along with DressingTools. If not, see . */ -using System; using System.Collections.Generic; -using Chocopoi.DressingTools.Cabinet; -using Chocopoi.DressingTools.Logging; -using Chocopoi.DressingTools.Proxy; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using UnityEngine; +using Chocopoi.DressingTools.Lib.Logging; +using Chocopoi.DressingTools.Lib.Wearable; -namespace Chocopoi.DressingTools.Wearable.Modules +namespace Chocopoi.DressingTools.Lib.Dresser { - public interface IWearableModule + public interface IDTDresser { - int ApplyOrder { get; } - bool AllowMultiple { get; } - bool Apply(DTReport report, DTCabinet cabinet, List avatarDynamics, WearableConfig config, GameObject wearableGameObject); + string FriendlyName { get; } + DTDresserSettings DeserializeSettings(string serializedJson); + DTDresserSettings NewSettings(); + DTReport Execute(DTDresserSettings settings, out List boneMappings); } } diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser/IDTDresser.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser/IDTDresser.cs.meta new file mode 100644 index 00000000..50393b0a --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Dresser/IDTDresser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 87bc27946eea8e44fa92b239eb59c28c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Logging.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Logging.meta new file mode 100644 index 00000000..b022e775 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Logging.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 421061b94522a8c48b6fd15496cd094b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Logging/DTReport.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Logging/DTReport.cs similarity index 77% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Logging/DTReport.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Logging/DTReport.cs index 2170edef..ecff3017 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Logging/DTReport.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Logging/DTReport.cs @@ -19,7 +19,7 @@ using System.Collections.Generic; using UnityEngine; -namespace Chocopoi.DressingTools.Logging +namespace Chocopoi.DressingTools.Lib.Logging { [Serializable] public enum DTReportLogType @@ -43,8 +43,6 @@ public class DTReportLogEntry [Serializable] public class DTReport { - private static readonly Localization.I18n t = Localization.I18n.GetInstance(); - public List LogEntries { get; private set; } public DTReport() @@ -116,11 +114,6 @@ public void Log(DTReportLogType type, string label, string message, string code LogEntries.Add(new DTReportLogEntry() { type = type, label = label, code = code, message = message }); } - public void LogLocalized(DTReportLogType type, string label, string code, params object[] args) - { - Log(type, label, t._(code, args), code); - } - public void AppendReport(DTReport report) { LogEntries.AddRange(new List(report.LogEntries)); @@ -131,59 +124,29 @@ public void LogException(string label, Exception exception, string extraMessage LogError(label, extraMessage != null ? string.Format("{0}: {1}", extraMessage, exception.ToString()) : exception.ToString(), extraCode); } - public void LogExceptionLocalized(string label, Exception exception, string extraCode = null, params object[] args) - { - LogException(label, exception, t._(extraCode, args), extraCode); - } - public void LogError(string label, string message, string code = null) { Log(DTReportLogType.Error, label, message, code); } - public void LogErrorLocalized(string label, string code, params object[] args) - { - LogLocalized(DTReportLogType.Error, label, code, args); - } - public void LogInfo(string label, string message, string code = null) { Log(DTReportLogType.Info, label, message, code); } - public void LogInfoLocalized(string label, string code, params object[] args) - { - LogLocalized(DTReportLogType.Info, label, code, args); - } - public void LogWarn(string label, string message, string code = null) { Log(DTReportLogType.Warning, label, message, code); } - public void LogWarnLocalized(string label, string code, params object[] args) - { - LogLocalized(DTReportLogType.Warning, label, code, args); - } - public void LogDebug(string label, string message, string code = null) { Log(DTReportLogType.Debug, label, message, code); } - public void LogDebugLocalized(string label, string code, params object[] args) - { - LogLocalized(DTReportLogType.Debug, label, code, args); - } - public void LogTrace(string label, string message, string code = null) { Log(DTReportLogType.Trace, label, message, code); } - - public void LogTraceLocalized(string label, string code, params object[] args) - { - LogLocalized(DTReportLogType.Trace, label, code, args); - } } } diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Logging/DTReport.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Logging/DTReport.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Logging/DTReport.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Logging/DTReport.cs.meta index 1d431b7f..b6c65c32 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Logging/DTReport.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Logging/DTReport.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d77855be1f34755439a48a6c2c97adba +guid: 213b9f69c0e2f5a4886cae163e41cd02 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Proxy.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Proxy.meta new file mode 100644 index 00000000..e19d04e1 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Proxy.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dd75b76b8c4c6a54cba053a55d536cee +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Proxy/IDynamicsProxy.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Proxy/IDynamicsProxy.cs similarity index 96% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Proxy/IDynamicsProxy.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Proxy/IDynamicsProxy.cs index 16559c15..abd713a1 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Proxy/IDynamicsProxy.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Proxy/IDynamicsProxy.cs @@ -18,7 +18,7 @@ using System.Collections.Generic; using UnityEngine; -namespace Chocopoi.DressingTools.Proxy +namespace Chocopoi.DressingTools.Lib.Proxy { public interface IDynamicsProxy { diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Proxy/IDynamicsProxy.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Proxy/IDynamicsProxy.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Proxy/IDynamicsProxy.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Proxy/IDynamicsProxy.cs.meta index 49a48d2a..20ec9605 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Proxy/IDynamicsProxy.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Proxy/IDynamicsProxy.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 519c2a27fc9f34949ace0efaeb98cc3d +guid: b02b465da580b6642ab909eec1d68655 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable.meta new file mode 100644 index 00000000..d48d537d --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6b0f76e197be7344a807a7946bfc5104 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationBlendshapeSync.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationBlendshapeSync.cs similarity index 96% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationBlendshapeSync.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationBlendshapeSync.cs index d76ff23c..d59e1127 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationBlendshapeSync.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationBlendshapeSync.cs @@ -17,7 +17,7 @@ using System; -namespace Chocopoi.DressingTools.Wearable +namespace Chocopoi.DressingTools.Lib.Wearable { [Serializable] public class AnimationBlendshapeSync diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationBlendshapeSync.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationBlendshapeSync.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationBlendshapeSync.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationBlendshapeSync.cs.meta index 13eaaa64..a2157c6a 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationBlendshapeSync.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationBlendshapeSync.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 95dae872fa2e2ec49a9bc274e7416d3f +guid: e6b84834e9f059544a8f136e31bbfb50 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationBlendshapeValue.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationBlendshapeValue.cs similarity index 95% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationBlendshapeValue.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationBlendshapeValue.cs index c033d17d..61bd0118 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationBlendshapeValue.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationBlendshapeValue.cs @@ -17,7 +17,7 @@ using System; -namespace Chocopoi.DressingTools.Wearable +namespace Chocopoi.DressingTools.Lib.Wearable { [Serializable] public class AnimationBlendshapeValue diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationBlendshapeValue.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationBlendshapeValue.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationBlendshapeValue.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationBlendshapeValue.cs.meta index 19449486..54dee3dd 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationBlendshapeValue.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationBlendshapeValue.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 53c4a787cc35bf3409bdc779df570ff8 +guid: b9360524f457b414ca34c5d2f853390f MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationToggle.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationToggle.cs similarity index 95% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationToggle.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationToggle.cs index 52b55a6c..6eec7f93 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationToggle.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationToggle.cs @@ -17,7 +17,7 @@ using System; -namespace Chocopoi.DressingTools.Wearable +namespace Chocopoi.DressingTools.Lib.Wearable { [Serializable] public class AnimationToggle diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationToggle.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationToggle.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationToggle.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationToggle.cs.meta index 755989fa..ad88a859 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AnimationToggle.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AnimationToggle.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5a07458732954e94cb2466ba6416676c +guid: 6a0e042eff1c47244a4cdf65d7c6327e MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AvatarConfig.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AvatarConfig.cs similarity index 98% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AvatarConfig.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AvatarConfig.cs index 2a77a735..067411b2 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AvatarConfig.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AvatarConfig.cs @@ -19,7 +19,7 @@ using System.Collections.Generic; using UnityEngine; -namespace Chocopoi.DressingTools.Wearable +namespace Chocopoi.DressingTools.Lib.Wearable { // sadly, json.net cannot serialize unity vector3,quaternion well // creating custom classes as a workaround diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AvatarConfig.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AvatarConfig.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AvatarConfig.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AvatarConfig.cs.meta index b0a1eb26..c49e7d29 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/AvatarConfig.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/AvatarConfig.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 283f4a0001f24e342bc3bde3e301d08f +guid: 71ac1f84b4ef9ac43b3eb460754d2dd0 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/BoneMapping.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/BoneMapping.cs similarity index 97% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/BoneMapping.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/BoneMapping.cs index f6fe0787..12dc20f2 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/BoneMapping.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/BoneMapping.cs @@ -17,7 +17,7 @@ using System; -namespace Chocopoi.DressingTools.Wearable +namespace Chocopoi.DressingTools.Lib.Wearable { [Serializable] public enum BoneMappingType diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/BoneMapping.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/BoneMapping.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/BoneMapping.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/BoneMapping.cs.meta index e656f1cb..0fdfa21e 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/BoneMapping.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/BoneMapping.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3f2377c47aee32447b0979e8e2d140e8 +guid: 0251f9b22d32c7e4f904d1f78a817f9c MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Modules.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Modules.meta new file mode 100644 index 00000000..eb1f2f51 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Modules.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f027454dfcd7a3845b95de288e0d6cc1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/UnknownModule.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Modules/UnknownModule.cs similarity index 78% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/UnknownModule.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Modules/UnknownModule.cs index 28663db6..2f63024d 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/UnknownModule.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Modules/UnknownModule.cs @@ -16,14 +16,14 @@ */ using System.Collections.Generic; -using Chocopoi.DressingTools.Cabinet; -using Chocopoi.DressingTools.Logging; -using Chocopoi.DressingTools.Proxy; +using Chocopoi.DressingTools.Lib.Cabinet; +using Chocopoi.DressingTools.Lib.Logging; +using Chocopoi.DressingTools.Lib.Proxy; using UnityEngine; -namespace Chocopoi.DressingTools.Wearable.Modules +namespace Chocopoi.DressingTools.Lib.Wearable.Modules { - internal sealed class UnknownModule : WearableModuleBase + public sealed class UnknownModule : WearableModuleBase { public sealed override int ApplyOrder => int.MaxValue; @@ -44,7 +44,7 @@ public sealed override string Serialize() return rawJson; } - public sealed override bool Apply(DTReport report, DTCabinet cabinet, List avatarDynamics, WearableConfig config, GameObject wearableGameObject) + public sealed override bool Apply(DTReport report, ICabinet cabinet, List avatarDynamics, WearableConfig config, GameObject wearableGameObject) { return true; } diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/UnknownModule.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Modules/UnknownModule.cs.meta similarity index 100% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/UnknownModule.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Modules/UnknownModule.cs.meta diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/WearableModuleBase.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Modules/WearableModuleBase.cs similarity index 79% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/WearableModuleBase.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Modules/WearableModuleBase.cs index a77bb8fe..efc694d4 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/WearableModuleBase.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Modules/WearableModuleBase.cs @@ -17,22 +17,22 @@ using System; using System.Collections.Generic; -using Chocopoi.DressingTools.Cabinet; -using Chocopoi.DressingTools.Logging; -using Chocopoi.DressingTools.Proxy; +using Chocopoi.DressingTools.Lib.Cabinet; +using Chocopoi.DressingTools.Lib.Logging; +using Chocopoi.DressingTools.Lib.Proxy; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using UnityEngine; -namespace Chocopoi.DressingTools.Wearable.Modules +namespace Chocopoi.DressingTools.Lib.Wearable.Modules { internal class WearableModuleConverter : JsonConverter { private const string ModuleTypeKey = "$dtModuleType"; - public override bool CanConvert(Type objectType) => objectType == typeof(IWearableModule) || objectType == typeof(List); + public override bool CanConvert(Type objectType) => objectType == typeof(WearableModuleBase) || objectType == typeof(List); - private static JObject GetJsonWithModuleType(IWearableModule module) + private static JObject GetJsonWithModuleType(WearableModuleBase module) { var obj = JObject.FromObject(module); obj.AddFirst(new JProperty(ModuleTypeKey, module.GetType().FullName)); @@ -41,12 +41,12 @@ private static JObject GetJsonWithModuleType(IWearableModule module) public sealed override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - if (value is IWearableModule singleModule) + if (value is WearableModuleBase singleModule) { // single GetJsonWithModuleType(singleModule).WriteTo(writer); } - else if (value is List modules) + else if (value is List modules) { var arr = new JArray(); // array @@ -58,7 +58,7 @@ public sealed override void WriteJson(JsonWriter writer, object value, JsonSeria } } - private static IWearableModule GetModuleFromJson(JObject obj) + private static WearableModuleBase GetModuleFromJson(JObject obj) { if (!obj.ContainsKey(ModuleTypeKey)) { @@ -66,7 +66,7 @@ private static IWearableModule GetModuleFromJson(JObject obj) } string moduleTypeName = obj.Value(ModuleTypeKey); - var type = DTRuntimeUtils.FindType(moduleTypeName); + var type = DTLibRuntimeUtils.FindType(moduleTypeName); var rawJson = obj.ToString(Formatting.None); if (type == null) @@ -75,7 +75,7 @@ private static IWearableModule GetModuleFromJson(JObject obj) return new UnknownModule(moduleTypeName, rawJson); } - return (IWearableModule)JsonConvert.DeserializeObject(rawJson, type); + return (WearableModuleBase)JsonConvert.DeserializeObject(rawJson, type); } public sealed override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) @@ -89,7 +89,7 @@ public sealed override object ReadJson(JsonReader reader, Type objectType, objec else if (token.Type == JTokenType.Array) { var arr = (JArray)token; - var output = new List(); + var output = new List(); for (var i = 0; i < arr.Count; i++) { output.Add(GetModuleFromJson((JObject)arr[i])); @@ -101,7 +101,7 @@ public sealed override object ReadJson(JsonReader reader, Type objectType, objec } } - internal abstract class WearableModuleBase : IWearableModule + public abstract class WearableModuleBase { [JsonIgnore] public abstract int ApplyOrder { get; } @@ -114,7 +114,7 @@ public virtual string Serialize() return JsonConvert.SerializeObject(this, new WearableModuleConverter()); } - public abstract bool Apply(DTReport report, DTCabinet cabinet, List avatarDynamics, WearableConfig config, GameObject wearableGameObject); + public abstract bool Apply(DTReport report, ICabinet cabinet, List avatarDynamics, WearableConfig config, GameObject wearableGameObject); public override string ToString() { diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/WearableModuleBase.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Modules/WearableModuleBase.cs.meta similarity index 100% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/WearableModuleBase.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Modules/WearableModuleBase.cs.meta diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableAnimationPreset.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableAnimationPreset.cs similarity index 96% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableAnimationPreset.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableAnimationPreset.cs index b514db2a..390022e9 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableAnimationPreset.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableAnimationPreset.cs @@ -18,7 +18,7 @@ using System; using System.Collections.Generic; -namespace Chocopoi.DressingTools.Wearable +namespace Chocopoi.DressingTools.Lib.Wearable { [Serializable] public class AnimationPreset diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableAnimationPreset.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableAnimationPreset.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableAnimationPreset.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableAnimationPreset.cs.meta index 2f626fc2..c401c5dd 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableAnimationPreset.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableAnimationPreset.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4f414d801511259458ccf8838429872b +guid: 33fa0c7d9721a4b4ab0a26f5c24f5cdc MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableConfig.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableConfig.cs similarity index 93% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableConfig.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableConfig.cs index c9c0c7aa..6d8d2252 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableConfig.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableConfig.cs @@ -18,10 +18,10 @@ using System; using System.Collections.Generic; using System.Globalization; -using Chocopoi.DressingTools.Wearable.Modules; +using Chocopoi.DressingTools.Lib.Wearable.Modules; using Newtonsoft.Json; -namespace Chocopoi.DressingTools.Wearable +namespace Chocopoi.DressingTools.Lib.Wearable { public class WearableConfigMigrator { @@ -43,7 +43,7 @@ public class WearableConfig public AvatarConfig targetAvatarConfig; [JsonConverter(typeof(WearableModuleConverter))] - public List modules; + public List modules; public WearableConfig() { @@ -56,7 +56,7 @@ public WearableConfig() updatedTime = isoTimeStr }; targetAvatarConfig = new AvatarConfig(); - modules = new List(); + modules = new List(); } public bool HasUnknownModules() diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableConfig.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableConfig.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableConfig.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableConfig.cs.meta index 7ba04a2b..b56e03bc 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableConfig.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableConfig.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6e700538f5415d441860205ccf9743db +guid: c551e4e60dd12d1438f75dd124638fd9 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableCustomizable.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableCustomizable.cs similarity index 97% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableCustomizable.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableCustomizable.cs index 802e7b4a..9d97a5b4 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableCustomizable.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableCustomizable.cs @@ -18,7 +18,7 @@ using System; using System.Collections.Generic; -namespace Chocopoi.DressingTools.Wearable +namespace Chocopoi.DressingTools.Lib.Wearable { [Serializable] public enum WearableCustomizableType diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableCustomizable.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableCustomizable.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableCustomizable.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableCustomizable.cs.meta index f308e1de..d9be2c48 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableCustomizable.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableCustomizable.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8bea2fea7ccfd5a42b55db7bef5d0efe +guid: 1ec4849e57aa9a2428a1b90cc40bb94b MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableInfo.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableInfo.cs similarity index 97% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableInfo.cs rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableInfo.cs index c4ec41c8..772a34f4 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableInfo.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableInfo.cs @@ -17,7 +17,7 @@ using System; -namespace Chocopoi.DressingTools.Wearable +namespace Chocopoi.DressingTools.Lib.Wearable { [Serializable] public class WearableInfo diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableInfo.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableInfo.cs.meta similarity index 83% rename from Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableInfo.cs.meta rename to Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableInfo.cs.meta index 90a544ac..657c7a9d 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/WearableInfo.cs.meta +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableInfo.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6086689a2d88aed4d90517affa89ded2 +guid: e6a03c3726192e745a6e8b7b4e95f61e MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/com.chocopoi.vrc.dressingtools.api.Runtime.asmdef b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/com.chocopoi.vrc.dressingtools.api.Runtime.asmdef new file mode 100644 index 00000000..9b1c8454 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/com.chocopoi.vrc.dressingtools.api.Runtime.asmdef @@ -0,0 +1,16 @@ +{ + "name": "com.chocopoi.vrc.dressingtools.api.Runtime", + "references": [], + "includePlatforms": [ + "Editor", + "WindowsStandalone64" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/com.chocopoi.vrc.dressingtools.api.Runtime.asmdef.meta b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/com.chocopoi.vrc.dressingtools.api.Runtime.asmdef.meta new file mode 100644 index 00000000..caff16c7 --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/com.chocopoi.vrc.dressingtools.api.Runtime.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dcaf16fd99f37914888e6e13bdf533ea +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Cabinet/CabinetApplier.cs b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Cabinet/CabinetApplier.cs index c392cbb4..c21240d9 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Cabinet/CabinetApplier.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Cabinet/CabinetApplier.cs @@ -16,10 +16,11 @@ */ using System.Collections.Generic; +using Chocopoi.DressingTools.Lib.Logging; +using Chocopoi.DressingTools.Lib.Proxy; +using Chocopoi.DressingTools.Lib.Wearable; +using Chocopoi.DressingTools.Lib.Wearable.Modules; using Chocopoi.DressingTools.Logging; -using Chocopoi.DressingTools.Proxy; -using Chocopoi.DressingTools.Wearable; -using Chocopoi.DressingTools.Wearable.Modules; using Newtonsoft.Json; using UnityEngine; @@ -60,14 +61,14 @@ public CabinetApplier(DTReport report, DTCabinet cabinet) private void ApplyTransforms(AvatarConfig avatarConfig, GameObject targetWearable, out Transform lastAvatarParent, out Vector3 lastAvatarScale) { - var targetAvatar = _cabinet.avatarGameObject; + var targetAvatar = _cabinet.AvatarGameObject; // check position delta and adjust { var wearableWorldPos = avatarConfig.worldPosition.ToVector3(); if (targetWearable.transform.position - targetAvatar.transform.position != wearableWorldPos) { - _report.LogInfoLocalized(LogLabel, MessageCode.AdjustedWearablePositionFromDelta, wearableWorldPos.ToString()); + DTReportUtils.LogInfoLocalized(_report, LogLabel, MessageCode.AdjustedWearablePositionFromDelta, wearableWorldPos.ToString()); targetWearable.transform.position += wearableWorldPos; } } @@ -77,24 +78,24 @@ private void ApplyTransforms(AvatarConfig avatarConfig, GameObject targetWearabl var wearableWorldRot = avatarConfig.worldRotation.ToQuaternion(); if (targetWearable.transform.rotation * Quaternion.Inverse(targetAvatar.transform.rotation) != wearableWorldRot) { - _report.LogInfoLocalized(LogLabel, MessageCode.AdjustedWearableRotationFromDelta, wearableWorldRot.ToString()); + DTReportUtils.LogInfoLocalized(_report, LogLabel, MessageCode.AdjustedWearableRotationFromDelta, wearableWorldRot.ToString()); targetWearable.transform.rotation *= wearableWorldRot; } } // apply avatar scale - lastAvatarParent = _cabinet.avatarGameObject.transform.parent; + lastAvatarParent = _cabinet.AvatarGameObject.transform.parent; lastAvatarScale = Vector3.zero + targetAvatar.transform.localScale; if (lastAvatarParent != null) { // tricky workaround to apply lossy world scale is to unparent - _cabinet.avatarGameObject.transform.SetParent(null); + _cabinet.AvatarGameObject.transform.SetParent(null); } var avatarScaleVec = avatarConfig.avatarLossyScale.ToVector3(); if (targetAvatar.transform.localScale != avatarScaleVec) { - _report.LogInfoLocalized(LogLabel, MessageCode.AdjustedAvatarScale, avatarScaleVec.ToString()); + DTReportUtils.LogInfoLocalized(_report, LogLabel, MessageCode.AdjustedAvatarScale, avatarScaleVec.ToString()); targetAvatar.transform.localScale = avatarScaleVec; } @@ -102,7 +103,7 @@ private void ApplyTransforms(AvatarConfig avatarConfig, GameObject targetWearabl var wearableScaleVec = avatarConfig.wearableLossyScale.ToVector3(); if (targetWearable.transform.localScale != wearableScaleVec) { - _report.LogInfoLocalized(LogLabel, MessageCode.AdjustedWearableScale, wearableScaleVec.ToString()); + DTReportUtils.LogInfoLocalized(_report, LogLabel, MessageCode.AdjustedWearableScale, wearableScaleVec.ToString()); targetWearable.transform.localScale = wearableScaleVec; } } @@ -112,9 +113,9 @@ private void RollbackTransform(Transform lastAvatarParent, Vector3 lastAvatarSca // restore avatar scale if (lastAvatarParent != null) { - _cabinet.avatarGameObject.transform.SetParent(lastAvatarParent); + _cabinet.AvatarGameObject.transform.SetParent(lastAvatarParent); } - _cabinet.avatarGameObject.transform.localScale = lastAvatarScale; + _cabinet.AvatarGameObject.transform.localScale = lastAvatarScale; } private void CopyDynamicsToContainer(IDynamicsProxy dynamics, GameObject dynamicsContainer) @@ -149,7 +150,7 @@ private void GroupDynamics(GameObject wearableGameObject, List w dynamicsContainer = obj.transform; } - if (_cabinet.groupDynamicsSeparateGameObjects) + if (_cabinet.GroupDynamicsSeparateGameObjects) { // group them in separate GameObjects var addedNames = new Dictionary(); @@ -186,14 +187,14 @@ private void GroupDynamics(GameObject wearableGameObject, List w private bool ApplyWearable(WearableConfig config, GameObject wearableGameObject) { GameObject wearableObj; - if (DTRuntimeUtils.IsGrandParent(_cabinet.avatarGameObject.transform, wearableGameObject.transform)) + if (DTRuntimeUtils.IsGrandParent(_cabinet.AvatarGameObject.transform, wearableGameObject.transform)) { wearableObj = wearableGameObject; } else { // instantiate wearable prefab and parent to avatar - wearableObj = Object.Instantiate(wearableGameObject, _cabinet.avatarGameObject.transform); + wearableObj = Object.Instantiate(wearableGameObject, _cabinet.AvatarGameObject.transform); } // scan for wearable dynamics @@ -203,7 +204,7 @@ private bool ApplyWearable(WearableConfig config, GameObject wearableGameObject) ApplyTransforms(config.targetAvatarConfig, wearableObj, out var lastAvatarParent, out var lastAvatarScale); // sort modules according to their apply order - var modules = new List(config.modules); + var modules = new List(config.modules); modules.Sort((m1, m2) => m1.ApplyOrder.CompareTo(m2.ApplyOrder)); // do module apply @@ -211,13 +212,13 @@ private bool ApplyWearable(WearableConfig config, GameObject wearableGameObject) { if (!module.Apply(_report, _cabinet, _avatarDynamics, config, wearableGameObject)) { - _report.LogErrorLocalized(LogLabel, MessageCode.ApplyingModuleHasErrors); + DTReportUtils.LogErrorLocalized(_report, LogLabel, MessageCode.ApplyingModuleHasErrors); return false; } } // group dynamics - if (_cabinet.groupDynamics) + if (_cabinet.GroupDynamics) { GroupDynamics(wearableGameObject, wearableDynamics); } @@ -230,7 +231,7 @@ private bool ApplyWearable(WearableConfig config, GameObject wearableGameObject) public void Execute() { // scan for avatar dynamics - _avatarDynamics = DTRuntimeUtils.ScanDynamics(_cabinet.avatarGameObject); + _avatarDynamics = DTRuntimeUtils.ScanDynamics(_cabinet.AvatarGameObject); var wearables = _cabinet.GetWearables(); foreach (var wearable in wearables) @@ -241,7 +242,7 @@ public void Execute() // Migration if (config.configVersion > WearableConfig.CurrentConfigVersion) { - _report.LogErrorLocalized(LogLabel, MessageCode.IncompatibleConfigVersion); + DTReportUtils.LogErrorLocalized(_report, LogLabel, MessageCode.IncompatibleConfigVersion); break; } else if (config.configVersion < WearableConfig.CurrentConfigVersion) @@ -249,7 +250,7 @@ public void Execute() var result = WearableConfigMigrator.Migrate(wearable.configJson, out var migratedJson); if (!result) { - _report.LogErrorLocalized(LogLabel, MessageCode.ConfigMigrationFailed); + DTReportUtils.LogErrorLocalized(_report, LogLabel, MessageCode.ConfigMigrationFailed); break; } wearable.configJson = migratedJson; @@ -258,13 +259,13 @@ public void Execute() if (config == null) { - _report.LogErrorLocalized(LogLabel, MessageCode.UnableToDeserializeConfig); + DTReportUtils.LogErrorLocalized(_report, LogLabel, MessageCode.UnableToDeserializeConfig); continue; } if (!ApplyWearable(config, wearable.wearableGameObject)) { - _report.LogErrorLocalized(LogLabel, MessageCode.ApplyingWearableHasErrors, config.info.name); + DTReportUtils.LogErrorLocalized(_report, LogLabel, MessageCode.ApplyingWearableHasErrors, config.info.name); break; } } diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Cabinet/DTCabinet.cs b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Cabinet/DTCabinet.cs index f75e4da0..6b74a6d4 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Cabinet/DTCabinet.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Cabinet/DTCabinet.cs @@ -16,6 +16,8 @@ */ using System; +using Chocopoi.DressingTools.Lib.Cabinet; +using Chocopoi.DressingTools.Lib.Logging; using Chocopoi.DressingTools.Logging; using UnityEngine; @@ -23,30 +25,31 @@ namespace Chocopoi.DressingTools.Cabinet { [AddComponentMenu("DressingTools/DT Cabinet")] [DefaultExecutionOrder(-19999)] - public class DTCabinet : DTBaseComponent + public class DTCabinet : DTBaseComponent, ICabinet { private const string LogLabel = "DTCabinet"; - public GameObject avatarGameObject; - - public string avatarArmatureName; - - public bool groupDynamics; - - public bool groupDynamicsSeparateGameObjects; + [field: SerializeField] public GameObject AvatarGameObject { get; set; } + [field: SerializeField] public string AvatarArmatureName { get; set; } + [field: SerializeField] public bool GroupDynamics { get; set; } + [field: SerializeField] public bool GroupDynamicsSeparateGameObjects { get; set; } public DTCabinet() { // TOOD: Read default settings? - avatarGameObject = null; - avatarArmatureName = "Armature"; - groupDynamics = true; - groupDynamicsSeparateGameObjects = true; + AvatarGameObject = null; + AvatarArmatureName = "Armature"; + GroupDynamics = true; + GroupDynamicsSeparateGameObjects = true; } public DTCabinetWearable[] GetWearables() { - return avatarGameObject.GetComponentsInChildren(); + if (AvatarGameObject == null) + { + return new DTCabinetWearable[0]; + } + return AvatarGameObject.GetComponentsInChildren(); } public void Apply(DTReport report) @@ -57,7 +60,7 @@ public void Apply(DTReport report) } catch (Exception ex) { - report.LogExceptionLocalized(LogLabel, ex, "cabinet.apply.msgCode.hasException"); + DTReportUtils.LogExceptionLocalized(report, LogLabel, ex, "cabinet.apply.msgCode.hasException"); } } diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/DTRuntimeUtils.cs b/Packages/com.chocopoi.vrc.dressingtools/Runtime/DTRuntimeUtils.cs index 83ad5e61..3b9ecc41 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/DTRuntimeUtils.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Runtime/DTRuntimeUtils.cs @@ -20,15 +20,15 @@ using System.IO; using System.Linq; using System.Reflection; -using System.Runtime.Serialization.Formatters; +using Chocopoi.DressingTools.Lib.Proxy; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.Proxy; -using Chocopoi.DressingTools.Wearable; using Newtonsoft.Json; using UnityEngine; namespace Chocopoi.DressingTools { - internal class DTRuntimeUtils + internal static class DTRuntimeUtils { private const string BoneNameMappingsPath = "Packages/com.chocopoi.vrc.dressingtools/Resources/boneNameMappings.json"; diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Dresser/Default/DefaultDresser.cs b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Dresser/Default/DefaultDresser.cs index 082821ab..d2064946 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Dresser/Default/DefaultDresser.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Dresser/Default/DefaultDresser.cs @@ -18,6 +18,8 @@ using System.Collections.Generic; using Chocopoi.DressingTools.Dresser.Default; using Chocopoi.DressingTools.Dresser.Default.Hooks; +using Chocopoi.DressingTools.Lib.Logging; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.Logging; using Chocopoi.DressingTools.Wearable; using Newtonsoft.Json; @@ -75,14 +77,14 @@ public DTReport Execute(DTDresserSettings settings, out List boneMa if (!(settings is DefaultDresserSettings)) { - report.LogErrorLocalized(LogLabel, MessageCode.NotDefaultSettingsSettings); + DTReportUtils.LogErrorLocalized(report, LogLabel, MessageCode.NotDefaultSettingsSettings); return report; } // Reject null target avatar/wearable settings if (settings.targetAvatar == null || settings.targetWearable == null) { - report.LogErrorLocalized(LogLabel, MessageCode.NullAvatarOrWearable); + DTReportUtils.LogErrorLocalized(report, LogLabel, MessageCode.NullAvatarOrWearable); return report; } @@ -94,7 +96,7 @@ public DTReport Execute(DTDresserSettings settings, out List boneMa if (!hook.Evaluate(report, settings, boneMappings)) { // hook error and do not continue - report.LogErrorLocalized(LogLabel, MessageCode.HookHasErrors, hook.GetType().Name); + DTReportUtils.LogErrorLocalized(report, LogLabel, MessageCode.HookHasErrors, hook.GetType().Name); boneMappings = null; return report; } diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Dresser/Default/Hooks/ArmatureHook.cs b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Dresser/Default/Hooks/ArmatureHook.cs index 03a941f4..cd8143d4 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Dresser/Default/Hooks/ArmatureHook.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Dresser/Default/Hooks/ArmatureHook.cs @@ -16,9 +16,10 @@ */ using System.Collections.Generic; +using Chocopoi.DressingTools.Lib.Logging; +using Chocopoi.DressingTools.Lib.Proxy; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.Logging; -using Chocopoi.DressingTools.Proxy; -using Chocopoi.DressingTools.Wearable; using UnityEngine; namespace Chocopoi.DressingTools.Dresser.Default.Hooks @@ -83,7 +84,7 @@ private static void ProcessBone(DTReport report, DefaultDresserSettings settings } else { - report.LogInfoLocalized(DefaultDresser.LogLabel, DefaultDresser.MessageCode.NonMatchingWearableBoneKeptUntouched); + DTReportUtils.LogInfoLocalized(report, DefaultDresser.LogLabel, DefaultDresser.MessageCode.NonMatchingWearableBoneKeptUntouched); } } else @@ -126,7 +127,7 @@ private static void ProcessBone(DTReport report, DefaultDresserSettings settings } else if (settings.dynamicsOption == DefaultDresserDynamicsOption.IgnoreAll) //ignore all { - report.LogInfoLocalized(DefaultDresser.LogLabel, DefaultDresser.MessageCode.DynamicBoneAllIgnored); + DTReportUtils.LogInfoLocalized(report, DefaultDresser.LogLabel, DefaultDresser.MessageCode.DynamicBoneAllIgnored); boneMappings.Add(new BoneMapping() { mappingType = BoneMappingType.DoNothing, @@ -176,11 +177,11 @@ public bool Evaluate(DTReport report, DTDresserSettings settings, List 1) { - report.LogWarnLocalized(DefaultDresser.LogLabel, DefaultDresser.MessageCode.MultipleBonesInWearableArmatureFirstLevel); + DTReportUtils.LogWarnLocalized(report, DefaultDresser.LogLabel, DefaultDresser.MessageCode.MultipleBonesInWearableArmatureFirstLevel); } // Scan dynamics diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Dresser/Default/Hooks/NoMissingScriptsHook.cs b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Dresser/Default/Hooks/NoMissingScriptsHook.cs index 3704ecb6..f00bedd3 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Dresser/Default/Hooks/NoMissingScriptsHook.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Dresser/Default/Hooks/NoMissingScriptsHook.cs @@ -16,8 +16,9 @@ */ using System.Collections.Generic; +using Chocopoi.DressingTools.Lib.Logging; +using Chocopoi.DressingTools.Lib.Wearable; using Chocopoi.DressingTools.Logging; -using Chocopoi.DressingTools.Wearable; using UnityEngine; namespace Chocopoi.DressingTools.Dresser.Default.Hooks @@ -32,7 +33,7 @@ public bool ScanGameObject(DTReport report, string errorCode, GameObject gameObj { if (components[i] == null) { - report.LogErrorLocalized(DefaultDresser.LogLabel, errorCode, gameObject.name); + DTReportUtils.LogErrorLocalized(report, DefaultDresser.LogLabel, errorCode, gameObject.name); return false; } } @@ -55,7 +56,7 @@ public bool Evaluate(DTReport report, DTDresserSettings settings, List false; - public override bool Apply(DTReport report, DTCabinet cabinet, List avatarDynamics, WearableConfig config, GameObject wearableGameObject) + public override bool Apply(DTReport report, ICabinet cabinet, List avatarDynamics, WearableConfig config, GameObject wearableGameObject) { #if !VRC_SDK_VRCSDK3 - report.LogWarnLocalized(LogLabel, MessageCode.IgnoredNoVRCSDK); + DTReportUtils.LogWarnLocalized(report, LogLabel, MessageCode.IgnoredNoVRCSDK); #endif return true; } diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Logging/DTReportUtils.cs b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Logging/DTReportUtils.cs new file mode 100644 index 00000000..6d7066fc --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Logging/DTReportUtils.cs @@ -0,0 +1,63 @@ +/* + * File: DTReport.cs + * Project: DressingTools + * Created Date: Thursday, August 10th 2023, 11:42:41 pm + * Author: chocopoi (poi@chocopoi.com) + * ----- + * Copyright (c) 2023 chocopoi + * + * This file is part of DressingTools. + * + * DressingTools is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * DressingTools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with DressingTools. If not, see . + */ + +using System; +using Chocopoi.DressingTools.Lib.Logging; + +namespace Chocopoi.DressingTools.Logging +{ + [Serializable] + public static class DTReportUtils + { + private static readonly Localization.I18n t = Localization.I18n.GetInstance(); + + public static void LogLocalized(DTReport report, DTReportLogType type, string label, string code, params object[] args) + { + report.Log(type, label, t._(code, args), code); + } + + public static void LogExceptionLocalized(DTReport report, string label, Exception exception, string extraCode = null, params object[] args) + { + report.LogException(label, exception, t._(extraCode, args), extraCode); + } + + public static void LogErrorLocalized(DTReport report, string label, string code, params object[] args) + { + LogLocalized(report, DTReportLogType.Error, label, code, args); + } + + public static void LogInfoLocalized(DTReport report, string label, string code, params object[] args) + { + LogLocalized(report, DTReportLogType.Info, label, code, args); + } + + public static void LogWarnLocalized(DTReport report, string label, string code, params object[] args) + { + LogLocalized(report, DTReportLogType.Warning, label, code, args); + } + + public static void LogDebugLocalized(DTReport report, string label, string code, params object[] args) + { + LogLocalized(report, DTReportLogType.Debug, label, code, args); + } + + public static void LogTraceLocalized(DTReport report, string label, string code, params object[] args) + { + LogLocalized(report, DTReportLogType.Trace, label, code, args); + } + } +} diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Logging/DTReportUtils.cs.meta b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Logging/DTReportUtils.cs.meta new file mode 100644 index 00000000..5c5798cf --- /dev/null +++ b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Logging/DTReportUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0c27558cb548e3a4dada4c8be7cc9180 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Proxy/DynamicBoneProxy.cs b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Proxy/DynamicBoneProxy.cs index 5663cca4..7ce9a1fa 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Proxy/DynamicBoneProxy.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Proxy/DynamicBoneProxy.cs @@ -16,6 +16,7 @@ */ using System.Collections.Generic; +using Chocopoi.DressingTools.Lib.Proxy; using UnityEngine; namespace Chocopoi.DressingTools.Proxy diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Proxy/PhysBoneProxy.cs b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Proxy/PhysBoneProxy.cs index 065cc02b..53e6416f 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Proxy/PhysBoneProxy.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Proxy/PhysBoneProxy.cs @@ -16,6 +16,7 @@ */ using System.Collections.Generic; +using Chocopoi.DressingTools.Lib.Proxy; using UnityEngine; namespace Chocopoi.DressingTools.Proxy diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/AnimationGenerationModule.cs b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/AnimationGenerationModule.cs index d5ec6bc7..969b6228 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/AnimationGenerationModule.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/AnimationGenerationModule.cs @@ -16,9 +16,11 @@ */ using System.Collections.Generic; -using Chocopoi.DressingTools.Cabinet; -using Chocopoi.DressingTools.Logging; -using Chocopoi.DressingTools.Proxy; +using Chocopoi.DressingTools.Lib.Cabinet; +using Chocopoi.DressingTools.Lib.Logging; +using Chocopoi.DressingTools.Lib.Proxy; +using Chocopoi.DressingTools.Lib.Wearable; +using Chocopoi.DressingTools.Lib.Wearable.Modules; using UnityEngine; namespace Chocopoi.DressingTools.Wearable.Modules @@ -48,7 +50,7 @@ public AnimationGenerationModule() wearableCustomizables = new List(); } - public override bool Apply(DTReport report, DTCabinet cabinet, List avatarDynamics, WearableConfig config, GameObject wearableGameObject) + public override bool Apply(DTReport report, ICabinet cabinet, List avatarDynamics, WearableConfig config, GameObject wearableGameObject) { return true; } diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/ArmatureMappingModule.cs b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/ArmatureMappingModule.cs index 8662a7a9..2c811dfc 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/ArmatureMappingModule.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/ArmatureMappingModule.cs @@ -19,6 +19,11 @@ using System.Linq; using Chocopoi.DressingTools.Cabinet; using Chocopoi.DressingTools.Dresser; +using Chocopoi.DressingTools.Lib.Cabinet; +using Chocopoi.DressingTools.Lib.Logging; +using Chocopoi.DressingTools.Lib.Proxy; +using Chocopoi.DressingTools.Lib.Wearable; +using Chocopoi.DressingTools.Lib.Wearable.Modules; using Chocopoi.DressingTools.Logging; using Chocopoi.DressingTools.Proxy; using UnityEngine; @@ -100,7 +105,7 @@ private bool GenerateMappings(DTReport report, string avatarArmatureName, string // abort on error if (dresserReport.HasLogType(DTReportLogType.Error)) { - report.LogErrorLocalized(LogLabel, MessageCode.DresserHasErrors, wearableName); + DTReportUtils.LogErrorLocalized(report, LogLabel, MessageCode.DresserHasErrors, wearableName); return false; } @@ -277,7 +282,7 @@ private bool ApplyBoneMappings(DTReport report, string wearableName, List s[random.Next(s.Length)]).ToArray()); } - public override bool Apply(DTReport report, DTCabinet cabinet, List avatarDynamics, WearableConfig config, GameObject wearableGameObject) + public override bool Apply(DTReport report, ICabinet cabinet, List avatarDynamics, WearableConfig config, GameObject wearableGameObject) { // scan for wearable dynamics var wearableDynamics = DTRuntimeUtils.ScanDynamics(wearableGameObject); - if (!GenerateMappings(report, cabinet.avatarArmatureName, config.info.name, cabinet.avatarGameObject, wearableGameObject, out var boneMappings)) + if (!GenerateMappings(report, cabinet.AvatarArmatureName, config.info.name, cabinet.AvatarGameObject, wearableGameObject, out var boneMappings)) { - report.LogErrorLocalized(LogLabel, MessageCode.MappingGenerationHasErrors); + DTReportUtils.LogErrorLocalized(report, LogLabel, MessageCode.MappingGenerationHasErrors); return false; } var generatedName = string.Format("{0}-{1}", config.info.name, RandomString(32)); - if (!ApplyBoneMappings(report, generatedName, avatarDynamics, wearableDynamics, boneMappings, cabinet.avatarGameObject.transform, wearableGameObject.transform, wearableGameObject.transform, "")) + if (!ApplyBoneMappings(report, generatedName, avatarDynamics, wearableDynamics, boneMappings, cabinet.AvatarGameObject.transform, wearableGameObject.transform, wearableGameObject.transform, "")) { - report.LogErrorLocalized(LogLabel, MessageCode.ApplyingBoneMappingHasErrors); + DTReportUtils.LogErrorLocalized(report, LogLabel, MessageCode.ApplyingBoneMappingHasErrors); return false; } diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/BlendshapeSyncModule.cs b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/BlendshapeSyncModule.cs index aa04bf11..dc65e374 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/BlendshapeSyncModule.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/BlendshapeSyncModule.cs @@ -16,9 +16,11 @@ */ using System.Collections.Generic; -using Chocopoi.DressingTools.Cabinet; -using Chocopoi.DressingTools.Logging; -using Chocopoi.DressingTools.Proxy; +using Chocopoi.DressingTools.Lib.Cabinet; +using Chocopoi.DressingTools.Lib.Logging; +using Chocopoi.DressingTools.Lib.Proxy; +using Chocopoi.DressingTools.Lib.Wearable; +using Chocopoi.DressingTools.Lib.Wearable.Modules; using UnityEngine; namespace Chocopoi.DressingTools.Wearable.Modules @@ -42,7 +44,7 @@ public BlendshapeSyncModule() blendshapeSyncs = new List(); } - public override bool Apply(DTReport report, DTCabinet cabinet, List avatarDynamics, WearableConfig config, GameObject wearableGameObject) + public override bool Apply(DTReport report, ICabinet cabinet, List avatarDynamics, WearableConfig config, GameObject wearableGameObject) { return true; } diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/MoveRootModule.cs b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/MoveRootModule.cs index fc0300f9..3af068bc 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/MoveRootModule.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Runtime/Wearable/Modules/MoveRootModule.cs @@ -16,9 +16,11 @@ */ using System.Collections.Generic; -using Chocopoi.DressingTools.Cabinet; -using Chocopoi.DressingTools.Logging; -using Chocopoi.DressingTools.Proxy; +using Chocopoi.DressingTools.Lib.Cabinet; +using Chocopoi.DressingTools.Lib.Logging; +using Chocopoi.DressingTools.Lib.Proxy; +using Chocopoi.DressingTools.Lib.Wearable; +using Chocopoi.DressingTools.Lib.Wearable.Modules; using UnityEngine; namespace Chocopoi.DressingTools.Wearable.Modules @@ -37,7 +39,7 @@ public static class MessageCode public string avatarPath; - public override bool Apply(DTReport report, DTCabinet cabinet, List avatarDynamics, WearableConfig config, GameObject wearableGameObject) + public override bool Apply(DTReport report, ICabinet cabinet, List avatarDynamics, WearableConfig config, GameObject wearableGameObject) { return true; } diff --git a/Packages/com.chocopoi.vrc.dressingtools/Runtime/com.chocopoi.vrc.dressingtools.Runtime.asmdef b/Packages/com.chocopoi.vrc.dressingtools/Runtime/com.chocopoi.vrc.dressingtools.Runtime.asmdef index dc65052f..6e7e94d9 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Runtime/com.chocopoi.vrc.dressingtools.Runtime.asmdef +++ b/Packages/com.chocopoi.vrc.dressingtools/Runtime/com.chocopoi.vrc.dressingtools.Runtime.asmdef @@ -1,6 +1,8 @@ { "name": "com.chocopoi.vrc.dressingtools.Runtime", - "references": [], + "references": [ + "GUID:dcaf16fd99f37914888e6e13bdf533ea" + ], "includePlatforms": [ "Editor", "WindowsStandalone64"