The following methods can be used to generate and build a map during runtime. Please see the runtime demo in the demo scenes for an example.
//Namespace using TileWorld; // Generate and build a map from scratch // _merge = if the map should be merged after generation TileWorldCreator.GenerateAndBuild( bool _merge ); // Only generate a map without building it TileWorldCreator.GenerateMaps(); // Build a map after generation // _coroutine = use coroutine to build map (recommended when using this at runtime) // _merge = should the map be merged after generation // _optimize = use the optimization pass (recommended) TileWorldCreator.BuildMapComplete( bool _coroutine, bool _merge, bool _optimize );
When using an existing configuration, you only have to call the method:
on the TileWorldCreator to generate and build a complete map.
If you only want to generate a map without building it, you can call:
You can access all configuration properties during runtime using:
Creating a new configuration during runtime is simple. Just follow these steps:
// Assign current configuration, this is important if we want to preserve the assigned tiles of the current configuration for the new config. var _currentConfig = TileWorldCreator.configuration; // Create a new configuration and set the preserve presets option to true var _newConfig = TileWorldConfiguration.NewConfiguration(_currentConfig, true);
TileWorldCreator.configuration = _newConfig;