import { _decorator, find } from 'cc'; import SkillBase from './SkillBase'; import { SkillType } from './SkillTypes'; import { SuperTrail } from 'db://assets/mx/components/SuperTrail'; const { ccclass, property } = _decorator; export { SkillType } from './SkillTypes'; @ccclass('Skill') export class Skill extends SkillBase { protected onLoad(): void { super.onLoad(); } protected onEnable(): void { // 拖尾挂到统一层前记录原父节点;采样跟 bullet03,避免打断武器子树合批 const tuowei = find('bullet03/拖尾', this.node); const bullet03 = find('bullet03', this.node); const trailLayer = gg.game?.CurentBattle?.ui_skillTraillayer; if (!tuowei?.isValid || !bullet03?.isValid || !trailLayer?.isValid) return; const st = tuowei.getComponent(SuperTrail); if (!st) return; st.stashOriginalPlacement(); st.followTarget = bullet03; tuowei.setParent(trailLayer, true); gg.game.CurentBattle?.setLayerMask(tuowei, trailLayer.layer); } }