47 lines
950 B
TypeScript
47 lines
950 B
TypeScript
import { _decorator, Component, Node } from 'cc';
|
|
import { MapTileType } from './MapTileData';
|
|
import { MapTileNode } from './MapTileNode';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
/// 最底层的地图 图层Component
|
|
@ccclass('BoardRoot')
|
|
export class BoardRoot extends Component {
|
|
|
|
start() {
|
|
|
|
|
|
}
|
|
|
|
|
|
/// 初始化 地图快
|
|
initMapTile(){
|
|
// 从枚举类型 添加所有地块
|
|
const types = Object.values(MapTileType);
|
|
console.log(types);
|
|
|
|
types.forEach((a,b) => {
|
|
const node = new MapTileNode(b);
|
|
this.node.addChild(node);
|
|
|
|
});
|
|
|
|
|
|
// for( let i = 0; i < types.length ; i++){
|
|
// const type = types[i];
|
|
// const node = new MapTileNode(type);
|
|
// this.node.addChild(node);
|
|
// }
|
|
|
|
// console.log('地图块初始化完成');
|
|
// console.log(this.node);
|
|
}
|
|
|
|
update(deltaTime: number) {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|