Skip to content

Controllers

Ben edited this page Jul 20, 2019 · 2 revisions

HexamapController

MonoBehaviour

This script is the entry point of using the asset in Unity.

  • Generate On Startup : should the map be generated when this script is started ? (this will call Generate() followed by Draw() in the Start method)
  • Settings : the Hexamap settings object to use when generating maps with this controller
  • Parent : the GameObject to use as a parent of the generated tiles. If none is specified, the controller will create a GameObject called "Hexamap" at the root of the scene
  • public void Generate() : generate the data of the map
  • public void Draw() : select prefabs and position them in the scene based on the generated map
  • public void Destroy() : destroy GameObjects and data associated to the map

TileController

MonoBehaviour

This controller will be attached to every tiles generated by the HexamapController. This is the bridge between the GameObject of the tile and the library's model. You can grab the model by accessing the Tile Model property of this script.