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,36 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "CSManagedDelegate.h"
#include "CSManagedGCHandle.h"
#include "UnrealSharpBinds/Public/CSBindsManager.h"
#include "UObject/Object.h"
#include "CSAsyncActionBase.generated.h"
UCLASS()
class UNREALSHARPASYNC_API UCSAsyncActionBase : public UObject
{
GENERATED_BODY()
public:
UFUNCTION(meta = (ScriptMethod))
void Destroy();
protected:
friend class UUCSAsyncBaseExporter;
void InvokeManagedCallback(bool bDispose = true);
void InvokeManagedCallback(UObject* WorldContextObject, bool bDispose = true);
void InitializeManagedCallback(FGCHandleIntPtr Callback);
FCSManagedDelegate ManagedCallback;
};
UCLASS(meta = (InternalType))
class UUCSAsyncBaseExporter : public UObject
{
GENERATED_BODY()
public:
UNREALSHARP_FUNCTION()
static void InitializeAsyncObject(UCSAsyncActionBase* AsyncAction, FGCHandleIntPtr Callback);
};

View File

@ -0,0 +1,18 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "CSAsyncActionBase.h"
#include "CSAsyncLoadPrimaryDataAssets.generated.h"
UCLASS(meta = (InternalType))
class UCSAsyncLoadPrimaryDataAssets : public UCSAsyncActionBase
{
GENERATED_BODY()
public:
UFUNCTION(meta =(ScriptMethod))
void LoadPrimaryDataAssets(const TArray<FPrimaryAssetId>& AssetIds, const TArray<FName>& AssetBundles);
private:
void OnPrimaryDataAssetsLoaded();
};

View File

@ -0,0 +1,20 @@
#pragma once
#include "CoreMinimal.h"
#include "CSAsyncActionBase.h"
#include "CSAsyncLoadSoftObjectPtr.generated.h"
UCLASS(meta = (InternalType))
class UCSAsyncLoadSoftPtr : public UCSAsyncActionBase
{
GENERATED_BODY()
public:
UFUNCTION(meta = (ScriptMethod))
void LoadSoftObjectPaths(const TArray<FSoftObjectPath>& SoftObjectPtr);
protected:
void OnAsyncLoadComplete();
};

View File

@ -0,0 +1,13 @@
#pragma once
#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
DECLARE_LOG_CATEGORY_EXTERN(LogUnrealSharpAsync, Log, All);
class FUnrealSharpAsyncModule : public IModuleInterface
{
public:
virtual void StartupModule() override;
virtual void ShutdownModule() override;
};