浏览代码

[unity] Fixed SkeletonData asset inspector animation playback preview for Unity 2018 and 2019. Closes #1440.

Harald Csaszar 6 年之前
父节点
当前提交
b151e2e610

+ 2 - 9
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SkeletonDataAssetInspector.cs

@@ -696,11 +696,8 @@ namespace Spine.Unity.Editor {
 		SkeletonAnimation skeletonAnimation;
 		GameObject previewGameObject;
 		internal bool requiresRefresh;
-
-		#if !SPINE_UNITY_2018_PREVIEW_API
 		float animationLastTime;
-		#endif
-
+		
 		static float CurrentTime { get { return (float)EditorApplication.timeSinceStartup; } }
 
 		Action Repaint;
@@ -793,10 +790,8 @@ namespace Spine.Unity.Editor {
 
 			if (previewRenderUtility == null) {
 				previewRenderUtility = new PreviewRenderUtility(true);
-				#if !SPINE_UNITY_2018_PREVIEW_API
 				animationLastTime = CurrentTime;
-				#endif
-
+				
 				const int PreviewLayer = 30;
 				const int PreviewCameraCullingMask = 1 << PreviewLayer;
 
@@ -885,12 +880,10 @@ namespace Spine.Unity.Editor {
 
 				
 				if (!EditorApplication.isPlaying) {
-					#if !SPINE_UNITY_2018_PREVIEW_API
 					float current = CurrentTime;
 					float deltaTime = (current - animationLastTime);
 					skeletonAnimation.Update(deltaTime);
 					animationLastTime = current;
-					#endif
 					skeletonAnimation.LateUpdate();
 				}