From 40586947ea14daed8cde8f7e7c8b7687f0d0aa6c Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 14 Oct 2023 17:45:36 +0900 Subject: [PATCH 1/2] feat: Satania's Kisetene compatibility --- .../ComponentDependencyCollector.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Editor/Processors/TraceAndOptimize/ComponentDependencyCollector.cs b/Editor/Processors/TraceAndOptimize/ComponentDependencyCollector.cs index 734ad1ef6..267eea55f 100644 --- a/Editor/Processors/TraceAndOptimize/ComponentDependencyCollector.cs +++ b/Editor/Processors/TraceAndOptimize/ComponentDependencyCollector.cs @@ -590,10 +590,38 @@ void CollectTransforms(Transform bone) _byTypeParser.Add(contextHolder, (collector, deps, component) => deps.EntrypointComponent = true); } + #region Satania's Kisetene Components + + // KiseteneComponent holds information about which cloth the bone came from, which is not important on build + var kiseteneComponent = GetTypeByGuidFileId("e78466b6bcd24e5409dca557eb81d45b", 11500000); + if (kiseteneComponent != null) + _byTypeParser.Add(kiseteneComponent, (collector, deps, component) => deps.EntrypointComponent = true); + + // FlyAvatarSetupTool is on-inspector tool which is not important on build + var flyAvatarSetupTool = GetTypeByGuidFileId("7f9c3fe1cfb9d1843a9dc7da26352ce2", 11500000); + if (flyAvatarSetupTool != null) + _byTypeParser.Add(flyAvatarSetupTool, (collector, deps, component) => deps.EntrypointComponent = true); + + // BlendShapeOverrider is on-inspector tool which is not important on build + var blendShapeOverrider = GetTypeByGuidFileId("95f6e1368d803614f8a351322ab09bac", 11500000); + if (blendShapeOverrider != null) + _byTypeParser.Add(blendShapeOverrider, (collector, deps, component) => deps.EntrypointComponent = true); + + #endregion + + // Components Proceed after T&O later AddEntryPointParser(); } + private static Type GetTypeByGuidFileId(string guid, long fileId) + { + if (!GlobalObjectId.TryParse($"GlobalObjectId_V1-1-{guid}-{fileId}-0", out var id)) return null; + var script = GlobalObjectId.GlobalObjectIdentifierToObjectSlow(id) as MonoScript; + if (!script) return null; + return script.GetClass(); + } + #endregion } } From 83fc5ac607f53aa0d81345852f3ad397445b0e11 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 14 Oct 2023 19:38:53 +0900 Subject: [PATCH 2/2] docs(changelog): Add compatibility for Satania's KiseteneEx --- CHANGELOG-PRERELEASE.md | 1 + CHANGELOG.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG-PRERELEASE.md b/CHANGELOG-PRERELEASE.md index 4787ab251..7c4db1c81 100644 --- a/CHANGELOG-PRERELEASE.md +++ b/CHANGELOG-PRERELEASE.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog]. ## [Unreleased] ### Added +- Add compatibility for Satania's KiseteneEx `#584` ### Changed diff --git a/CHANGELOG.md b/CHANGELOG.md index 72b0c5c87..649636b5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog]. ## [Unreleased] ### Added +- Add compatibility for Satania's KiseteneEx `#584` ### Changed