#Creating singleton data in a baking system.
1 messages · Page 1 of 1 (latest)
singletons aren't really a 'thing'
Im well aware
it just means only 1 of this combination of components exist
just creating new entities in general
so a singleton in baking is just, bake 1 copy of the entity
is it not possible without creating another game object in the heirarchy to bake then?
if the question is actually, how do you instantiate entities in baking that's a very different question that is kind of complicated
but is actually doable
the problem is, how do you define what susbcene to put it in?
unless your project only has 1 subscene it has to be linked to something
true
if you its linked to something, easiest way is to just CreateAdditionalEntity and set it up
it is possible to truly create an entity from scratch in baking systems
you just need to add SceneSection
public struct SceneSection : ISharedComponentData, IEquatable<SceneSection>
{
/// <summary>
/// Unique GUID that identifies the scene where the section is.
/// </summary>
public Hash128 SceneGUID;
/// <summary>
/// Scene section index inside the scene.
/// </summary>
public int Section;```
and writing the subscene guid to it
Ah right