mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-06 02:36: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();
|
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
|
#undef LOCTEXT_NAMESPACE
|
||||||
|
|||||||
@ -40,8 +40,7 @@ void USpineSkeletonRendererComponent::TickComponent (float DeltaTime, ELevelTick
|
|||||||
pageToMaterial.Add(currPage, material);
|
pageToMaterial.Add(currPage, material);
|
||||||
currPage = currPage->next;
|
currPage = currPage->next;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
pageToMaterial.Empty();
|
pageToMaterial.Empty();
|
||||||
spAtlasPage* currPage = skeleton->Atlas->GetAtlas(false)->pages;
|
spAtlasPage* currPage = skeleton->Atlas->GetAtlas(false)->pages;
|
||||||
for (int i = 0; i < skeleton->Atlas->atlasPages.Num(); i++) {
|
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 TickComponent (float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
||||||
|
|
||||||
virtual void FinishDestroy () 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:
|
protected:
|
||||||
void DisposeState();
|
void DisposeState();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user