mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-05 06:44:56 +08:00
[ue4] Initial set of blueprint functions
This commit is contained in:
parent
a46839336a
commit
f31c298528
@ -59,4 +59,40 @@ void USpineSkeletonComponent::FinishDestroy () {
|
||||
Super::FinishDestroy();
|
||||
}
|
||||
|
||||
void USpineSkeletonComponent::SetAnimation (int trackIndex, FString animationName, bool loop) {
|
||||
if (state) {
|
||||
spAnimationState_setAnimationByName(state, trackIndex, TCHAR_TO_UTF8(*animationName), loop ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
void USpineSkeletonComponent::AddAnimation (int trackIndex, FString animationName, bool loop, float delay) {
|
||||
if (state) {
|
||||
spAnimationState_addAnimationByName(state, trackIndex, TCHAR_TO_UTF8(*animationName), loop ? 1 : 0, delay);
|
||||
}
|
||||
}
|
||||
|
||||
void USpineSkeletonComponent::SetEmptyAnimation (int trackIndex, float mixDuration) {
|
||||
if (state) {
|
||||
spAnimationState_setEmptyAnimation(state, trackIndex, mixDuration);
|
||||
}
|
||||
}
|
||||
|
||||
void USpineSkeletonComponent::AddEmptyAnimation (int trackIndex, float mixDuration, float delay) {
|
||||
if (state) {
|
||||
spAnimationState_addAnimationByName(state, trackIndex, mixDuration, delay);
|
||||
}
|
||||
}
|
||||
|
||||
void USpineSkeletonComponent::ClearTracks () {
|
||||
if (state) {
|
||||
spAnimationState_clearTracks(state);
|
||||
}
|
||||
}
|
||||
|
||||
void USpineSkeletonComponent::ClearTrack (int trackIndex) {
|
||||
if (state) {
|
||||
spAnimationState_clearTrack(state, trackIndex);
|
||||
}
|
||||
}
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
||||
|
||||
@ -40,8 +40,7 @@ void USpineSkeletonRendererComponent::TickComponent (float DeltaTime, ELevelTick
|
||||
pageToMaterial.Add(currPage, material);
|
||||
currPage = currPage->next;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
pageToMaterial.Empty();
|
||||
spAtlasPage* currPage = skeleton->Atlas->GetAtlas(false)->pages;
|
||||
for (int i = 0; i < skeleton->Atlas->atlasPages.Num(); i++) {
|
||||
|
||||
@ -31,7 +31,26 @@ public:
|
||||
virtual void TickComponent (float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
||||
|
||||
virtual void FinishDestroy () override;
|
||||
|
||||
|
||||
// Blueprint functions
|
||||
UFUNCTION(BlueprintCallable, Category="Components|Spine")
|
||||
void SetAnimation (int trackIndex, FString animationName, bool loop);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="Components|Spine")
|
||||
void AddAnimation (int trackIndex, FString animationName, bool loop, float delay);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="Components|Spine")
|
||||
void SetEmptyAnimation (int trackIndex, float mixDuration);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="Components|Spine")
|
||||
void AddEmptyAnimation (int trackIndex, float mixDuration, float delay);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="Components|Spine")
|
||||
void ClearTracks ();
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="Components|Spine")
|
||||
void ClearTrack (int trackIndex);
|
||||
|
||||
protected:
|
||||
void DisposeState();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user