提交挂机模式

This commit is contained in:
PC-20230316NUNE\Administrator
2023-11-01 19:07:15 +08:00
parent 2825c1e1d4
commit 28f2509f14
13 changed files with 159 additions and 6 deletions

View File

@@ -39,6 +39,10 @@ export default class GRoleDefault extends GRoleBase<{}>{
this._isDie = value;
//设置死亡状态
this.fsmAnim.isDie = value;
if(this.isDie){
//死亡回调
this.killBack.forEach(fun => fun(this));
}
}
//角色类型
@@ -60,6 +64,9 @@ export default class GRoleDefault extends GRoleBase<{}>{
//角色技能
skills:GSkillBase[] = [];
//宠物死亡回调
killBack:((role:GRoleDefault) => {})[] = [];
onSyncLoad(){
super.onSyncLoad();
@@ -197,5 +204,10 @@ export default class GRoleDefault extends GRoleBase<{}>{
return null;
}
//添加一个死亡回调
addKillBackEvent(callback:(role:GRoleDefault) => {}){
this.killBack.push(callback);
}
}