Using the event system

TileWorldCreator comes with a simple event system. To use them, use the namespace

using TileWorld.Events;

Events:

// Gets called after map building is complete
OnBuildComplete;

// Gets called after procedural object scattering is complete
OnScatterProceduralComplete;

// Gets called after position based scattering is complete
OnScatterPositionBasedComplete;

// Gets called after merge map is complete
OnMergeComplete;

// Returns a float from 0 - 100 for the map build progress
BuildProgress;

// Returns a float from 0 - 100 for the merge progress
MergeProgress;

Example

using TileWorld.Events;

public void OnEnable()
{
    TileWorldEvents.OnBuildComplete += OnBuildComplete;
}

public void OnDisable()
{
    TileWorldEvents.OnBuildComplete -= OnBuildComplete;
}

public void OnBuildComplete()
{
    Debug.Log("build complete");
}