手动控制spine 动画
This commit is contained in:
@@ -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(",");
|
||||
|
||||
Reference in New Issue
Block a user