Big refactor of ScriptedAnimations, moved into their own source file, lots of reorganization.
This commit is contained in:
@@ -14,89 +14,6 @@ class UEnhancedInputLocalPlayerSubsystem;
|
||||
class UAnimSequenceBase;
|
||||
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct INTEGRATION_API FlxScriptedAnimation
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
UAnimSequenceBase *Sequence;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay)
|
||||
double FadeIn = 0.0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay)
|
||||
double FadeOut = 0.0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay)
|
||||
double StartTime = 0.0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay)
|
||||
double AdjustedLength = 0.0;
|
||||
};
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct INTEGRATION_API FlxScriptedAnimationProgress : public FlxScriptedAnimation
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay)
|
||||
double UpdateTime = 0.0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay)
|
||||
double EndTime = 0.0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay)
|
||||
double ElapsedTime = 0.0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay)
|
||||
double TimeLeft = 0.0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay)
|
||||
double FadeInAlpha = 0.0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay)
|
||||
double FadeOutAlpha = 0.0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay)
|
||||
double FadeAlpha = 0.0;
|
||||
};
|
||||
|
||||
|
||||
UCLASS(BlueprintType)
|
||||
class INTEGRATION_API UlxScriptedAnimations : public UObject
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
private:
|
||||
UPROPERTY()
|
||||
int KeepCount = 3;
|
||||
|
||||
UPROPERTY()
|
||||
TArray<FlxScriptedAnimation> Animations;
|
||||
|
||||
// If the number of elements in the array exceeds the count, discard.
|
||||
//
|
||||
void Keep(int n);
|
||||
|
||||
public:
|
||||
// Allow read-only access anywhere.
|
||||
//
|
||||
const TArray<FlxScriptedAnimation> &GetAnimations() const { return Animations; }
|
||||
|
||||
// Add a scripted animation to the end of the array.
|
||||
//
|
||||
UFUNCTION(BlueprintCallable, Category = "Luprex|Scripted Animations", meta=(WorldContext = "WorldContextObject"))
|
||||
void AddAnimation(
|
||||
UObject *WorldContextObject, UAnimSequenceBase* Sequence, double FadeInTime = 0.2, double FadeOutTime = 0.2);
|
||||
|
||||
// Truncate all current animations: force them all to begin fading out.
|
||||
//
|
||||
UFUNCTION(BlueprintCallable, Category = "Luprex|Scripted Animations", meta=(WorldContext = "WorldContextObject"))
|
||||
void FadeOutAll(UObject *WorldContextObject);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* UlxUtilityLibrary is for functions that are aren't particularly luprex-specific,
|
||||
@@ -220,29 +137,6 @@ public:
|
||||
UFUNCTION(BlueprintPure, Category="Widget")
|
||||
static void GetPositionOfGridPanelMiddleCell(UGridPanel *GridPanel, FVector2D &UpperLeftXY, FVector2D &LowerRightXY);
|
||||
|
||||
// Calculate the progress of a Scripted Animation.
|
||||
//
|
||||
// Given a scripted animation and the current time, calculates
|
||||
// how much time has elapsed, how much time is left, and several
|
||||
// other parameters pertaining to the passage of time for
|
||||
// this animation.
|
||||
//
|
||||
UFUNCTION(BlueprintPure, Category = "Luprex|Scripted Animations", meta=(BlueprintThreadSafe))
|
||||
static FlxScriptedAnimationProgress ScriptedAnimationProgress(const FlxScriptedAnimation &Animation, double CurrentTime);
|
||||
|
||||
// Get the data to drive Sequence Evaluators and Multi Blend
|
||||
//
|
||||
// To apply scripted animations in an Anim Graph, you will need
|
||||
// three sequence evaluators and a multi-blend node. This
|
||||
// function outputs the input parameters for all of those nodes.
|
||||
//
|
||||
UFUNCTION(BlueprintPure, Category = "Luprex|Scripted Animations", meta=(BlueprintThreadSafe))
|
||||
static void ScriptedAnimationEvaluatorData(const UlxScriptedAnimations *Animations, double CurrentTime,
|
||||
UAnimSequenceBase *&Sequence0, float &ExplicitTime0,
|
||||
UAnimSequenceBase *&Sequence1, float &ExplicitTime1,
|
||||
UAnimSequenceBase *&Sequence2, float &ExplicitTime2,
|
||||
float &BaseAlpha, float &Sequence0Alpha, float &Sequence1Alpha, float &Sequence2Alpha);
|
||||
|
||||
// Check if a given key is used by the specified mapping context.
|
||||
//
|
||||
// This is true if the key is mapped to anything at all within
|
||||
|
||||
Reference in New Issue
Block a user