This document is about: QUANTUM 2
SWITCH TO

Baking

In addtion to baking using default Quantum AutoBaker (which invokes MapDataBakerCallback.OnBake()), the FPS Template supports baking via the IBakeable interface. Through the interface, the baking of data contained in prefabs is supported as well.

The following code snipped exemplifies the baking of a custom component (data structures Look + Look_Prototype + EntityComponentLook):

C#

public unsafe partial class EntityComponentLook : EntityComponentBase<Look_Prototype>, IBakeable
{
    [SerializeField]
    Transform _lookPosition;
    
    void IBakeable.Bake(MapData data)
    {
        Prototype.LookOffset = (_lookPosition.position - transform.position).ToFPVector3();
    }
}

An overview of the baking process can be visualized in the diagram below (priority: left => right, top => bottom).

fps template entity baking flow
Entity Baking flow
Back to top