Skip to content

Instantly share code, notes, and snippets.

@AG-Dan
Created July 19, 2019 16:16
Show Gist options
  • Save AG-Dan/033ee8e7131ab34198aee5161d1d9a8f to your computer and use it in GitHub Desktop.
Save AG-Dan/033ee8e7131ab34198aee5161d1d9a8f to your computer and use it in GitHub Desktop.
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);
// Assign our new settings to the dungeon generator
runtimeDungeon.Generator.DungeonFlow = newDungeonFlow;
runtimeDungeon.Generate();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment