|
@@ -242,6 +242,17 @@
|
|
* @param weight defines the weight to apply to this value
|
|
* @param weight defines the weight to apply to this value
|
|
*/
|
|
*/
|
|
public setValue(currentValue: any, weight = 1.0): void {
|
|
public setValue(currentValue: any, weight = 1.0): void {
|
|
|
|
+ if (this._target instanceof Array) {
|
|
|
|
+ for (const target of this._target) {
|
|
|
|
+ this._setValue(target, currentValue, weight);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ this._setValue(this._target, currentValue, weight);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private _setValue(target: any, currentValue: any, weight = 1.0): void {
|
|
// Set value
|
|
// Set value
|
|
var path: any;
|
|
var path: any;
|
|
var destination: any;
|
|
var destination: any;
|
|
@@ -249,7 +260,7 @@
|
|
let targetPropertyPath = this._animation.targetPropertyPath
|
|
let targetPropertyPath = this._animation.targetPropertyPath
|
|
|
|
|
|
if (targetPropertyPath.length > 1) {
|
|
if (targetPropertyPath.length > 1) {
|
|
- var property = this._target[targetPropertyPath[0]];
|
|
|
|
|
|
+ var property = target[targetPropertyPath[0]];
|
|
|
|
|
|
for (var index = 1; index < targetPropertyPath.length - 1; index++) {
|
|
for (var index = 1; index < targetPropertyPath.length - 1; index++) {
|
|
property = property[targetPropertyPath[index]];
|
|
property = property[targetPropertyPath[index]];
|
|
@@ -259,7 +270,7 @@
|
|
destination = property;
|
|
destination = property;
|
|
} else {
|
|
} else {
|
|
path = targetPropertyPath[0];
|
|
path = targetPropertyPath[0];
|
|
- destination = this._target;
|
|
|
|
|
|
+ destination = target;
|
|
}
|
|
}
|
|
|
|
|
|
this._targetPath = path;
|
|
this._targetPath = path;
|
|
@@ -267,8 +278,8 @@
|
|
this._weight = weight;
|
|
this._weight = weight;
|
|
|
|
|
|
// Blending
|
|
// Blending
|
|
- let enableBlending = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;
|
|
|
|
- let blendingSpeed = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
|
|
|
|
|
|
+ let enableBlending = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;
|
|
|
|
+ let blendingSpeed = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
|
|
|
|
|
|
if (enableBlending && this._blendingFactor <= 1.0) {
|
|
if (enableBlending && this._blendingFactor <= 1.0) {
|
|
if (!this._originalBlendValue) {
|
|
if (!this._originalBlendValue) {
|
|
@@ -337,8 +348,8 @@
|
|
destination[path] = this._currentValue;
|
|
destination[path] = this._currentValue;
|
|
}
|
|
}
|
|
|
|
|
|
- if (this._target.markAsDirty) {
|
|
|
|
- this._target.markAsDirty(this._animation.targetProperty);
|
|
|
|
|
|
+ if (target.markAsDirty) {
|
|
|
|
+ target.markAsDirty(this._animation.targetProperty);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|