This commit is contained in:
fan 2020-12-29 16:13:44 +08:00
commit 0ea5ba18ab
4 changed files with 50 additions and 29 deletions

View File

@ -84,11 +84,11 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
if(data.type == "TRAIN_PFI_BL"){
if(toptrain.nowcode == data.body.code && topswitch == true){
console.log(data);
//根据上下车人数创建人
jl3d.updateNowLeaveData("top",data.body.out);
setTimeout(function(){
passerAi.passerout("top","start")
passerAi.passerout("top","start",data.body.in)
}, 5000);
}
@ -96,7 +96,7 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
//根据上下车人数创建人
jl3d.updateNowLeaveData("down",data.body.out);
setTimeout(function(){
passerAi.passerout("down","start");
passerAi.passerout("down","start",data.body.in);
}, 5000);
}
}
@ -154,8 +154,9 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
}
}
if(downtrain.nowcode == data.body.code){
// console.log(data.body);
if(data.body.open == "0"){
closetraindoor(downtrain,data.body.doorCode,"down");
@ -165,6 +166,7 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
}
}
}
}
@ -217,7 +219,9 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
location.reload();
});
}
}
let actions;
function opentraindoor(train,doorcode,direct){

View File

@ -261,6 +261,8 @@ export function Jl3dTrafficPlan(dom,skinCode,routegroup,viewMap,initCode) {
//下车控制开关
passerAi.toppasseron = false;
passerAi.downpasseron = false;
passerAi.toppasserinNum = 0;
passerAi.downpasserinNum = 0;
passerTrain.toptrain.nowcode = null;
passerTrain.downtrain.nowcode = null;

View File

@ -8,7 +8,9 @@ export function PasserAi(zone,finder) {
this.downpasseron = false;
//上车控制开关
this.toppasserin = false;
this.toppasserinNum = 0;
this.downpasserin = false;
this.downpasserinNum = 0;
let passerZone = zone;
let pathFinder = finder;
@ -16,18 +18,24 @@ export function PasserAi(zone,finder) {
let playerPosition = new THREE.Vector3( -3.5, 0.5, 5.5 );
let targetPosition = new THREE.Vector3();
//生成下车出站人物
this.passerout = function(direct,mode){
// console.log(direct);
this.passerout = function(direct,mode,inNum){
if(direct == "top"){
// console.log("toppasser");
if(mode == "start"){
scope.toppasseron = true;
scope.toppasserin = true;
scope.toppasserinNum = inNum;
}
if(mode == "end"){
scope.toppasseron = false
scope.toppasserin = false;
}
// scope.toppasseron = true;
// setTimeout(function(){
// scope.toppasseron = false
@ -42,6 +50,7 @@ export function PasserAi(zone,finder) {
if(mode == "start"){
scope.downpasseron = true;
scope.downpasserin = true;
scope.downpasserinNum = inNum;
}
if(mode == "end"){
scope.downpasseron = false;
@ -133,6 +142,7 @@ export function PasserAi(zone,finder) {
}
for(let i=0;i<topWaitPassers.children.length;i++){
if(scope.toppasserinNum >0){
if(topWaitPassers.children[i].status == 0){
//stage = 4 上车
if(topWaitPassers.children[i].stage == 4){
@ -147,6 +157,8 @@ export function PasserAi(zone,finder) {
if(points[1] == undefined){
}else{
scope.toppasserinNum -= 1;
passerHuman.initMoveAnimate(topWaitPassers.children[i],i,points,i);
}
}
@ -154,7 +166,9 @@ export function PasserAi(zone,finder) {
}
}
}
for(let i=0;i<downWaitPassers.children.length;i++){
if(scope.downpasserinNum >0){
if(downWaitPassers.children[i].status == 0){
//stage = 4 上车
if(downWaitPassers.children[i].stage == 4){
@ -168,6 +182,7 @@ export function PasserAi(zone,finder) {
if(points[1] == undefined){
}else{
scope.downpasserinNum -= 1;
passerHuman.initMoveAnimate(downWaitPassers.children[i],i,points,i);
}
}
@ -175,6 +190,8 @@ export function PasserAi(zone,finder) {
}
}
}
for(let i=0;i<humanlist.children.length;i++){
// console.log(humans[i]);

View File

@ -16,13 +16,11 @@ function timedCount(){
// console.log(e.data);
if(e.data[0] == "changespeed"){
if(update){
console.log(e.data[1]);
clearInterval(update);
if(e.data[1] == 0){
}else{
let speed = 900/e.data[1];
console.log(speed);
update = setInterval("stationupdate()", speed);
}