mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
added quantum group handling to PropBuildManager
This commit is contained in:
parent
a0b6d2cf29
commit
76ade8d238
@ -1,7 +1,8 @@
|
|||||||
using NewHorizons.Builder.ShipLog;
|
using NewHorizons.Builder.ShipLog;
|
||||||
using NewHorizons.External.Configs;
|
using NewHorizons.External.Configs;
|
||||||
using OWML.Common;
|
using OWML.Common;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Logger = NewHorizons.Utility.Logger;
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
namespace NewHorizons.Builder.Props
|
namespace NewHorizons.Builder.Props
|
||||||
@ -163,6 +164,33 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (config.Props.quantumGroups != null)
|
||||||
|
{
|
||||||
|
Dictionary<string, List<GameObject>> propsByGroup = new Dictionary<string, List<GameObject>>();
|
||||||
|
foreach (var detail in config.Props.details)
|
||||||
|
{
|
||||||
|
if (detail.quantumGroupID != null)
|
||||||
|
{
|
||||||
|
if (!propsByGroup.ContainsKey(detail.quantumGroupID)) propsByGroup[detail.quantumGroupID] = new List<GameObject>();
|
||||||
|
propsByGroup[detail.quantumGroupID].Add(DetailBuilder.GetSpawnedGameObjectByDetailInfo(detail));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var quantumGroup in config.Props.quantumGroups)
|
||||||
|
{
|
||||||
|
if (!propsByGroup.ContainsKey(quantumGroup.id)) continue;
|
||||||
|
var propsInGroup = propsByGroup[quantumGroup.id];
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
QuantumBuilder.Make(go, sector, config, mod, quantumGroup, propsInGroup.ToArray());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.LogError($"Couldn't make quantum group \"{quantumGroup.id}\" for [{go.name}] : {ex.Message}, {ex.StackTrace}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user