#Request : Baker On scriptableObject

1 messages · Page 1 of 1 (latest)

shadow canyon
#

Why is this not a thing yet ? any specifics reason why we can't do something like what's in the code block.

It Could help A Lot by avoiding redundancy and useless authoring components for nothing 🙂

Plus it could be compatible with addressable & Avoid Subscene Cluttering with SettingAuthoring overload.

    [CreateAssetMenu(fileName = "GameTickSettings", menuName = "ScriptableObjects/GameTickSettings", order = 1)]
    public class SoGameTickSettings : ScriptableObject, IGameSettings
    {
        public GameTickSettingsData Data;

        public class GameTickSettingsBaker : Baker<SoGameTickSettings>
        {
            public override void Bake(SoGameTickSettings authoring)
            {
                Entity current = GetEntity(TransformUsageFlags.None);
                AddComponent(current, authoring.Data);
            }
        }
     
        [Serializable]
        public struct GameTickSettingsData : IComponentData
        {
            public float TickLength;
        }
    }
nova gulch
#

I would say that scriptable objects should usually bake to BlobAssets instead of entities. And I guess this is why it is not as simple as it seems to make it work with a baker similar to MonoBehaviors

shadow canyon
#

Humm if that is the case that's definitely an overlook on my side then ...

slate niche
#

🥲 I would like official to change ScriptableObject default behavior to become exactly like game object prefab that able to reflect and update new changes and just trigger baker to do new update but sadly current ScriptableObject requires you to ctrl + s to trigger baker update which make it extremely hard to make some kind of custom tooling to work properly. Until now I still can't find the way to get the exact behavior like game object prefab

shadow canyon
#

I'm not even sure what the correct pipeline should be. Would love a real life example on that x)

round plaza
slate niche
shadow canyon
#

@slate niche you can have a scriptable that trigger a baker ??

#

how ?

slate niche
shadow canyon
#

huuuuuuuuuuh

#

that's a pain that's what I'm doing with a custom interface that trigger a conversion method at runtime