* Added Initialize System

This commit is contained in:
LongLy 2024-11-07 13:35:04 -07:00
parent bf2e27bd0a
commit 5ca56f96ae
8 changed files with 233 additions and 835 deletions

View File

@ -1,7 +1,7 @@
/Engine=C:/Program Files/Epic Games/UE_5.4/Engine/Shaders
/ShaderAutogen=H:/Projects/OLS/Intermediate/ShaderAutogen
/Plugin/FX/Niagara=C:/Program Files/Epic Games/UE_5.4/Engine/Plugins/FX/Niagara/Shaders
/Plugin/ExrReaderShaders=C:/Program Files/Epic Games/UE_5.4/Engine/Plugins/Media/ImgMedia/Shaders
/Plugin/WmfMedia=C:/Program Files/Epic Games/UE_5.4/Engine/Plugins/Media/WmfMedia/Shaders
/Plugin/FX/Niagara=C:/Program Files/Epic Games/UE_5.4/Engine/Plugins/FX/Niagara/Shaders
/Plugin/GLTFExporter=C:/Program Files/Epic Games/UE_5.4/Engine/Plugins/Enterprise/GLTFExporter/Shaders
/Plugin/Experimental/ChaosNiagara=C:/Program Files/Epic Games/UE_5.4/Engine/Plugins/Experimental/ChaosNiagara/Shaders

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 53 KiB

File diff suppressed because it is too large Load Diff

View File

@ -23,13 +23,20 @@ void UOLSLocomotionComponent::PostInitProperties()
Gaits.Add(EOLSGait::ESprint, 0.f);
}
// Called when the game starts
void UOLSLocomotionComponent::BeginPlay()
// Called every frame
void UOLSLocomotionComponent::TickComponent(float deltaTime, ELevelTick tickType,
FActorComponentTickFunction* thisTickFunction)
{
Super::BeginPlay();
Super::TickComponent(deltaTime, tickType, thisTickFunction);
// ...
UpdateEssentialValues(deltaTime);
UpdateGait(deltaTime);
}
void UOLSLocomotionComponent::Initialize()
{
if (const TObjectPtr<APawn> owningPawn = Cast<APawn>(GetOwner()))
{
OwningPawn = owningPawn;
@ -48,18 +55,6 @@ void UOLSLocomotionComponent::BeginPlay()
SetRotationMode(DesiredRotationMode, true);
}
// Called every frame
void UOLSLocomotionComponent::TickComponent(float deltaTime, ELevelTick tickType,
FActorComponentTickFunction* thisTickFunction)
{
Super::TickComponent(deltaTime, tickType, thisTickFunction);
// ...
UpdateEssentialValues(deltaTime);
UpdateGait(deltaTime);
}
EOLSGait UOLSLocomotionComponent::GetAllowedGait() const
{
if (Stance == EOLSStance::EStanding)

View File

@ -24,10 +24,13 @@ protected:
//~ UActorComponent BEGIN
virtual void PostInitProperties() override;
virtual void BeginPlay() override;
virtual void TickComponent(float deltaTime, ELevelTick tickType,
FActorComponentTickFunction* thisTickFunction) override;
//~ UActorComponent END
public:
virtual void Initialize();
protected:

View File

@ -28,7 +28,17 @@ void AOLSCharacter::BeginPlay()
{
Super::BeginPlay();
LocomotionComponent->GetOnRotationModeChangedNativeDelegate().AddUObject(this, &ThisClass::OnRotationModeChanged);
InitializeSystems();
}
void AOLSCharacter::InitializeSystems()
{
if (LocomotionComponent)
{
LocomotionComponent->GetOnRotationModeChangedNativeDelegate().AddUObject(this, &ThisClass::OnRotationModeChanged);
LocomotionComponent->Initialize();
}
}
// Called every frame

View File

@ -26,6 +26,8 @@ protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
virtual void InitializeSystems();
public:
// Called every frame