refactor():重构编辑系统,不再需要添加额外的脚本作为可编辑的入口了

This commit is contained in:
2025-10-21 16:40:41 +08:00
parent 1ce3d1a0d8
commit 93b83b3af3
37 changed files with 186 additions and 199 deletions

View File

@@ -0,0 +1,23 @@
using Core;
using UnityEngine;
using System.Collections.Generic;
using Script.Gameplay.Interface;
namespace Script.Gameplay.Edit
{
public class EditableManager : MonoSingleton<EditableManager>
{
public static List<IEditableComponent> GetEditableComponents(GameObject target)
{
var components = new List<IEditableComponent>();
foreach (var mb in target.GetComponentsInChildren<MonoBehaviour>(true))
{
if (mb is IEditableComponent editableComponent)
{
components.Add(editableComponent);
}
}
return components;
}
}
}