Adds a 'random seed' value to every game object #370
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This value can be used to initialize things in components with random values, for instance decals use this now to randomly select one of the provided decal assets.
The random seed is either randomly chosen at game object creation time, or it can be fixed (a stable 'random' number). The latter is done by the editor, meaning that all manually placed objects will use a stable seed. Therefore, every decal that was manually placed will use the exact same variation no matter how often the scene is modified or exported.
The former is done for all dynamically created objects, so everything that spawns at runtime will vary truly randomly.
The random seed is propagated through prefabs, so it is now possible that components that are spawned through prefabs vary, but still in a deterministic way, ie. they will be equally stable, if the prefab was instantiated in the editor.