|
@@ -124,6 +124,8 @@
|
|
|
dataType = Animation.ANIMATIONTYPE_VECTOR2;
|
|
|
} else if (from instanceof Color3) {
|
|
|
dataType = Animation.ANIMATIONTYPE_COLOR3;
|
|
|
+ } else if (from instanceof Size) {
|
|
|
+ dataType = Animation.ANIMATIONTYPE_SIZE;
|
|
|
}
|
|
|
|
|
|
if (dataType == undefined) {
|
|
@@ -293,6 +295,10 @@
|
|
|
return Vector2.Lerp(startValue, endValue, gradient);
|
|
|
}
|
|
|
|
|
|
+ public sizeInterpolateFunction(startValue: Size, endValue: Size, gradient: number): Size {
|
|
|
+ return Size.Lerp(startValue, endValue, gradient);
|
|
|
+ }
|
|
|
+
|
|
|
public color3InterpolateFunction(startValue: Color3, endValue: Color3, gradient: number): Color3 {
|
|
|
return Color3.Lerp(startValue, endValue, gradient);
|
|
|
}
|
|
@@ -405,6 +411,15 @@
|
|
|
case Animation.ANIMATIONLOOPMODE_RELATIVE:
|
|
|
return this.vector2InterpolateFunction(startValue, endValue, gradient).add(offsetValue.scale(repeatCount));
|
|
|
}
|
|
|
+ // Size
|
|
|
+ case Animation.ANIMATIONTYPE_SIZE:
|
|
|
+ switch (loopMode) {
|
|
|
+ case Animation.ANIMATIONLOOPMODE_CYCLE:
|
|
|
+ case Animation.ANIMATIONLOOPMODE_CONSTANT:
|
|
|
+ return this.sizeInterpolateFunction(startValue, endValue, gradient);
|
|
|
+ case Animation.ANIMATIONLOOPMODE_RELATIVE:
|
|
|
+ return this.sizeInterpolateFunction(startValue, endValue, gradient).add(offsetValue.scale(repeatCount));
|
|
|
+ }
|
|
|
// Color3
|
|
|
case Animation.ANIMATIONTYPE_COLOR3:
|
|
|
switch (loopMode) {
|
|
@@ -453,15 +468,16 @@
|
|
|
destination = this._target;
|
|
|
}
|
|
|
|
|
|
+ if (!this._originalBlendValue) {
|
|
|
+ if (destination[path].clone) {
|
|
|
+ this._originalBlendValue = destination[path].clone();
|
|
|
+ } else {
|
|
|
+ this._originalBlendValue = destination[path];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// Blending
|
|
|
if (this.enableBlending && this._blendingFactor <= 1.0) {
|
|
|
- if (!this._originalBlendValue) {
|
|
|
- if (destination[path].clone) {
|
|
|
- this._originalBlendValue = destination[path].clone();
|
|
|
- } else {
|
|
|
- this._originalBlendValue = destination[path];
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
if (this._originalBlendValue.prototype) { // Complex value
|
|
|
|
|
@@ -482,7 +498,7 @@
|
|
|
}
|
|
|
|
|
|
if (this._target.markAsDirty) {
|
|
|
- this._target.markAsDirty(this.targetProperty);
|
|
|
+ this._target.markAsDirty(this.targetProperty, this._originalBlendValue);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -553,6 +569,9 @@
|
|
|
// Vector2
|
|
|
case Animation.ANIMATIONTYPE_VECTOR2:
|
|
|
this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
|
|
|
+ // Size
|
|
|
+ case Animation.ANIMATIONTYPE_SIZE:
|
|
|
+ this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
|
|
|
// Color3
|
|
|
case Animation.ANIMATIONTYPE_COLOR3:
|
|
|
this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
|
|
@@ -586,6 +605,10 @@
|
|
|
case Animation.ANIMATIONTYPE_VECTOR2:
|
|
|
offsetValue = Vector2.Zero();
|
|
|
break;
|
|
|
+ // Size
|
|
|
+ case Animation.ANIMATIONTYPE_SIZE:
|
|
|
+ offsetValue = Size.Zero();
|
|
|
+ break;
|
|
|
// Color3
|
|
|
case Animation.ANIMATIONTYPE_COLOR3:
|
|
|
offsetValue = Color3.Black();
|
|
@@ -676,6 +699,7 @@
|
|
|
private static _ANIMATIONTYPE_MATRIX = 3;
|
|
|
private static _ANIMATIONTYPE_COLOR3 = 4;
|
|
|
private static _ANIMATIONTYPE_VECTOR2 = 5;
|
|
|
+ private static _ANIMATIONTYPE_SIZE = 6;
|
|
|
private static _ANIMATIONLOOPMODE_RELATIVE = 0;
|
|
|
private static _ANIMATIONLOOPMODE_CYCLE = 1;
|
|
|
private static _ANIMATIONLOOPMODE_CONSTANT = 2;
|
|
@@ -692,6 +716,10 @@
|
|
|
return Animation._ANIMATIONTYPE_VECTOR2;
|
|
|
}
|
|
|
|
|
|
+ public static get ANIMATIONTYPE_SIZE(): number {
|
|
|
+ return Animation._ANIMATIONTYPE_SIZE;
|
|
|
+ }
|
|
|
+
|
|
|
public static get ANIMATIONTYPE_QUATERNION(): number {
|
|
|
return Animation._ANIMATIONTYPE_QUATERNION;
|
|
|
}
|