This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DunGen; | |
using UnityEngine; | |
[RequireComponent(typeof(RuntimeDungeon))] | |
class PlayerSpawner : MonoBehaviour | |
{ | |
public GameObject PlayerPrefab = null; | |
private GameObject currentPlayer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void AdjustSettingsAndGenerate(RuntimeDungeon runtimeDungeon) | |
{ | |
var dungeonFlowAsset = runtimeDungeon.Generator.DungeonFlow; | |
// Make a copy of the existing settings | |
var newDungeonFlow = Instantiate(dungeonFlowAsset); | |
// Adjust the number of instances of the first global prop in the list | |
newDungeonFlow.GlobalProps[0].Count = new IntRange(1, 3); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DunGen; | |
using System.Collections.Generic; | |
using UnityEngine; | |
sealed class InjectSpecialRoom : MonoBehaviour | |
{ | |
public TileSet TileSet = null; | |
public bool Required = true; | |
public int CountMin = 1; | |
public int CountMax = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Doorway GetNextDoorwayClosestToEndTile(Tile currentTile) | |
{ | |
// Loop through all active doorways for the tile we're currently in | |
foreach (var doorway in currentTile.Placement.UsedDoorways) | |
{ | |
var adjacentTile = doorway.ConnectedDoorway.Tile; // Get the tile connected by this doorway | |
if (currentTile.Placement.IsOnMainPath) | |
{ | |
// We're already on the main path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DunGen; | |
using UnityEngine; | |
public sealed class AquireDungeonSeed : MonoBehaviour | |
{ | |
public RuntimeDungeon RuntimeDungeon; // Set through the inspector | |
private void Awake() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using DunGen; | |
[RequireComponent(typeof(RuntimeDungeon))] | |
public class DoSomethingOnDungeonComplete : MonoBehaviour | |
{ | |
private RuntimeDungeon runtimeDungeon; | |
private void Awake() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.AI; | |
namespace DunGen.Dev | |
{ | |
[RequireComponent(typeof(NavMeshAgent))] | |
public class LinearOffMeshLinkTraverser : MonoBehaviour | |
{ | |
private NavMeshAgent agent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using DunGen; | |
using System.Linq; | |
using DunGen.Graph; | |
public class BuildDungeonFlow : MonoBehaviour | |
{ | |
public List<GameObject> RoomPrefabs = new List<GameObject>(); |