Created
February 16, 2018 12:53
-
-
Save AG-Dan/044e67839048e84b6fe0a3e2b10f19c1 to your computer and use it in GitHub Desktop.
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() | |
{ | |
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