UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ICookInfo.h File Reference
#include "HAL/Platform.h"
#include "Misc/CoreMiscDefines.h"

Go to the source code of this file.

Classes

struct  FCookLoadScope
 

Namespaces

namespace  UE
 
namespace  UE::Cook
 

Enumerations

enum class  ECookLoadType : uint8 { Unspecified , EditorOnly , UsedInGame , UE_DEPRECATED =(5.6, "Use ECookLoadType::Unspecified") = Unspecified }
 

Enumeration Type Documentation

◆ ECookLoadType

enum class ECookLoadType : uint8
strong

A scope around loads when cooking that indicates whether the loaded package is needed in game or not. The default is Unexpected. Declare an FCookLoadScope to set the value.

If the package is marked as EditorOnly, that only suppresses the reference from the LoadPackage call. The package can still be pulled into the cook by UsedInGame references from the AssetRegistry or by being stored as an import in a cooked package.

Packages that are declared in the AssetRegistry as an editoronly reference by the package that loads them are implicitly marked as ECookLoadType::EditorOnly for that load, and do not need an explicitly declared loadtype to be marked as EditorOnly.

LoadTypes also apply to Startup packages, or packages loaded by systems without the load being owned by a referencer package. EditorOnly still suppresses these packages (for that single load) from being added to the cook, UsedInGame still forces them to be added. For Startup packages, marking the package as EditorOnly both removes its auto-inclusion in the cook, and also removes the special chunk rule for startup packages from it, if it ends up being pulled into the cook by another referencer. Startup packages are automatically added to Chunk0 when the project is using multiple pak files (aka streaming chunks); ECookLoadType::EditorOnly removes that chunk rule for the given package.

This enum is declared in non-WITH_EDITOR builds to remove the need for if WITH_EDITOR boilerplate, but it is ignored; all of the functions/classes that use it are noops if !WITH_EDITOR.

Enumerator
Unspecified 
EditorOnly 
UsedInGame 
UE_DEPRECATED