This commit is contained in:
badlogic 2019-08-12 14:02:33 +02:00
commit f98afcebfe

View File

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