local play = global.gamePlayerController.mMainPlayerActor.mCurrActorNode
-- 创建粒子效果(以火焰为例)
local function addParticleToNode()
local particle = cc.ParticleFire:create()
particle:setPosition(cc.p(0, 50)) -- 在节点上方 50 像素
particle:setScale(0.8) -- 适当缩放
particle:setDuration(-1) -- 无限循环(-1)
play:addChild(particle)
-- 可选:为粒子命名以便后续操作
play:setTag(10086) -- 给节点打标签
particle:setName("player_effect") -- 为粒子命名
end
-- 调用函数
addParticleToNode()