diff --git a/Editor/Configurator/Avatar/AvatarProvider.cs b/Editor/Configurator/Avatar/AvatarProvider.cs deleted file mode 100644 index d529c89f..00000000 --- a/Editor/Configurator/Avatar/AvatarProvider.cs +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2024 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 DressingFramework. If not, see . - */ - -namespace Chocopoi.DressingTools.Configurator.Avatar -{ - internal class AvatarProvider - { - } -} diff --git a/Editor/Configurator/Avatar/IAvatarProvider.cs b/Editor/Configurator/Avatar/AvatarUtils.cs similarity index 53% rename from Editor/Configurator/Avatar/IAvatarProvider.cs rename to Editor/Configurator/Avatar/AvatarUtils.cs index 6e511b19..95375460 100644 --- a/Editor/Configurator/Avatar/IAvatarProvider.cs +++ b/Editor/Configurator/Avatar/AvatarUtils.cs @@ -10,13 +10,29 @@ * You should have received a copy of the GNU General Public License along with DressingFramework. If not, see . */ +using System.Collections.Generic; +using Chocopoi.DressingFramework; +using Chocopoi.DressingTools.Components.OneConf; using UnityEngine; +using UnityEngine.SceneManagement; namespace Chocopoi.DressingTools.Configurator.Avatar { - internal interface IAvatarProvider + internal static class AvatarUtils { - GameObject[] GetSceneAvatars(); - IAvatarSettings GetAvatarSettings(GameObject avatarGameObject); + public static IAvatarSettings GetAvatarSettings(GameObject avatarGameObject) + { + if (avatarGameObject.TryGetComponent(out _)) + { + return new OneConfAvatarSettings(avatarGameObject); + } + // TODO: standalone avatar settings component + return null; + } + + public static List FindSceneAvatars(Scene scene) + { + return DKRuntimeUtils.FindSceneAvatars(scene); + } } } diff --git a/Editor/Configurator/Avatar/AvatarProvider.cs.meta b/Editor/Configurator/Avatar/AvatarUtils.cs.meta similarity index 100% rename from Editor/Configurator/Avatar/AvatarProvider.cs.meta rename to Editor/Configurator/Avatar/AvatarUtils.cs.meta diff --git a/Editor/Configurator/Avatar/IAvatarProvider.cs.meta b/Editor/Configurator/Avatar/IAvatarProvider.cs.meta deleted file mode 100644 index 33988aa4..00000000 --- a/Editor/Configurator/Avatar/IAvatarProvider.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4d1d36423468506479fba7a6168391ef -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: