| 
									
										
										
										
											2024-03-11 17:37:03 +08:00
										 |  |  | import { _decorator, Component, Node } from 'cc'; | 
					
						
							|  |  |  | import { ScriptMyAnimation } from './ScriptMyAnimation'; | 
					
						
							|  |  |  | const { ccclass, property } = _decorator; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @ccclass('AnimationNode') | 
					
						
							|  |  |  | export class AnimationNode extends Node{ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-13 17:04:19 +08:00
										 |  |  |     constructor(AnimationPath: string,aniDone?:Function) { | 
					
						
							| 
									
										
										
										
											2024-03-11 17:37:03 +08:00
										 |  |  |         super(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         let aniNode = new Node(); | 
					
						
							| 
									
										
										
										
											2024-03-13 17:04:19 +08:00
										 |  |  |         let ani = aniNode.addComponent( ScriptMyAnimation) | 
					
						
							|  |  |  |         ani.AnimationPath = AnimationPath; | 
					
						
							|  |  |  |         ani.onAniDone = aniDone; | 
					
						
							| 
									
										
										
										
											2024-03-11 17:37:03 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         this.addChild(aniNode); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 |