kilgoar2024/Assets/MapEditor/Scripts/PrefabCategoryParent.cs

14 lines
351 B
C#

using UnityEngine;
[ExecuteInEditMode, DisallowMultipleComponent]
public class PrefabCategoryParent : MonoBehaviour
{
public void Update()
{
if (gameObject.transform.childCount == 0)
{
PrefabManager.PrefabCategories.Remove(gameObject.name);
GameObject.DestroyImmediate(gameObject);
}
}
}