技能layer改变,位置信息修改

This commit is contained in:
walkpan
2025-01-07 07:54:29 +08:00
parent a9a7f076f4
commit ca5adce589
16 changed files with 75 additions and 536 deletions

View File

@@ -4,6 +4,7 @@ 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';
import { smc } from '../common/SingletonModuleComp';
const { ccclass, property } = _decorator;
@ccclass('BuffComp')
@@ -40,6 +41,7 @@ export class BuffComp extends Component {
}
update(deltaTime: number) {
if(smc.mission.pause) return
if(this.ap_cd > 0 ) this.ap_cd -= deltaTime;
if(this.ap_cd <= 0 && this.node.getChildByName("top").getChildByName("buff").getChildByName("ap").active){
this.node.getChildByName("top").getChildByName("buff").getChildByName("ap").active = false;

View File

@@ -1,10 +1,4 @@
/*
* @Author: dgflash
* @Date: 2021-11-18 17:47:56
* @LastEditors: dgflash
* @LastEditTime: 2022-08-04 15:43:04
*/
import { instantiate, Node, Prefab, Vec3 ,v3,resources,SpriteFrame,Sprite,SpriteAtlas} from "cc";
import { UICallbacks } from "../../../../extensions/oops-plugin-framework/assets/core/gui/layer/Defines";
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";

View File

@@ -312,13 +312,12 @@ export class HeroViewComp extends CCComp {
}
skill_pos(){
return v3(0,35)
return v3((this.node.position.x,this.node.position.y + 35))
}
get_enemy_pos(){
let t_pos:Vec3 = v3(720,0)
if(this.enemy){
t_pos = v3(this.enemy.x-this.node.position.x,this.enemy.y-this.node.position.y)
t_pos = v3(this.enemy.x,this.enemy.y)
}
console.log(this.hero_name+":"+this.uuid+"enemy ="+this.enemy.x+" x"+this.node.position.x+" t_pos"+t_pos);
return t_pos
@@ -328,7 +327,7 @@ export class HeroViewComp extends CCComp {
if(!hero.node.isValid){
return
}else{
t_pos = v3(hero.node.position.x-this.node.position.x,hero.node.position.y-this.node.position.y)
t_pos = v3(hero.node.position.x,hero.node.position.y)
}
return t_pos
@@ -555,8 +554,8 @@ export class HeroViewComp extends CCComp {
let skill = ecs.getEntity<Skill>(Skill);
let t_pos=this.get_enemy_pos()
let pos =this.skill_pos()
pos.y=pos.y + y
pos.x=pos.x + x
pos.y=this.node.position.y + y
pos.x=this.node.position.x + x
let is_crit=this.check_crit()
skill.load(pos,this.box_group,this.node,sk,this.ap_max,t_pos,is_crit,this.crit_add);
console.log(this.scale+this.hero_name+"使用技能:"+sk+" t_pos:"+t_pos+" box:"+this.box_group,);