78 lines
1.8 KiB
TypeScript
78 lines
1.8 KiB
TypeScript
import { Camera, CCBoolean, Component, EventTouch, Node, screen, Size, Texture2D, UITransform, Vec2, Vec3, view, _decorator } from "cc";
|
|
import { oops } from "../../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
|
import MapData from "./map/base/MapData";
|
|
import { MapLoadModel } from "./map/base/MapLoadModel";
|
|
import EntityLayer from "./map/layer/EntityLayer";
|
|
import SkillLayer from "./map/layer/SkillLayer";
|
|
import MapLayer from "./map/layer/MapLayer";
|
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
/**
|
|
* 地图场景逻辑
|
|
* 1、地图摄像机跟随角色位置移动
|
|
*/
|
|
@ccclass('MapViewScene')
|
|
export class MapViewScene extends Component {
|
|
@property(Camera)
|
|
public camera: Camera | null = null;
|
|
|
|
@property(Node)
|
|
public layer: Node | null = null;
|
|
|
|
@property(MapLayer)
|
|
public mapLayer: MapLayer | null = null;
|
|
|
|
@property(Node)
|
|
public floorLayer: Node | null = null;
|
|
|
|
@property(EntityLayer)
|
|
public entityLayer: EntityLayer | null = null;
|
|
|
|
@property(SkillLayer)
|
|
public SkillLayer: SkillLayer | null = null;
|
|
|
|
@property(CCBoolean)
|
|
public isFollowPlayer: boolean = true;
|
|
|
|
/** 2D转3D位置比例值 */
|
|
ratio: Vec2 = new Vec2();
|
|
|
|
|
|
|
|
|
|
|
|
onLoad() {
|
|
this.enabled = false;
|
|
}
|
|
|
|
start() {
|
|
|
|
}
|
|
|
|
|
|
|
|
private reset() {
|
|
this.floorLayer!.removeAllChildren(); // 清除地面显示对象
|
|
this.entityLayer!.clear(); // 清除游戏实体对象
|
|
this.mapLayer!.clear();
|
|
|
|
|
|
}
|
|
|
|
public init(mapData: MapData, bgTex: Texture2D, mapLoadModel: MapLoadModel = 1) {
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
update(dt: number) {
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|