diff --git a/Editor/Utility/ChartEditorHelper.cs b/Editor/Utility/ChartEditorHelper.cs index e83f4c20..8d19f9cf 100644 --- a/Editor/Utility/ChartEditorHelper.cs +++ b/Editor/Utility/ChartEditorHelper.cs @@ -102,7 +102,7 @@ public class ChartEditorHelper float defaultWidth = drawRect.width; float defaultX = drawRect.x; - drawRect.width = EditorGUIUtility.labelWidth; + drawRect.width = EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15; var displayName = string.IsNullOrEmpty(moduleName) ? prop.displayName : moduleName; toggle = EditorGUI.Foldout(drawRect, toggle, displayName, bold ? foldoutStyle : EditorStyles.foldout); if (moduleToggle[key] != toggle) diff --git a/Runtime/Utility/ChartHelper.cs b/Runtime/Utility/ChartHelper.cs index c123814a..0488bc64 100644 --- a/Runtime/Utility/ChartHelper.cs +++ b/Runtime/Utility/ChartHelper.cs @@ -90,13 +90,15 @@ namespace XCharts public static void DestroyAllChildren(Transform parent) { +#if UNITY_2019_1_OR_NEWER +#else if (parent == null) return; -#if UNITY_EDITOR && UNITY_2018_3_OR_NEWER + #if UNITY_EDITOR && UNITY_2018_3_OR_NEWER if (PrefabUtility.IsPartOfAnyPrefab(parent.gameObject)) { return; } -#endif + #endif while (parent.childCount > 0) { var go = parent.GetChild(0); @@ -105,6 +107,7 @@ namespace XCharts GameObject.DestroyImmediate(go.gameObject); } } +#endif } public static string GetFullName(Transform transform)