From f736b87db8a9fd2ec9b32403cacab3b18ecbe79d Mon Sep 17 00:00:00 2001 From: dogeFu <609075410@qq.com> Date: Wed, 14 Jun 2023 18:41:19 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9Aadd=20clear=20method=20for=20Anima?= =?UTF-8?q?tionGraphPartialPreviewer=20(#15441)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat : add clearVariables method for AnimationGraphPartialPreviewer * clear motionRecords too --- editor/src/marionette/preview.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/editor/src/marionette/preview.ts b/editor/src/marionette/preview.ts index f946ecdd70..42566e88fc 100644 --- a/editor/src/marionette/preview.ts +++ b/editor/src/marionette/preview.ts @@ -27,6 +27,11 @@ class AnimationGraphPartialPreviewer { this._dummyAnimationController.node.destroy(); } + public clear() { + this._varInstances = {}; + this._motionRecords = []; + } + public evaluate() { const { _evaluationContext: evaluationContext } = this; const pose = this.doEvaluate(evaluationContext);