mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
make it only allocate list if its not in the cache
This commit is contained in:
parent
2219b80253
commit
0cbfdb4458
@ -35,14 +35,15 @@ namespace NewHorizons.Handlers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static void HookStreaming(GameObject obj, Sector sector = null)
|
public static void HookStreaming(GameObject obj, Sector sector = null)
|
||||||
{
|
{
|
||||||
var assetBundles = new List<string>();
|
List<string> assetBundles;
|
||||||
|
|
||||||
if (_objectCache.ContainsKey(obj))
|
if (_objectCache.ContainsKey(obj))
|
||||||
{
|
{
|
||||||
assetBundles = _objectCache[obj];
|
assetBundles = _objectCache[obj];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
assetBundles = new List<string>();
|
||||||
|
|
||||||
var tables = Resources.FindObjectsOfTypeAll<StreamingMaterialTable>();
|
var tables = Resources.FindObjectsOfTypeAll<StreamingMaterialTable>();
|
||||||
foreach (var streamingHandle in obj.GetComponentsInChildren<StreamingMeshHandle>())
|
foreach (var streamingHandle in obj.GetComponentsInChildren<StreamingMeshHandle>())
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user