Skip to content

Instantly share code, notes, and snippets.

@AG-Dan
Created February 16, 2018 12:53
Show Gist options
  • Save AG-Dan/044e67839048e84b6fe0a3e2b10f19c1 to your computer and use it in GitHub Desktop.
Save AG-Dan/044e67839048e84b6fe0a3e2b10f19c1 to your computer and use it in GitHub Desktop.
using DunGen;
using UnityEngine;
public sealed class AquireDungeonSeed : MonoBehaviour
{
public RuntimeDungeon RuntimeDungeon; // Set through the inspector
private void Awake()
{
RuntimeDungeon.Generator.OnGenerationStatusChanged += OnDungeonGenerationStatusChanged;
}
private void OnDungeonGenerationStatusChanged(DungeonGenerator generator, GenerationStatus status)
{
if(status == GenerationStatus.Complete)
{
// The seed that was actually used by DunGen, accounting for any retries
int seed = generator.ChosenSeed;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment