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,47 @@
#pragma once
struct FCSNamespace
{
FCSNamespace(FName InNamespace = NAME_None) : Namespace(InNamespace)
{
}
// Get the namespace as a FName
FName GetFName() const { return Namespace; }
// Get the namespace as a string
FString GetName() const { return Namespace.ToString(); }
// Gets the name of the last part of the namespace. For example, if the namespace is "UnrealSharp.Core", this will return "Core".
FString GetLastNamespace() const;
bool GetParentNamespace(FCSNamespace& OutParent) const;
bool IsValid() const { return Namespace != NAME_None; }
UPackage* GetPackage() const;
UPackage* TryGetAsNativePackage() const
{
FString NativePackageName = FString::Printf(TEXT("/Script/%s"), *GetLastNamespace());
return FindPackage(nullptr, *NativePackageName);
}
FName GetPackageName() const { return *FString::Printf(TEXT("/Script/%s"), *Namespace.ToString()); }
static FCSNamespace Invalid() { return FCSNamespace(); }
bool operator == (const FCSNamespace& Other) const
{
return Namespace == Other.Namespace;
}
friend uint32 GetTypeHash(const FCSNamespace& InNamespace)
{
return GetTypeHash(InNamespace.Namespace);
}
private:
FName Namespace;
};