mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-17 14:00:12 +00:00
修复拖出制作预设时异常的问题
This commit is contained in:
@@ -12,6 +12,9 @@ using System.Text.RegularExpressions;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
@@ -74,6 +77,13 @@ namespace XCharts
|
||||
|
||||
public static void DestroyAllChildren(Transform parent)
|
||||
{
|
||||
if(parent == null) return;
|
||||
#if UNITY_EDITOR
|
||||
if (PrefabUtility.IsPartOfAnyPrefab(parent.gameObject))
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
while (parent.childCount > 0)
|
||||
{
|
||||
var go = parent.GetChild(0);
|
||||
|
||||
Reference in New Issue
Block a user