Skip to content

可以获取到每一帧的图片吗? #34

Answered by GuoLei1990
SunilWang asked this question in Engine
Discussion options

You must be logged in to vote

第一个问题参考:https://oasisengine.cn/#/examples/latest/screenshot
第二个问题你可能想用 onStateExit 回调,参考: https://oasisengine.cn/#/examples/latest/animation-stateMachineScript

    const animator = defaultSceneRoot.getComponent(Animator);
    const state = animator.findAnimatorState("walk");

    state.addStateMachineScript(
      class extends StateMachineScript {
        onStateEnter(animator: Animator,animatorState: AnimatorState,layerIndex: number): void {
          console.log("onStateEnter: ", animatorState);
        }

        onStateUpdate(animator: Animator, animatorState: AnimatorState,layerIndex: number): void {
          console.log("onStateUpdate: ", animatorState);
        }

        onState…

Replies: 0 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by luzhuang
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Engine
Labels
question Further information is requested
2 participants