mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
dont make dumb copies of the arc prefabs
This commit is contained in:
parent
a330856fc8
commit
d597d8f200
@ -45,31 +45,25 @@ namespace NewHorizons.Builder.Props
|
||||
private static void InitPrefabs()
|
||||
{
|
||||
// Just take every scroll and get the first arc
|
||||
var existingArcs = GameObject.FindObjectsOfType<ScrollItem>().Select(x => x?._nomaiWallText?.gameObject?.transform?.Find("Arc 1")?.gameObject).Where(x => x != null).ToArray();
|
||||
var arcs = GameObject.FindObjectsOfType<ScrollItem>().Select(x => x?._nomaiWallText?.gameObject?.transform?.Find("Arc 1")?.gameObject).Where(x => x != null).ToArray();
|
||||
_arcPrefabs = new List<GameObject>();
|
||||
_childArcPrefabs = new List<GameObject>();
|
||||
foreach (var existingArc in existingArcs)
|
||||
foreach (var arc in arcs)
|
||||
{
|
||||
if (existingArc.GetComponent<MeshRenderer>().material.name.Contains("Child"))
|
||||
if (arc.GetComponent<MeshRenderer>().material.name.Contains("Child"))
|
||||
{
|
||||
var arc = existingArc.InstantiateInactive();
|
||||
arc.name = "Arc (Child)";
|
||||
_childArcPrefabs.Add(arc);
|
||||
}
|
||||
else
|
||||
{
|
||||
var arc = existingArc.InstantiateInactive();
|
||||
arc.name = "Arc";
|
||||
_arcPrefabs.Add(arc);
|
||||
}
|
||||
}
|
||||
|
||||
var existingGhostArcs = GameObject.FindObjectsOfType<GhostWallText>().Select(x => x?._textLine?.gameObject).Where(x => x != null).ToArray();
|
||||
var ghostArcs = GameObject.FindObjectsOfType<GhostWallText>().Select(x => x?._textLine?.gameObject).Where(x => x != null).ToArray();
|
||||
_ghostArcPrefabs = new List<GameObject>();
|
||||
foreach (var existingArc in existingGhostArcs)
|
||||
foreach (var arc in ghostArcs)
|
||||
{
|
||||
var arc = existingArc.InstantiateInactive();
|
||||
arc.name = "Arc";
|
||||
_ghostArcPrefabs.Add(arc);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user