You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Lots of change in here: - Improved UActorAnimationPlayer functionality to include looping and play speed (UI needs polish) - Fixed actor object bindings not working in PIE. We now only store the object GUID (and an object path for a fallback), which can then be fixed up within a given context (UWorld for now). - Added UActorAnimationInstance which is responsible for managing bindings on a UActorAnimation. UActorAnimation itself is now pretty much just a data asset. - Levels are no longer responsible for ticking actor animations, this is now handled by the client (either AMovieSceneActor, or ticked automatically if created from a blueprint node) [CL 2696822 by Andrew Rodham in Main branch]
79 lines
1.8 KiB
C++
79 lines
1.8 KiB
C++
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "ActorAnimationObject.generated.h"
|
|
|
|
|
|
/**
|
|
* Structure for animated Actor objects.
|
|
*/
|
|
USTRUCT()
|
|
struct FActorAnimationObject
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
|
|
/** Creates and initializes a new instance. */
|
|
FActorAnimationObject()
|
|
: ObjectOrOwner(nullptr)
|
|
, CachedComponent(nullptr)
|
|
{ }
|
|
|
|
/**
|
|
* Creates and initializes a new instance from an object.
|
|
*
|
|
* @param InObject The object to be bound.
|
|
*/
|
|
FActorAnimationObject(UObject* InObject)
|
|
: ObjectOrOwner(InObject)
|
|
, CachedComponent(nullptr)
|
|
{ }
|
|
|
|
/**
|
|
* Creates and initializes a new instance from an object component.
|
|
*
|
|
* @param InOwner The object that owns the component.
|
|
* @param InComponentName The component to be bound.
|
|
*/
|
|
FActorAnimationObject(UObject* InOwner, FString InComponentName)
|
|
: ObjectOrOwner(InOwner)
|
|
, ComponentName(InComponentName)
|
|
, CachedComponent(nullptr)
|
|
{ }
|
|
|
|
/**
|
|
* Compares two bindings for equality.
|
|
*
|
|
* @param X The first binding to compare.
|
|
* @param Y The second binding to compare.
|
|
* @return true if the bindings refer to the same object, false otherwise.
|
|
*/
|
|
friend bool operator==(const FActorAnimationObject& X, const FActorAnimationObject& Y)
|
|
{
|
|
return (X.ObjectOrOwner == Y.ObjectOrOwner) && (X.ComponentName == Y.ComponentName);
|
|
}
|
|
|
|
/**
|
|
* Gets a pointer to the possessed object.
|
|
*
|
|
* @return The object (usually an Actor or an ActorComponent).
|
|
*/
|
|
ACTORANIMATION_API UObject* GetObject() const;
|
|
|
|
private:
|
|
|
|
/** The object or the owner of the object being possessed. */
|
|
UPROPERTY()
|
|
TLazyObjectPtr<UObject> ObjectOrOwner;
|
|
|
|
/** Optional name of an ActorComponent. */
|
|
UPROPERTY()
|
|
FString ComponentName;
|
|
|
|
/** Cached pointer to the Actor component (only if ComponentName is set). */
|
|
UPROPERTY(transient)
|
|
mutable TWeakObjectPtr<UObject> CachedComponent;
|
|
};
|