public void play(string effect, string subPath, List <Vector2> posList, bool loop, float animSpeed, bool forcePlay = false) { // 如果动作名相同,并且不是强制重新播放,则不播放动作 if (mEffectNode.getTextureSet() == effect && mEffectNode.getSubPath() == subPath && mEffectNode.getPlayState() == PLAY_STATE.PS_PLAY && !forcePlay) { logInfo("play same animation!"); return; } mEffectNode.setTextureSet(effect, subPath); mEffectNode.stop(true, false); mEffectNode.play(); setTexturePosList(posList); setLoop(loop); setPlaySpeed(animSpeed); mEffectNode.addPlayingCallback(onAnimationPlaying); }