手动控制spine 动画

This commit is contained in:
pan@work
2024-07-19 17:11:19 +08:00
parent f34018ac59
commit d80f16a0f7
22 changed files with 675 additions and 1221 deletions

View File

@@ -7,30 +7,18 @@
import { Component, v3, _decorator } from "cc";
import { smc } from "../../common/SingletonModuleComp";
import Charactor from "../../map/view/map/charactor/Charactor";
import MapRoadUtils from "../../map/view/map/road/MapRoadUtils";
import RoadNode from "../../map/view/map/road/RoadNode";
const { ccclass, property } = _decorator;
@ccclass('RoleViewOwn')
export class RoleViewOwn extends Component {
private charactor!: Charactor;
onLoad() {
this.charactor = this.getComponent(Charactor)!;
this.node.on(Charactor.NextRoadNode, this.onNextRoadNode, this);
}
private onNextRoadNode(rn: RoadNode) {
var key: string = rn.dx + "," + rn.dy;
var mv = smc.map.MapView;
var delivery = mv.deliverys.get(key);
if (delivery && mv.isTransfer == false) {
this.charactor.stop();
mv.transfer(delivery.toMapId, this.aStarToVec3(delivery.start));
}
}
private aStarToVec3(str: string) {
let array = str.split(",");