I would like to have two alternative layouts based on the configurations my users will select on settings - e.g., if playing the game on “super easy” the layout will be one, and if playing on “super hard” the layout will be another.
With Scriptable Objects, I could make the game objects on my scene know the values they should use based on the asset file that corresponds to the current difficulty - i.g., DifficultyConfiguration1 or DifficultyConfiguration2 files (from DifficultyConfiguration : Scriptable Object).
Now, I would like to avoid having to declare every single variable of every single property of any component, attached to a game object on my scene, that I want its properties to vary. For example, if I want the Rect Transform of a panel to vary (e.g., its width, height, pos x, etc.,), I would not like having to declare every single of them on my DifficultyConfiguration script. It would be just very tedious, because there are just enough panels that I want to readjust based on the values of my DifficultyConfiguration file.
This is what I attempted first, but then realized that it doesn’t work because Assets cannot reference GameObjects in the scene.
-
To create a ScriptableObject where I could “save” the property values that I would like to use depending on the “current” DifficultyConfiguration file.
-
But then, I can’t drag the components from my scene onto my DifficultyConfiguration files (again, because Assets can’t reference GameObjects on the scene - and this is how I realized it).
But, actually, I never intended to reference any GameObject on my scene, as I explained. What I want is to hold a copy of the property values of the, for example, RectTransform components (of the relevant GameObjects) on my difficulty configuration files. Is that even possible? Or any ideas on how I can achieve a similar mechanism?
(Again, in the worst case, I would declare every single variable for every property value of each relevant GameObject; but ones are trickier than others, like the Anchor Presets. I don’t want to go that way at all.)