hero需要重做,去除role 加载,需要关注后续错误

This commit is contained in:
2024-11-12 16:47:41 +08:00
parent be7ea10196
commit 220f595ff6
82 changed files with 1819 additions and 15395 deletions

View File

@@ -23,6 +23,7 @@ import { MoveToComp } from "../common/ecs/position/MoveTo";
import { BoxRangComp } from "./BoxRangComp";
import { MonViewComp } from "../mon/MonViewComp";
import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager";
import { TimerManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/TimerManager";
const { ccclass, property } = _decorator;
/** 角色显示组件 */
@@ -96,8 +97,8 @@ export class HeroViewComp extends CCComp {
dir_y:number = 0;
speek_time:number = 0;
role_heros_index:number = -1;
anm_timer:Timer = new Timer(2);
anm_name="idle"
onLoad() {
this.as = this.getComponent(HeroSpine);
@@ -193,22 +194,45 @@ export class HeroViewComp extends CCComp {
if (this.timer.update(dt)) {
this.power_change(this.power_speed)
}
this.in_destroy();
this.check_buff_atks(dt)
this.in_shield(dt);
this.in_stop(dt);
this.atk_time += dt;
this.check_enemy_alive()
this.in_atk(dt);
this.hp_show()
if(this.anm_timer.update(dt)) {
this.change_anm()
}
// this.in_destroy();
// this.check_buff_atks(dt)
// this.in_shield(dt);
// this.in_stop(dt);
// this.atk_time += dt;
// this.check_enemy_alive()
// this.in_atk(dt);
// this.hp_show()
// this.move(dt);
// this.in_speek(dt);
this.move(dt);
// this.move_to()
// if(this.m_timer.update(dt)){
// this.move_to()
// }
}
change_anm(){
if (this.anm_name == "max"){
this.as.max()
this.anm_name = "idle"
}
if (this.anm_name == "atk") {
this.as.atk()
this.anm_name = "max"
}
if (this.anm_name == "move") {
this.as.move()
this.anm_name = "atk"
}
if (this.anm_name == "idle") {
this.as.idle()
this.anm_name = "move"
}
}
check_enemy_alive(){
let dir = 320
this.enemy = v3(720,this.node.position.y)