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).
Back to top