Work in progress to quickly add random values and setup:
2 new main classes: RandomObjects and ActionCaller
RandomObject.cs
RandomObjects are meant to be the options of the traits, new classes can inherit from RandomObject to specify what type of class must be added (GameObject, Texture, Material, Model etc.), They include a list with:
The possible objects
Their weight (chance to be chosen)
The name of the option of trait
ActionCaller.cs
ActionCaller is meant to do an action with the result of fetching an object from RandomObjects class with the method "Call()", and store the data of that random object and the name of the trait.
Example of actions:
Change the texture of a material (SetTextureToMaterial.cs)
Turn of all options froma randomObjects component, and turn on the chosen one (SetObjectsVisibility.cs)
note: RandomObject.cs may look large, but most of that code is to have a custom inspector to quickly setup options.
Work in progress to quickly add random values and setup:
2 new main classes: RandomObjects and ActionCaller
RandomObject.cs
RandomObjects are meant to be the options of the traits, new classes can inherit from RandomObject to specify what type of class must be added (GameObject, Texture, Material, Model etc.), They include a list with:
ActionCaller.cs
ActionCaller is meant to do an action with the result of fetching an object from RandomObjects class with the method "Call()", and store the data of that random object and the name of the trait. Example of actions:
note: RandomObject.cs may look large, but most of that code is to have a custom inspector to quickly setup options.