Instancers - elmortem/levelgenerator GitHub Wiki

MonoBehaviour based component. Instancers create your objects in the scene, which are sent to ResultNode by InstanceData lists. You can have multiple instancers for each InstanceData type.

Interface IInstancer

int ObjectsCount { get; } - objects count, created and saved in instancer

bool TryAddInstances(IEnumerable instances) - main method to create objects

void RemoveAll() - remove all created and saved objects from instancer

void RaiseChange() - mark parent GameObject is dirty

Samples

SampleGameObjectInstancer - create prefab instances (GameObjectInstanceData)

SampleSpriteShapeInstancer - create SpriteShape object (SpriteShapeInstanceData)

Custom instancers

You can make custom instancers for inheritor of InstanceData. You may need to create your own node that will return lists of your InstanceData to ResultNode.