From 55c177594bfe6d8f0abcc543dd37505002c5e820 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Thu, 13 Nov 2014 08:37:54 -0800 Subject: [PATCH] only set animationIsPlaying if it changed --- examples/libraries/entityPropertyDialogBox.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/examples/libraries/entityPropertyDialogBox.js b/examples/libraries/entityPropertyDialogBox.js index d0d5add708..da60e0c370 100644 --- a/examples/libraries/entityPropertyDialogBox.js +++ b/examples/libraries/entityPropertyDialogBox.js @@ -22,6 +22,7 @@ EntityPropertyDialogBox = (function () { var dimensionZ; var rescalePercentage; var editModelID = -1; + var previousAnimationIsPlaying; var previousAnimationFrameIndex; var previousAnimationSettings; @@ -49,6 +50,7 @@ EntityPropertyDialogBox = (function () { array.push({ label: "Animation URL:", value: properties.animationURL }); index++; array.push({ label: "Animation is playing:", value: properties.animationIsPlaying }); + previousAnimationIsPlaying = properties.animationIsPlaying; index++; array.push({ label: "Animation FPS:", value: properties.animationFPS }); index++; @@ -243,18 +245,24 @@ EntityPropertyDialogBox = (function () { if (properties.type == "Model") { properties.modelURL = array[index++].value; properties.animationURL = array[index++].value; - properties.animationIsPlaying = array[index++].value; + + var newAnimationIsPlaying = array[index++].value; + if (previousAnimationIsPlaying != newAnimationIsPlaying) { + properties.animationIsPlaying = newAnimationIsPlaying; + } else { + delete properties.animationIsPlaying; + } + properties.animationFPS = array[index++].value; var newAnimationFrameIndex = array[index++].value; - var newAnimationSettings = array[index++].value; - if (previousAnimationFrameIndex != newAnimationFrameIndex) { properties.animationFrameIndex = newAnimationFrameIndex; } else { delete properties.animationFrameIndex; } + var newAnimationSettings = array[index++].value; if (previousAnimationSettings != newAnimationSettings) { properties.animationSettings = newAnimationSettings; } else {