| 
									
										
										
										
											2024-03-18 10:55:21 +08:00
										 |  |  | import { _decorator, Component, Node } from 'cc'; | 
					
						
							| 
									
										
										
										
											2024-03-19 18:03:50 +08:00
										 |  |  | import { MapTileTypes } from './MapTile/MapTileData'; | 
					
						
							|  |  |  | import { MapTileNode } from './MapTile/MapTileNode'; | 
					
						
							| 
									
										
										
										
											2024-03-18 10:55:21 +08:00
										 |  |  | const { ccclass, property } = _decorator; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /// 最底层的地图 图层Component
 | 
					
						
							|  |  |  | @ccclass('BoardRoot') | 
					
						
							|  |  |  | export class BoardRoot extends Component { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     start() { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// 初始化 地图快
 | 
					
						
							|  |  |  |     initMapTile(){ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-18 20:10:09 +08:00
										 |  |  |         // 从枚举类型 添加所有地块
 | 
					
						
							|  |  |  |         MapTileTypes.forEach((type) => { | 
					
						
							|  |  |  |             const node = new MapTileNode(type); | 
					
						
							| 
									
										
										
										
											2024-03-18 10:55:21 +08:00
										 |  |  |             this.node.addChild(node); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         }); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     update(deltaTime: number) { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 |