代码编译在两个阶段中进行
UnrealBuildTool(UBT)编译*.Target.cs配置
public 构造函数(TargetInfo Target)
{
Type = TargetType.Game;
}
UnrealBuildTool源码中定义的编译目标
public enum TargetType
{
/// <summary>
/// Cooked monolithic game executable (GameName.exe). Also used for a game-agnostic engine executable (UE4Game.exe or RocketGame.exe)
/// </summary>
Game,
/// <summary>
/// Uncooked modular editor executable and DLLs (UE4Editor.exe, UE4Editor*.dll, GameName*.dll)
/// </summary>
Editor,
/// <summary>
/// Cooked monolithic game client executable (GameNameClient.exe, but no server code)
/// </summary>
Client,
/// <summary>
/// Cooked monolithic game server executable (GameNameServer.exe, but no client code)
/// </summary>
Server,
/// <summary>
/// Program (standalone program, e.g. ShaderCompileWorker.exe, can be modular or monolithic depending on the program)
/// </summary>
Program,
}
class FLogWriter
{
void WriteToLog( FString );
};
DECLARE_DELEGATE_OneParam( FStringDelegate, FString );//代理
代理对象绑定
FSharedRef< FLogWriter > LogWriter( new FLogWriter() );
WriteToLogDelegate.BindSP( LogWriter, &FLogWriter::WriteToLog );
WriteToLogDelegate.Execute( TEXT( "Delegates are spiffy!" ) );
蓝图原生化(蓝图转code)
构造脚本在begin play之前