mirror of
https://github.com/Ed94/Cog.git
synced 2026-06-13 00:01:37 -07:00
6d9494b685
Cog integration has been reworked to make it easier, to keep Cog available between level loadings, and to properly tick ImGui while the game is paused. Cog 's WindowManager is now a GameInstanceSubsystem. The WindowManager ticks ImGui and the windows during the OnWorldPostActorTick delegate. (If this is not working for your project, don't hesitate to open an issue.) Check the readme to see how to integrate Cog. The Plot debug functions (displayed by the Engine/Plot window) have been reworked as they were not properly working in Multi PIE in Single Process. API changes: - use FCogDebug::Plot instead of FCogDebugPlot::PlotValue - use FCogDebug::InstantEvent instead of FCogDebugPlot::PlotEventInstant - use FCogDebug::StartEvent instead of FCogDebugPlot::PlotEventStart - use FCogDebug::StopEvent instead of FCogDebugPlot::PlotEventStop
52 lines
2.2 KiB
C++
52 lines
2.2 KiB
C++
#include "CogSampleAnimNotify.h"
|
|
|
|
#include "CogCommon.h"
|
|
|
|
#include "Animation/AnimSequenceBase.h"
|
|
#include "Components/SkeletalMeshComponent.h"
|
|
|
|
#if ENABLE_COG
|
|
#include "CogDebug.h"
|
|
#endif
|
|
|
|
//--------------------------------------------------------------------------------------------------------------------------
|
|
UCogSampleAnimNotify::UCogSampleAnimNotify(const FObjectInitializer& ObjectInitializer)
|
|
: Super(ObjectInitializer)
|
|
{
|
|
bIsNativeBranchingPoint = true;
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------------------------------
|
|
void UCogSampleAnimNotify::Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, const FAnimNotifyEventReference& EventReference)
|
|
{
|
|
Super::Notify(MeshComp, Animation, EventReference);
|
|
|
|
#if ENABLE_COG
|
|
FCogDebug::InstantEvent(MeshComp->GetOwner(), "Anim Notify", GetFName())
|
|
.AddParam("Name", GetNameSafe(this))
|
|
.AddParam("Animation", GetNameSafe(Animation))
|
|
.AddParam("Debug Info", GetDebugInfo());
|
|
#endif
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------------------------------
|
|
void UCogSampleAnimNotify::BranchingPointNotify(FBranchingPointNotifyPayload& BranchingPointPayload)
|
|
{
|
|
//--------------------------------------------------------------------------------------------------------
|
|
// Replace UAnimNotify::BranchingPointNotify to fill the EventReference with the NotifyEvent for
|
|
// UGPCoreAnimMotifyFunctionLibrary::AnimNotifyEventReferenceGetMontage to work properly
|
|
//--------------------------------------------------------------------------------------------------------
|
|
// Super::BranchingPointNotify(BranchingPointPayload);
|
|
const FAnimNotifyEventReference EventReference(BranchingPointPayload.NotifyEvent,
|
|
BranchingPointPayload.SequenceAsset);
|
|
|
|
Notify(BranchingPointPayload.SkelMeshComponent, BranchingPointPayload.SequenceAsset, EventReference);
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------------------------------
|
|
FString UCogSampleAnimNotify::GetDebugInfo_Implementation() const
|
|
{
|
|
FString DebugInfo;
|
|
return DebugInfo;
|
|
}
|
|
|