|
@@ -198,6 +198,32 @@ namespace Spine.Unity.Editor {
|
|
EditorGUILayout.LabelField("spine-tk2d", EditorStyles.boldLabel);
|
|
EditorGUILayout.LabelField("spine-tk2d", EditorStyles.boldLabel);
|
|
EditorGUILayout.PropertyField(spriteCollection, true);
|
|
EditorGUILayout.PropertyField(spriteCollection, true);
|
|
#endif
|
|
#endif
|
|
|
|
+
|
|
|
|
+ {
|
|
|
|
+ bool hasNulls = false;
|
|
|
|
+ foreach (var a in m_skeletonDataAsset.atlasAssets) {
|
|
|
|
+ if (a == null) {
|
|
|
|
+ hasNulls = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (hasNulls) {
|
|
|
|
+ if (m_skeletonDataAsset.atlasAssets.Length == 1) {
|
|
|
|
+ EditorGUILayout.HelpBox("Atlas array cannot have null entries!", MessageType.None);
|
|
|
|
+ } else {
|
|
|
|
+ EditorGUILayout.HelpBox("Atlas array should not have null entries!", MessageType.Error);
|
|
|
|
+ if (SpineInspectorUtility.CenteredButton(SpineInspectorUtility.TempContent("Remove null entries"))) {
|
|
|
|
+ var trimmedAtlasAssets = new List<AtlasAsset>();
|
|
|
|
+ foreach (var a in m_skeletonDataAsset.atlasAssets) {
|
|
|
|
+ if (a != null) trimmedAtlasAssets.Add(a);
|
|
|
|
+ }
|
|
|
|
+ m_skeletonDataAsset.atlasAssets = trimmedAtlasAssets.ToArray();
|
|
|
|
+ serializedObject.Update();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if (EditorGUI.EndChangeCheck()) {
|
|
if (EditorGUI.EndChangeCheck()) {
|
|
@@ -446,25 +472,6 @@ namespace Spine.Unity.Editor {
|
|
void RepopulateWarnings () {
|
|
void RepopulateWarnings () {
|
|
warnings.Clear();
|
|
warnings.Clear();
|
|
|
|
|
|
- // Clear null entries.
|
|
|
|
- {
|
|
|
|
- bool hasNulls = false;
|
|
|
|
- foreach (var a in m_skeletonDataAsset.atlasAssets) {
|
|
|
|
- if (a == null) {
|
|
|
|
- hasNulls = true;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (hasNulls) {
|
|
|
|
- var trimmedAtlasAssets = new List<AtlasAsset>();
|
|
|
|
- foreach (var a in m_skeletonDataAsset.atlasAssets) {
|
|
|
|
- if (a != null) trimmedAtlasAssets.Add(a);
|
|
|
|
- }
|
|
|
|
- m_skeletonDataAsset.atlasAssets = trimmedAtlasAssets.ToArray();
|
|
|
|
- }
|
|
|
|
- serializedObject.Update();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if (skeletonJSON.objectReferenceValue == null) {
|
|
if (skeletonJSON.objectReferenceValue == null) {
|
|
warnings.Add("Missing Skeleton JSON");
|
|
warnings.Add("Missing Skeleton JSON");
|
|
} else {
|
|
} else {
|
|
@@ -475,8 +482,6 @@ namespace Spine.Unity.Editor {
|
|
bool searchForSpineAtlasAssets = true;
|
|
bool searchForSpineAtlasAssets = true;
|
|
bool isSpriteCollectionNull = spriteCollection.objectReferenceValue == null;
|
|
bool isSpriteCollectionNull = spriteCollection.objectReferenceValue == null;
|
|
if (!isSpriteCollectionNull) searchForSpineAtlasAssets = false;
|
|
if (!isSpriteCollectionNull) searchForSpineAtlasAssets = false;
|
|
- //else
|
|
|
|
- // warnings.Add("Your sprite collection may have missing images.");
|
|
|
|
#else
|
|
#else
|
|
const bool searchForSpineAtlasAssets = true;
|
|
const bool searchForSpineAtlasAssets = true;
|
|
#endif
|
|
#endif
|