手动控制spine 动画
This commit is contained in:
@@ -65,9 +65,6 @@ export class MapViewComp extends CCComp {
|
||||
var test7 = ecs.getEntity<Role>(Role);
|
||||
test7.load(this.aStarToVec3("360,-60"), true);
|
||||
}
|
||||
else {
|
||||
this.scene.setPlayer(pos);
|
||||
}
|
||||
}
|
||||
|
||||
private aStarToVec3(str: string) {
|
||||
|
||||
@@ -2,11 +2,8 @@ import { Camera, CCBoolean, Component, EventTouch, Node, screen, Size, Texture2D
|
||||
import { oops } from "../../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import MapData from "./map/base/MapData";
|
||||
import { MapLoadModel } from "./map/base/MapLoadModel";
|
||||
import MapParams from "./map/base/MapParams";
|
||||
import Charactor from "./map/charactor/Charactor";
|
||||
import EntityLayer from "./map/layer/EntityLayer";
|
||||
import MapLayer from "./map/layer/MapLayer";
|
||||
import IRoadSeeker from "./map/road/IRoadSeeker";
|
||||
import RoadNode from "./map/road/RoadNode";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
@@ -39,24 +36,9 @@ export class MapViewScene extends Component {
|
||||
ratio: Vec2 = new Vec2();
|
||||
|
||||
private _roadDic: { [key: string]: RoadNode } = {};
|
||||
private _roadSeeker!: IRoadSeeker;
|
||||
private _mapParams: MapParams | null = null;
|
||||
|
||||
private player: Charactor | null = null; // 主角玩家
|
||||
private targetPos: Vec3 = new Vec3(); // 摄像机位置
|
||||
private winSize!: Size; // 屏幕尺寸
|
||||
private screenCenter: Vec3 = new Vec3(); // 屏幕中心位置
|
||||
private boundary: Vec2 = new Vec2(); // 边界位置
|
||||
|
||||
setPlayer(value: Charactor | Vec3) {
|
||||
if (value instanceof Charactor) {
|
||||
this.enabled = true;
|
||||
this.player = value;
|
||||
}
|
||||
else {
|
||||
this.player!.pos = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onLoad() {
|
||||
this.enabled = false;
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
*/
|
||||
import { Component, Node, _decorator } from 'cc';
|
||||
import { Timer } from '../../../../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer';
|
||||
import Charactor from '../charactor/Charactor';
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -21,15 +20,16 @@ export default class EntityLayer extends Component {
|
||||
private timer: Timer = new Timer(0.2);
|
||||
|
||||
update(dt: number) {
|
||||
if (this.timer.update(dt))
|
||||
this.node.children.sort(this.zIndexSort);
|
||||
this.timer.update(dt)
|
||||
// if (this.timer.update(dt))
|
||||
// this.node.children.sort(this.zIndexSort);
|
||||
}
|
||||
|
||||
private zIndexSort(a: Node, b: Node) {
|
||||
let a_zIndex = a.getComponent(Charactor)!.zIndex;
|
||||
let b_zIndex = b.getComponent(Charactor)!.zIndex;
|
||||
return a_zIndex - b_zIndex;
|
||||
}
|
||||
// private zIndexSort(a: Node, b: Node) {
|
||||
// let a_zIndex = a.getComponent(Charactor)!.zIndex;
|
||||
// let b_zIndex = b.getComponent(Charactor)!.zIndex;
|
||||
// return a_zIndex - b_zIndex;
|
||||
// }
|
||||
|
||||
public clear() {
|
||||
this.node.children.forEach(n => {
|
||||
|
||||
Reference in New Issue
Block a user