mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
[Bug] [#433] Actually fix fuzzy stranger text
This commit is contained in:
parent
6926cebe3c
commit
58b89b6862
@ -616,7 +616,7 @@ namespace NewHorizons.Builder.Props
|
||||
// #433 fuzzy stranger text
|
||||
if (info.arcInfo.Any(x => x.type == PropModule.NomaiTextArcInfo.NomaiTextArcType.Stranger))
|
||||
{
|
||||
StreamingHandler.SetUpStreaming(_ghostArcPrefabs.First(), sector);
|
||||
StreamingHandler.SetUpStreaming(AstroObject.Name.RingWorld, sector);
|
||||
}
|
||||
|
||||
return nomaiWallText;
|
||||
|
||||
@ -20,6 +20,23 @@ namespace NewHorizons.Handlers
|
||||
_sectorCache.Clear();
|
||||
}
|
||||
|
||||
public static void SetUpStreaming(AstroObject.Name name, Sector sector)
|
||||
{
|
||||
var group = GetStreamingGroup(name);
|
||||
|
||||
sector.OnOccupantEnterSector += _ =>
|
||||
{
|
||||
group.LoadRequiredAssets();
|
||||
};
|
||||
sector.OnOccupantExitSector += _ =>
|
||||
{
|
||||
if (!sector.ContainsAnyOccupants(DynamicOccupant.Player | DynamicOccupant.Probe))
|
||||
{
|
||||
group.UnloadRequiredAssets();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// makes it so that this object's streaming stuff will be connected to the given sector
|
||||
/// </summary>
|
||||
@ -111,5 +128,17 @@ namespace NewHorizons.Handlers
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static StreamingGroup GetStreamingGroup(AstroObject.Name name)
|
||||
{
|
||||
if (name == AstroObject.Name.CaveTwin || name == AstroObject.Name.TowerTwin)
|
||||
{
|
||||
return GameObject.Find("FocalBody/StreamingGroup_HGT").GetComponent<StreamingGroup>();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Locator.GetAstroObject(name)?.GetComponentInChildren<StreamingGroup>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user