技能动画添加

This commit is contained in:
2025-01-05 09:10:21 +08:00
parent 66f4a0de82
commit 511459c66c
118 changed files with 22272 additions and 8796 deletions

View File

@@ -3,6 +3,7 @@ import { HeroViewComp } from './HeroViewComp';
import { oops } from 'db://oops-framework/core/Oops';
import { ecs } from 'db://oops-framework/libs/ecs/ECS';
import { Tooltip } from '../skills/Tooltip';
import { timedCom } from '../skills/timedCom';
const { ccclass, property } = _decorator;
@ccclass('BuffComp')
@@ -25,9 +26,7 @@ export class BuffComp extends Component {
dehp_cd:number=0;
decrit_cd:number=0;
iced_cd:number=0;
buff_cd:number=0;
yun_cd:number=0;
wind_cd:number=0;
speek_time:number=0;
@@ -108,16 +107,6 @@ export class BuffComp extends Component {
}
if(this.yun_cd > 0 ) this.yun_cd -= deltaTime;
if(this.yun_cd <= 0 && this.node.getChildByName("yun").active){
this.node.getChildByName("yun").active = false;
}
if(this.iced_cd > 0 ) this.iced_cd -= deltaTime;
if(this.iced_cd <= 0 && this.node.getChildByName("iced").active){
this.node.getChildByName("iced").active = false;
}
if(this.buff_cd > 0 ) this.buff_cd -= deltaTime;
if(this.buff_cd <= 0 && this.node.getChildByName("buff").active){
this.node.getChildByName("buff").active = false;
@@ -175,14 +164,6 @@ export class BuffComp extends Component {
this.node.getChildByName("top").getChildByName("buff").getChildByName("crit").active = true;
}
show_iced(t:number=1){
this.iced_cd = t;
this.node.getChildByName("iced").active = true;
}
show_yun(t:number=1){
this.iced_cd = t;
this.node.getChildByName("yun").active = true;
}
show_wind(t:number=1){
this.wind_cd = t;
@@ -226,7 +207,21 @@ export class BuffComp extends Component {
node.setPosition(pos)
node.parent = this.node;
}
in_iced(t:number=1) {
var path = "game/skills/iced";
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
node.getComponent(timedCom).time = t;
node.parent = this.node;
}
in_yun(t:number=1) {
var path = "game/skills/yun";
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
node.setPosition(v3(0,90));
node.getComponent(timedCom).time = t;
node.parent = this.node;
}
to_speek(words:string,time:number=0.5){
this.speek_time=0.5
this.node.getChildByName("tooltip").active=true