This commit is contained in:
PC-20230316NUNE\Administrator
2023-10-24 19:12:25 +08:00
parent 72f3d7e880
commit fb1696d079
24 changed files with 1478 additions and 91 deletions

View File

@@ -1,5 +1,8 @@
import { _decorator, Component, Label, Node } from 'cc';
import { app, JNGLayerBase } from '../../App';
import { director } from 'cc';
import GRolePVPEntity from '../../battle/base/role/PVP/GRolePVPEntity';
import { Toggle } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('HomeView')
@@ -12,6 +15,21 @@ export class HomeView extends JNGLayerBase {
this.frameText.string = `当前帧数: ${app.sync.frame}`;
}
//设置移动
setRoleMove(data:Toggle){
console.log("移动",data.isChecked);
director.getScene().getComponentsInChildren(GRolePVPEntity).forEach((role) => {
role.input.isRun = data.isChecked;
})
}
//设置攻击
setRoleAttack(data){
console.log("攻击",data.isChecked);
director.getScene().getComponentsInChildren(GRolePVPEntity).forEach((role) => {
role.input.isAttack = data.isChecked;
})
}
}