DemoTileInjector.cs 635 B

12345678910111213141516171819202122232425
  1. using UnityEngine;
  2. using System.Collections.Generic;
  3. namespace DunGen.Demo
  4. {
  5. public class DemoTileInjector : MonoBehaviour
  6. {
  7. public RuntimeDungeon RuntimeDungeon;
  8. public TileSet TileSet;
  9. public float NormalizedPathDepth;
  10. public float NormalizedBranchDepth;
  11. public bool IsOnMainPath;
  12. private void Awake()
  13. {
  14. RuntimeDungeon.Generator.TileInjectionMethods += InjectTiles;
  15. }
  16. private void InjectTiles(RandomStream randomStream, ref List<InjectedTile> tilesToInject)
  17. {
  18. tilesToInject.Add(new InjectedTile(TileSet, IsOnMainPath, NormalizedPathDepth, NormalizedBranchDepth));
  19. }
  20. }
  21. }