35 lines
		
	
	
		
			615 B
		
	
	
	
		
			TypeScript
		
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			615 B
		
	
	
	
		
			TypeScript
		
	
	
	
| import { _decorator, Component, Node } from 'cc';
 | |
| import { MapTileTypes } from './MapTile/MapTileData';
 | |
| import { MapTileNode } from './MapTile/MapTileNode';
 | |
| const { ccclass, property } = _decorator;
 | |
| 
 | |
| /// 最底层的地图 图层Component
 | |
| @ccclass('BoardRoot')
 | |
| export class BoardRoot extends Component {
 | |
| 
 | |
|     start() {
 | |
| 
 | |
| 
 | |
|     }
 | |
| 
 | |
| 
 | |
|     /// 初始化 地图快
 | |
|     initMapTile(){
 | |
| 
 | |
|         // 从枚举类型 添加所有地块
 | |
|         MapTileTypes.forEach((type) => {
 | |
|             const node = new MapTileNode(type);
 | |
|             this.node.addChild(node);
 | |
| 
 | |
|         });
 | |
|     }
 | |
| 
 | |
|     update(deltaTime: number) {
 | |
| 
 | |
| 
 | |
| 
 | |
|     }
 | |
| }
 | |
| 
 | |
| 
 |