mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
light refactoring
This commit is contained in:
parent
d5e771709f
commit
932b0bf3e8
@ -631,9 +631,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
var arranger = nomaiWallText.gameObject.AddComponent<NomaiTextArcArranger>();
|
var arranger = nomaiWallText.gameObject.AddComponent<NomaiTextArcArranger>();
|
||||||
|
|
||||||
//
|
// Generate spiral meshes/GOs
|
||||||
// Generate spirals
|
|
||||||
//
|
|
||||||
|
|
||||||
var i = 0;
|
var i = 0;
|
||||||
foreach (var textData in dict.Values)
|
foreach (var textData in dict.Values)
|
||||||
@ -645,16 +643,12 @@ namespace NewHorizons.Builder.Props
|
|||||||
var parent = parentID == -1 ? null : arcsByID[parentID];
|
var parent = parentID == -1 ? null : arcsByID[parentID];
|
||||||
|
|
||||||
GameObject arc = MakeArc(arcInfo, conversationZone, parent, textEntryID);
|
GameObject arc = MakeArc(arcInfo, conversationZone, parent, textEntryID);
|
||||||
arc.name = $"Arc {i} - Child of {parentID}";
|
arc.name = $"Arc {textEntryID} - Child of {parentID}";
|
||||||
|
|
||||||
arcsByID.Add(textEntryID, arc);
|
arcsByID.Add(textEntryID, arc);
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// place spirals
|
|
||||||
//
|
|
||||||
|
|
||||||
// auto placement
|
// auto placement
|
||||||
|
|
||||||
@ -666,7 +660,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
for(var a = 0; a < 10; a++) arranger.FDGSimulationStep();
|
for(var a = 0; a < 10; a++) arranger.FDGSimulationStep();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (overlapFound) Logger.LogWarning("Overlap resolution failed!");
|
if (overlapFound) Logger.LogVerbose("Overlap resolution failed!");
|
||||||
|
|
||||||
// manual placement
|
// manual placement
|
||||||
|
|
||||||
@ -683,7 +677,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
arc.transform.localRotation = Quaternion.Euler(0, 0, arcInfo.zRotation);
|
arc.transform.localRotation = Quaternion.Euler(0, 0, arcInfo.zRotation);
|
||||||
|
|
||||||
if (arcInfo.mirror) arc.transform.localScale = new Vector3(-1, 1, 1);
|
if (arcInfo.mirror) arc.transform.localScale = new Vector3(-1, 1, 1);
|
||||||
else arc.transform.localScale = new Vector3( 1, 1, 1);
|
else arc.transform.localScale = new Vector3( 1, 1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -691,8 +685,8 @@ namespace NewHorizons.Builder.Props
|
|||||||
{
|
{
|
||||||
GameObject arc;
|
GameObject arc;
|
||||||
var type = arcInfo != null ? arcInfo.type : PropModule.NomaiTextArcInfo.NomaiTextArcType.Adult;
|
var type = arcInfo != null ? arcInfo.type : PropModule.NomaiTextArcInfo.NomaiTextArcType.Adult;
|
||||||
NomaiTextArcBuilder.SpiralProfile profile = new();
|
NomaiTextArcBuilder.SpiralProfile profile;
|
||||||
Material mat = null;
|
Material mat;
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case PropModule.NomaiTextArcInfo.NomaiTextArcType.Child:
|
case PropModule.NomaiTextArcInfo.NomaiTextArcType.Child:
|
||||||
@ -711,7 +705,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (parent != null) arc = parent.GetComponent<SpiralManipulator>().AddChild(profile).gameObject;
|
if (parent != null) arc = parent.GetComponent<SpiralManipulator>().AddChild(profile).gameObject;
|
||||||
else arc = NomaiTextArcArranger.CreateSpiral(profile, conversationZone).gameObject;
|
else arc = NomaiTextArcArranger.CreateSpiral(profile, conversationZone).gameObject;
|
||||||
|
|
||||||
if (mat != null) arc.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
if (mat != null) arc.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user