23 lines
678 B
C#
23 lines
678 B
C#
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;
|
|
}
|
|
}
|
|
} |