mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-02 13:49:07 +08:00
Merge branch '3.6' of https://github.com/esotericsoftware/spine-runtimes into 3.6
This commit is contained in:
commit
798f7c584f
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user