UNPKG

@awayjs/graphics

Version:
30 lines (29 loc) 1.39 kB
import { __extends } from "tslib"; import { AnimationStateEvent } from '../../events/AnimationStateEvent'; import { SkeletonBinaryLERPState } from '../states/SkeletonBinaryLERPState'; /** * */ var CrossfadeTransitionState = /** @class */ (function (_super) { __extends(CrossfadeTransitionState, _super); function CrossfadeTransitionState(animator, skeletonAnimationNode) { var _this = _super.call(this, animator, skeletonAnimationNode) || this; _this._crossfadeTransitionNode = skeletonAnimationNode; return _this; } /** * @inheritDoc */ CrossfadeTransitionState.prototype._pUpdateTime = function (time) { this.blendWeight = Math.abs(time - this._crossfadeTransitionNode.startBlend) / (1000 * this._crossfadeTransitionNode.blendSpeed); if (this.blendWeight >= 1) { this.blendWeight = 1; if (this._animationStateTransitionComplete == null) this._animationStateTransitionComplete = new AnimationStateEvent(AnimationStateEvent.TRANSITION_COMPLETE, this._pAnimator, this, this._crossfadeTransitionNode); this._crossfadeTransitionNode.dispatchEvent(this._animationStateTransitionComplete); } _super.prototype._pUpdateTime.call(this, time); }; return CrossfadeTransitionState; }(SkeletonBinaryLERPState)); export { CrossfadeTransitionState };