import { Laya } from "Laya" ; import { Animator } from "laya/d3/component/Animator" ; import { Script3D } from "laya/d3/component/Script3D" ; import { Camera } from "laya/d3/core/Camera" ; import { Scene3D } from "laya/d3/core/scene/Scene3D" ; import { Sprite3D } from "laya/d3/core/Sprite3D" ; import { Vector3 } from "laya/d3/math/Vector3" ; import { Stage } from "laya/display/Stage" ; import { Handler } from "laya/utils/Handler" ; import { Stat } from "laya/utils/Stat" ; import { Laya3D } from "Laya3D" ; import { CameraMoveScript } from "../common/CameraMoveScript" ; export class AnimationEventTest { constructor ( ) { Laya3D . init ( 0 , 0 ) ; Laya . stage . scaleMode = Stage . SCALE_FULL ; Laya . stage . screenMode = Stage . SCREEN_NONE ; Stat . show ( ) ; var scene = ( < Scene3D > Laya . stage . addChild ( new Scene3D ( ) ) ) ; scene . ambientColor = new Vector3 ( 1 , 1 , 1 ) ; var camera = ( < Camera > scene . addChild ( new Camera ( 0 , 0.1 , 100 ) ) ) ; camera . transform . translate ( new Vector3 ( 0 , 0.5 , 3 ) ) ; camera . transform . rotate ( new Vector3 ( - 15 , 0 , 0 ) , true , false ) ; camera . addComponent ( CameraMoveScript ) ; Sprite3D . load ( "Test/res3d/Conventional/Character.lh" , Handler . create ( null , function ( sprite ) : void { scene . addChild ( sprite ) ; var sp = < Sprite3D > sprite . getChildAt ( 0 ) . getChildAt ( 1 ) . getChildAt ( 0 ) ; var ani = sp . getComponent ( Animator ) ; sp . addComponent ( SceneScript ) ; ani . play ( "idle01_01_ani" ) ; } ) ) ; } } class SceneScript extends Script3D { constructor ( ) { super ( ) ; } switch_ani ( ) { console . log ( "TTTTTTT" ) ; } }