feat(config,skill): 新增通用文字飘字提示功能
1. 新增TooltipTypes.tip枚举类型,支持调用方自定义文字和颜色 2. 扩展Tooltip.load和hp_tip方法,增加tipColor参数传递自定义颜色 3. 新增setupTipLabel工具方法,处理通用文字飘字的UI设置 4. 优化现有tip类型的注释和默认颜色逻辑,修复对象池复用颜色残留问题 5. 修复heroSet.ts导入多余空格问题
This commit is contained in:
@@ -4,7 +4,7 @@ import { BoxSet, FacSet } from "../common/config/GameSet";
|
||||
import { SkillSet } from "../common/config/SkillSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { TooltipCom } from "./TooltipCom";
|
||||
import { instantiate, Node, Prefab, Vec3 ,tween, v3,animation,Label,resources,SpriteFrame,Sprite, NodePool} from "cc";
|
||||
import { instantiate, Node, Prefab, Vec3 ,tween, v3,animation,Label,resources,SpriteFrame,Sprite, NodePool, Color} from "cc";
|
||||
|
||||
/** Skill 模块 */
|
||||
@ecs.register(`Tooltip`)
|
||||
@@ -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,fac:number=FacSet.MON,debuffIcon:string="") {
|
||||
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,debuffIcon:string="",tipColor:Color|null=null) {
|
||||
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, fac, debuffIcon);
|
||||
sv.init(type, vaule, s_uuid, fac, debuffIcon, tipColor);
|
||||
|
||||
// this.add(sv); // 不要添加到单例实体上,否则会覆盖或导致单例被销毁
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user