Lua向C#逻辑迁移 一期 #13

将整个插件代码上传
This commit is contained in:
2025-10-26 21:48:39 +08:00
parent 56994b3927
commit 648386cd73
785 changed files with 53683 additions and 2 deletions

View File

@ -0,0 +1,6 @@
#include "CSBlueprintAsyncActionBase.h"
void UCSBlueprintAsyncActionBase::Activate()
{
ReceiveActivate();
}

View File

@ -0,0 +1,25 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintAsyncActionBase.h"
#include "CSBlueprintAsyncActionBase.generated.h"
UCLASS(Blueprintable, BlueprintType, Abstract)
class UNREALSHARPCORE_API UCSBlueprintAsyncActionBase : public UBlueprintAsyncActionBase
{
GENERATED_BODY()
public:
// UBlueprintAsyncActionBase interface
virtual void Activate() override;
//~UBlueprintAsyncActionBase interface
protected:
UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "Activate"))
void ReceiveActivate();
};

View File

@ -0,0 +1,24 @@
#include "CSCancellableAsyncAction.h"
void UCSCancellableAsyncAction::Activate()
{
ReceiveActivate();
#if WITH_EDITOR
FEditorDelegates::PrePIEEnded.AddWeakLambda(this, [this](bool)
{
Cancel();
FEditorDelegates::PrePIEEnded.RemoveAll(this);
});
#endif
}
void UCSCancellableAsyncAction::Cancel()
{
if (HasAnyFlags(RF_ClassDefaultObject | RF_ArchetypeObject) || !IsValid(this) || IsUnreachable())
{
return;
}
ReceiveCancel();
}

View File

@ -0,0 +1,29 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Engine/CancellableAsyncAction.h"
#include "CSCancellableAsyncAction.generated.h"
UCLASS(Blueprintable, BlueprintType, Abstract)
class UNREALSHARPCORE_API UCSCancellableAsyncAction : public UCancellableAsyncAction
{
GENERATED_BODY()
public:
// Start UCancellableAsyncAction Functions
virtual void Activate() override;
virtual void Cancel() override;
// End UCancellableAsyncAction Functions
protected:
UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "Activate"))
void ReceiveActivate();
UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "Cancel"))
void ReceiveCancel();
};