| 
									
										
										
										
											2024-03-27 15:57:22 +08:00
										 |  |  | /* | 
					
						
							|  |  |  |  * @Author: WoNiu | 
					
						
							|  |  |  |  * @Date: 2024-03-11 12:16:36 | 
					
						
							|  |  |  |  * @LastEditTime: 2024-03-26 15:40:23 | 
					
						
							|  |  |  |  * @LastEditors: WoNiu | 
					
						
							|  |  |  |  * @Description: | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | import { _decorator, Node } from 'cc'; | 
					
						
							| 
									
										
										
										
											2024-03-11 17:37:03 +08:00
										 |  |  | import { ScriptMyAnimation } from './ScriptMyAnimation'; | 
					
						
							| 
									
										
										
										
											2024-03-27 15:57:22 +08:00
										 |  |  | const { ccclass } = _decorator; | 
					
						
							| 
									
										
										
										
											2024-03-11 17:37:03 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | @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); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 |