.h
#include “cocos2d.h”
#include “cocos-ext.h”
#include “cocostudio\CCArmature.h”
#include “cocostudio\CCArmatureAnimation.h”
USING_NS_CC;
using namespace cocostudio;
class WaterEffect : public cocos2d::CCNode
{
private:
void onPlayEffect(Armature *pArmature, cocostudio::MovementEventType eventType, const char *animationID);
}
.cpp
using namespace cocostudio;
void WaterEffect::onPlayEffect(Armature *pArmature, cocostudio::MovementEventType eventType, const char *animationID)
{
/// COMPLETE–只有在动作设置为不循环播放时才在动画结束响应一次
if (eventType == COMPLETE)
{
this->removeAllChildren();
}
}
