修复拖出制作预设时异常的问题

This commit is contained in:
monitor1394
2019-10-31 09:40:12 +08:00
parent 16c8d26e2a
commit 2dc3c2f759
3 changed files with 12 additions and 2 deletions

View File

@@ -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);