import { _decorator, Component, Node, Label, find, JsonAsset, Collider2D, RigidBody2D, ERigidBody2DType, BoxCollider2D, Tween, tween, Vec3, Color } from 'cc'; import { SaveDataManager } from '../LevelSystem/SaveDataManager'; import EventBus, { GameEvents } from '../Core/EventBus'; import { JsonConfigLoader } from '../Core/JsonConfigLoader'; import { SkillManager } from './SkillSelection/SkillManager'; const { ccclass, property } = _decorator; /** * 墙体组件 * 负责管理墙体的血量、伤害处理、等级升级等功能 */ @ccclass('Wall') export class Wall extends Component { @property({ type: Node, tooltip: '血量显示节点 (HeartLabel)' }) public heartLabelNode: Node = null; // === 私有属性 === private currentHealth: number = 100; private heartLabel: Label = null; private saveDataManager: SaveDataManager = null; // 墙体配置数据 private wallConfig: any = null; private wallHpMap: Record = {}; // 动画相关属性 private originalLabelColor: Color = null; private damageAnimationTween: Tween = null; private colorAnimationTween: Tween