|
@@ -71,6 +71,7 @@ namespace Spine.Unity.Editor {
|
|
readonly List<string> warnings = new List<string>();
|
|
readonly List<string> warnings = new List<string>();
|
|
CompatibilityProblemInfo compatibilityProblemInfo = null;
|
|
CompatibilityProblemInfo compatibilityProblemInfo = null;
|
|
readonly SkeletonInspectorPreview preview = new SkeletonInspectorPreview();
|
|
readonly SkeletonInspectorPreview preview = new SkeletonInspectorPreview();
|
|
|
|
+ bool requiresReload = false;
|
|
|
|
|
|
GUIStyle activePlayButtonStyle, idlePlayButtonStyle;
|
|
GUIStyle activePlayButtonStyle, idlePlayButtonStyle;
|
|
readonly GUIContent DefaultMixLabel = new GUIContent("Default Mix Duration", "Sets 'SkeletonDataAsset.defaultMix' in the asset and 'AnimationState.data.defaultMix' at runtime load time.");
|
|
readonly GUIContent DefaultMixLabel = new GUIContent("Default Mix Duration", "Sets 'SkeletonDataAsset.defaultMix' in the asset and 'AnimationState.data.defaultMix' at runtime load time.");
|
|
@@ -192,13 +193,12 @@ namespace Spine.Unity.Editor {
|
|
}
|
|
}
|
|
|
|
|
|
if (changeCheck.changed) {
|
|
if (changeCheck.changed) {
|
|
- if (serializedObject.ApplyModifiedProperties()) {
|
|
|
|
|
|
+ if (requiresReload || serializedObject.ApplyModifiedProperties()) {
|
|
this.Clear();
|
|
this.Clear();
|
|
this.InitializeEditor();
|
|
this.InitializeEditor();
|
|
|
|
|
|
- if (SpineEditorUtilities.Preferences.autoReloadSceneSkeletons)
|
|
|
|
|
|
+ if (SpineEditorUtilities.Preferences.autoReloadSceneSkeletons && NoProblems())
|
|
SpineEditorUtilities.DataReloadHandler.ReloadSceneSkeletonComponents(targetSkeletonDataAsset);
|
|
SpineEditorUtilities.DataReloadHandler.ReloadSceneSkeletonComponents(targetSkeletonDataAsset);
|
|
-
|
|
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -361,18 +361,24 @@ namespace Spine.Unity.Editor {
|
|
|
|
|
|
void DrawAtlasAssetsFields () {
|
|
void DrawAtlasAssetsFields () {
|
|
EditorGUILayout.LabelField("Atlas", EditorStyles.boldLabel);
|
|
EditorGUILayout.LabelField("Atlas", EditorStyles.boldLabel);
|
|
|
|
+
|
|
|
|
+ using (var changeCheck = new EditorGUI.ChangeCheckScope()) {
|
|
#if !SPINE_TK2D
|
|
#if !SPINE_TK2D
|
|
- EditorGUILayout.PropertyField(atlasAssets, true);
|
|
|
|
-#else
|
|
|
|
- using (new EditorGUI.DisabledGroupScope(spriteCollection.objectReferenceValue != null)) {
|
|
|
|
EditorGUILayout.PropertyField(atlasAssets, true);
|
|
EditorGUILayout.PropertyField(atlasAssets, true);
|
|
- }
|
|
|
|
- EditorGUILayout.LabelField("spine-tk2d", EditorStyles.boldLabel);
|
|
|
|
- EditorGUILayout.PropertyField(spriteCollection, true);
|
|
|
|
|
|
+#else
|
|
|
|
+ using (new EditorGUI.DisabledGroupScope(spriteCollection.objectReferenceValue != null)) {
|
|
|
|
+ EditorGUILayout.PropertyField(atlasAssets, true);
|
|
|
|
+ }
|
|
|
|
+ EditorGUILayout.LabelField("spine-tk2d", EditorStyles.boldLabel);
|
|
|
|
+ EditorGUILayout.PropertyField(spriteCollection, true);
|
|
#endif
|
|
#endif
|
|
|
|
+ if (atlasAssets.arraySize == 0)
|
|
|
|
+ EditorGUILayout.HelpBox("AtlasAssets array is empty. Skeleton's attachments will load without being mapped to images.", MessageType.Info);
|
|
|
|
|
|
- if (atlasAssets.arraySize == 0)
|
|
|
|
- EditorGUILayout.HelpBox("AtlasAssets array is empty. Skeleton's attachments will load without being mapped to images.", MessageType.Info);
|
|
|
|
|
|
+ if (changeCheck.changed) {
|
|
|
|
+ requiresReload = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
void HandleAtlasAssetsNulls () {
|
|
void HandleAtlasAssetsNulls () {
|