diff --git a/assets/resources/game/skill/buff/tooltip.prefab b/assets/resources/game/skill/buff/tooltip.prefab index ca2c6ce3..2ff08b71 100644 --- a/assets/resources/game/skill/buff/tooltip.prefab +++ b/assets/resources/game/skill/buff/tooltip.prefab @@ -106,7 +106,7 @@ "__id__": 3 } ], - "_active": true, + "_active": false, "_components": [ { "__id__": 17 @@ -565,7 +565,7 @@ "__id__": 21 } ], - "_active": true, + "_active": false, "_components": [ { "__id__": 35 @@ -2000,8 +2000,8 @@ "_color": { "__type__": "cc.Color", "r": 255, - "g": 68, - "b": 68, + "g": 140, + "b": 0, "a": 255 }, "_string": "9999", diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index e50514d2..981aa2bd 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -286,7 +286,7 @@ export class HeroViewComp extends CCComp { // 起点设为怪物中心位置 + 20偏移 let ny = this.node.position.y + halfHeight + 20; let pos = v3(x, ny, 0); - Tooltip.load(pos, type, value, s_uuid, this.node.parent); + Tooltip.load(pos, type, value, s_uuid, this.node.parent, 1, this.model?.fac ?? FacSet.MON); } /** 护盾吸收提示 */ diff --git a/assets/script/game/skill/Tooltip.ts b/assets/script/game/skill/Tooltip.ts index cac8743c..928fe884 100644 --- a/assets/script/game/skill/Tooltip.ts +++ b/assets/script/game/skill/Tooltip.ts @@ -1,6 +1,6 @@ import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; -import { BoxSet } from "../common/config/GameSet"; +import { BoxSet, FacSet } from "../common/config/GameSet"; import { SkillSet } from "../common/config/SkillSet"; import { smc } from "../common/SingletonModuleComp"; import { TooltipCom } from "./TooltipCom"; @@ -60,7 +60,7 @@ export class Tooltip extends ecs.Entity { this.remove(TooltipCom); super.destroy(); } - static load(pos: Vec3 = Vec3.ZERO,type:number=1,vaule:string="",s_uuid:number=1001,parent:any=null,cd:number=1) { + static load(pos: Vec3 = Vec3.ZERO,type:number=1,vaule:string="",s_uuid:number=1001,parent:any=null,cd:number=1,fac:number=FacSet.MON) { let node: Node; if (Tooltip.pool.size() > 0) { node = Tooltip.pool.get()!; @@ -75,7 +75,7 @@ export class Tooltip extends ecs.Entity { node.active = true; var sv = node.getComponent(TooltipCom)!; - sv.init(type, vaule, s_uuid); + sv.init(type, vaule, s_uuid, fac); // this.add(sv); // 不要添加到单例实体上,否则会覆盖或导致单例被销毁 } diff --git a/assets/script/game/skill/TooltipCom.ts b/assets/script/game/skill/TooltipCom.ts index 97157dc0..053d39cf 100644 --- a/assets/script/game/skill/TooltipCom.ts +++ b/assets/script/game/skill/TooltipCom.ts @@ -2,7 +2,7 @@ import { _decorator, Collider2D, Contact2DType, v3, IPhysics2DContact, Vec3, twe import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; import { SkillSet } from "../common/config/SkillSet"; -import { TooltipTypes } from "../common/config/GameSet"; +import { FacSet, TooltipTypes } from "../common/config/GameSet"; import { Tooltip } from "./Tooltip"; const { ccclass, property } = _decorator; @@ -14,6 +14,7 @@ export class TooltipCom extends CCComp { stype: number = 1; // 1:减少生命值,2:增加生命值,3:技能图标 value: string = ""; s_uuid: number = 1001; + fac: number = FacSet.MON; // 动画参数配置 private readonly popDuration = 0.15; @@ -28,10 +29,11 @@ export class TooltipCom extends CCComp { } /** 初始化并播放动画 */ - init(type: number, value: string, uuid: number) { + init(type: number, value: string, uuid: number, fac: number = FacSet.MON) { this.stype = type; this.value = value; this.s_uuid = uuid; + this.fac = fac; // 初始化或获取 UIOpacity 组件 this._uiOpacity = this.node.getComponent(UIOpacity); @@ -76,7 +78,7 @@ export class TooltipCom extends CCComp { case TooltipTypes.life: // 普通伤害 this.node.setPosition(v3(this.node.position.x + offsetX, currentY)); this.node.setSiblingIndex(topSiblingIndex); - this.setupLabel("loss_life", "hp", this.value); + this.setupLabel(this.fac === FacSet.HERO ? "hloss" : "loss_life", "hp", this.value); scaleMax = 1.5; break; case TooltipTypes.health: // 治疗