mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-05 23:05:01 +08:00
Added getAnimationState.
This commit is contained in:
parent
fa0267e9e2
commit
d0732921c9
@ -46,6 +46,7 @@ Draws an animated skeleton, providing a simple API for applying one or more anim
|
||||
|
||||
- (void) addAnimationState;
|
||||
- (void) addAnimationState:(AnimationStateData*)stateData;
|
||||
- (AnimationState*) getAnimationState:(int)stateIndex;
|
||||
- (void) setAnimationStateData:(AnimationStateData*)stateData forState:(int)stateIndex;
|
||||
|
||||
- (void) setMixFrom:(NSString*)fromAnimation to:(NSString*)toAnimation duration:(float)duration;
|
||||
|
||||
@ -115,6 +115,11 @@
|
||||
[_states addObject:[NSValue valueWithPointer:state]];
|
||||
}
|
||||
|
||||
- (AnimationState*) getAnimationState:(int)stateIndex {
|
||||
NSAssert(stateIndex >= 0 && stateIndex < (int)_states.count, @"stateIndex out of range.");
|
||||
return [[_states objectAtIndex:stateIndex] pointerValue];
|
||||
}
|
||||
|
||||
- (void) setAnimationStateData:(AnimationStateData*)stateData forState:(int)stateIndex {
|
||||
NSAssert(stateData, @"stateData cannot be null.");
|
||||
NSAssert(stateIndex >= 0 && stateIndex < (int)_states.count, @"stateIndex out of range.");
|
||||
|
||||
@ -95,6 +95,11 @@ void CCSkeletonAnimation::addAnimationState (AnimationStateData* stateData) {
|
||||
states.push_back(state);
|
||||
}
|
||||
|
||||
AnimationState* getAnimationState (int stateIndex) {
|
||||
CCAssert(stateIndex >= 0 && stateIndex < (int)states.size(), "stateIndex out of range.");
|
||||
return states[stateIndex];
|
||||
}
|
||||
|
||||
void CCSkeletonAnimation::setAnimationStateData (AnimationStateData* stateData, int stateIndex) {
|
||||
CCAssert(stateIndex >= 0 && stateIndex < (int)states.size(), "stateIndex out of range.");
|
||||
CCAssert(stateData, "stateData cannot be null.");
|
||||
|
||||
@ -53,6 +53,7 @@ public:
|
||||
|
||||
void addAnimationState (AnimationStateData* stateData = 0);
|
||||
void setAnimationStateData (AnimationStateData* stateData, int stateIndex = 0);
|
||||
AnimationState* getAnimationState (int stateIndex = 0);
|
||||
void setMix (const char* fromAnimation, const char* toAnimation, float duration, int stateIndex = 0);
|
||||
void setAnimation (const char* name, bool loop, int stateIndex = 0);
|
||||
void addAnimation (const char* name, bool loop, float delay = 0, int stateIndex = 0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user