Skip to content

Commit

Permalink
[unreal]兼容更早的版本
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Nov 19, 2024
1 parent 10a7530 commit f82ae60
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ private static void UnLuaDefaultParamCollectorUbtPluginExporter(IUhtExportFactor

paramDefaultValueMetas.Generate();

#if UE_5_5_OR_LATER
bool bHasGameRuntime = (from module in factory.Session.Modules where module.Module.ModuleType == UHTModuleType.GameRuntime select module).Any();
#else
bool bHasGameRuntime = (from package in factory.Session.Packages where package.Module.ModuleType == UHTModuleType.GameRuntime select package).Any();
#endif
paramDefaultValueMetas.OutputIfNeeded(bHasGameRuntime);
}

Expand Down Expand Up @@ -61,9 +65,15 @@ private void Generate()
{
GeneratedContentBuilder.Append("// Generated By C# UbtPlugin\r\n");

#if UE_5_5_OR_LATER
var packages = (from module in Factory.Session.Modules
where (module.Module.ModuleType == UHTModuleType.EngineRuntime || module.Module.ModuleType == UHTModuleType.GameRuntime)
select module.ScriptPackage);
#else
var packages = (from package in Factory.Session.Packages
where (package.Module.ModuleType == UHTModuleType.EngineRuntime || package.Module.ModuleType == UHTModuleType.GameRuntime)
select package);
#endif

var classes = packages
.SelectMany(TraverseTree)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
<Import Project="$(EngineDir)\Source\Programs\Shared\UnrealEngine.csproj.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>


<EngineVersion >$([System.Text.RegularExpressions.Regex]::Match($(EngineDir), "\d+.\d+"))</EngineVersion >
<TargetFramework Condition="$([MSBuild]::VersionGreaterThanOrEquals($(EngineVersion), '5.5'))">net8.0</TargetFramework>
<TargetFramework Condition="$([MSBuild]::VersionLessThan($(EngineVersion), '5.5'))">net6.0</TargetFramework>

<Configuration Condition=" '$(Configuration)' == '' ">Development</Configuration>
<OutputType>Library</OutputType>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
Expand Down

0 comments on commit f82ae60

Please sign in to comment.