Combine Studio change for ActionTimeline

This commit is contained in:
XiaoFeng 2015-11-16 15:56:23 +08:00
parent a0c7e10a82
commit e313f7be8b
1 changed files with 24 additions and 0 deletions

View File

@ -618,20 +618,44 @@ void InnerActionFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
void InnerActionFrame::setStartFrameIndex(int frameIndex) void InnerActionFrame::setStartFrameIndex(int frameIndex)
{ {
#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only
if (_enterWithName)
{
CCLOG(" cannot set start when enter frame with name. setEnterWithName false firstly!");
throw std::exception();
}
#else
CCASSERT(!_enterWithName, " cannot setStartFrameIndex when enterWithName is set"); CCASSERT(!_enterWithName, " cannot setStartFrameIndex when enterWithName is set");
#endif
_startFrameIndex = frameIndex; _startFrameIndex = frameIndex;
} }
void InnerActionFrame::setEndFrameIndex(int frameIndex) void InnerActionFrame::setEndFrameIndex(int frameIndex)
{ {
#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only
if (_enterWithName)
{
CCLOG(" cannot set end when enter frame with name. setEnterWithName false firstly!");
throw std::exception();
}
#else
CCASSERT(!_enterWithName, " cannot setEndFrameIndex when enterWithName is set"); CCASSERT(!_enterWithName, " cannot setEndFrameIndex when enterWithName is set");
#endif
_endFrameIndex = frameIndex; _endFrameIndex = frameIndex;
} }
void InnerActionFrame::setAnimationName(const std::string& animationName) void InnerActionFrame::setAnimationName(const std::string& animationName)
{ {
#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only
if (!_enterWithName)
{
CCLOG(" cannot set aniamtioname when enter frame with index. setEnterWithName true firstly!");
throw std::exception();
}
#else
CCASSERT(_enterWithName, " cannot set aniamtioname when enter frame with index. setEnterWithName true firstly!"); CCASSERT(_enterWithName, " cannot set aniamtioname when enter frame with index. setEnterWithName true firstly!");
#endif
_animationName = animationName; _animationName = animationName;
} }