Class FlexalonCloner
Sometimes, it's useful to generate child objects instead of defining them statically. The Flexalon Cloner can generate objects from a set of prefabs iteratively or randomly, and can optionally bind to a data source.
Inheritance
object
FlexalonCloner
Syntax
public class FlexalonCloner : MonoBehaviour
Properties
CloneType
In which order should prefabs be cloned.
Declaration
public FlexalonCloner.CloneTypes CloneType { get; set; }
Property Value
Type | Description |
---|---|
FlexalonCloner.CloneTypes |
Count
How many clones should be generated.
Declaration
public uint Count { get; set; }
Property Value
Type | Description |
---|---|
uint |
DataSource
Can be an gameObject with a component that implements FlexalonDataSource. The number of objects cloned is set to the number of items in the Data property.
Declaration
public GameObject DataSource { get; set; }
Property Value
Type | Description |
---|---|
GameObject |
Objects
Prefabs which should be cloned as children.
Declaration
public List<GameObject> Objects { get; set; }
Property Value
Type | Description |
---|---|
List<><GameObject> |
RandomSeed
Seed used for the Random clone type, to ensure results remain consistent.
Declaration
public int RandomSeed { get; set; }
Property Value
Type | Description |
---|---|
int |
Methods
MarkDirty()
Forces the cloner to regenerate its clones.
Declaration
public void MarkDirty()