using System; using System.Collections.Generic; using UnityEngine; namespace DunGen.Collision { /// /// Used to add custom collision detection when deciding where to place tiles /// /// The tile bounds to check collisions for /// If the tile is already deemed to be colliding the dungeon itself /// True if the new tile bounds are blocked public delegate bool AdditionalCollisionsPredicate(Bounds tileBounds, bool isCollidingWithDungeon); [Serializable] public class DungeonCollisionSettings { /// /// If true, tiles will not be allowed to overhang other tiles /// public bool DisallowOverhangs = false; /// /// The maximum amount of overlap allowed between two connected tiles /// public float OverlapThreshold = 0.01f; /// /// The amount of padding to add to the bounds of each tile when checking for collisions /// public float Padding = 0.0f; /// /// An optional additional set of bounds to test against when determining if a tile will collide or not. /// Useful for preventing the dungeon from being generated in specific areas /// public readonly List AdditionalCollisionBounds = new List(); /// /// If true, the dungeon will avoid collisions with other dungeons /// public bool AvoidCollisionsWithOtherDungeons = false; /// /// An optional predicate to test for additional collisions /// public AdditionalCollisionsPredicate AdditionalCollisionsPredicate; } }