From 4efba911b3428966e1759279b5bfc8bb1c2d9588 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 4 Mar 2022 01:38:46 -0500 Subject: [PATCH 1/6] Make details high LOD --- NewHorizons/Builder/Props/DetailBuilder.cs | 18 ++------ NewHorizons/Handlers/OWAssetHandler.cs | 53 ++++++++++++++++++++++ NewHorizons/Main.cs | 1 + 3 files changed, 57 insertions(+), 15 deletions(-) create mode 100644 NewHorizons/Handlers/OWAssetHandler.cs diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index e01250f6..56a4d4e5 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -10,6 +10,7 @@ using Logger = NewHorizons.Utility.Logger; using NewHorizons.External; using OWML.Common; using NewHorizons.External.Configs; +using NewHorizons.Handlers; namespace NewHorizons.Builder.Props { @@ -63,21 +64,8 @@ namespace NewHorizons.Builder.Props GameObject prop = GameObject.Instantiate(prefab, sector.transform); prop.SetActive(false); - List assetBundles = new List(); - foreach (var streamingHandle in prop.GetComponentsInChildren()) - { - var assetBundle = streamingHandle.assetBundle; - if (!assetBundles.Contains(assetBundle)) - { - assetBundles.Add(assetBundle); - } - } - - foreach (var assetBundle in assetBundles) - { - sector.OnOccupantEnterSector += (SectorDetector sd) => StreamingManager.LoadStreamingAssets(assetBundle); - StreamingManager.LoadStreamingAssets(assetBundle); - } + sector.OnOccupantEnterSector += (SectorDetector sd) => OWAssetHandler.LoadObject(prop); + OWAssetHandler.LoadObject(prop); foreach (var component in prop.GetComponents().Concat(prop.GetComponentsInChildren())) { diff --git a/NewHorizons/Handlers/OWAssetHandler.cs b/NewHorizons/Handlers/OWAssetHandler.cs new file mode 100644 index 00000000..ec435208 --- /dev/null +++ b/NewHorizons/Handlers/OWAssetHandler.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Logger = NewHorizons.Utility.Logger; + +namespace NewHorizons.Handlers +{ + public static class OWAssetHandler + { + public static void Init() + { + + } + + public static void LoadObject(GameObject obj) + { + var assetBundles = new List(); + + var tables = Resources.FindObjectsOfTypeAll(); + foreach (var streamingHandle in obj.GetComponentsInChildren()) + { + var assetBundle = streamingHandle.assetBundle; + if (!assetBundles.Contains(assetBundle)) + { + assetBundles.Add(assetBundle); + } + if (streamingHandle is StreamingRenderMeshHandle || streamingHandle is StreamingSkinnedMeshHandle) + { + var materials = streamingHandle.GetComponent().sharedMaterials; + foreach (var table in tables) + { + foreach(var x in table._materialPropertyLookups) + { + if(materials.Contains(x.material)) + { + assetBundles.SafeAdd(table.assetBundle); + } + } + } + } + } + + foreach (var assetBundle in assetBundles) + { + Logger.Log($"Loading {assetBundles.Count} : {assetBundle}"); + StreamingManager.LoadStreamingAssets(assetBundle); + } + } + } +} diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index 55426627..9475c095 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -190,6 +190,7 @@ namespace NewHorizons SignalBuilder.Init(); AstroObjectLocator.RefreshList(); PlanetCreationHandler.Init(BodyDict[CurrentStarSystem]); + OWAssetHandler.Init(); LoadTranslations(ModHelper.Manifest.ModFolderPath + "AssetBundle/", this); Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => Locator.GetPlayerBody().gameObject.AddComponent()); From d1f33eb336ba67ab47c0cbf4b184d41fd2b20803 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 4 Mar 2022 01:50:55 -0500 Subject: [PATCH 2/6] Use caching --- NewHorizons/Handlers/OWAssetHandler.cs | 28 +++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/NewHorizons/Handlers/OWAssetHandler.cs b/NewHorizons/Handlers/OWAssetHandler.cs index ec435208..1f1841b8 100644 --- a/NewHorizons/Handlers/OWAssetHandler.cs +++ b/NewHorizons/Handlers/OWAssetHandler.cs @@ -10,9 +10,11 @@ namespace NewHorizons.Handlers { public static class OWAssetHandler { + private static Dictionary _materialCache; + public static void Init() { - + _materialCache = new Dictionary(); } public static void LoadObject(GameObject obj) @@ -30,22 +32,34 @@ namespace NewHorizons.Handlers if (streamingHandle is StreamingRenderMeshHandle || streamingHandle is StreamingSkinnedMeshHandle) { var materials = streamingHandle.GetComponent().sharedMaterials; - foreach (var table in tables) + + if (materials.Length == 0) continue; + + if (_materialCache == null) _materialCache = new Dictionary(); + + if (_materialCache.TryGetValue(materials[0], out assetBundle)) { - foreach(var x in table._materialPropertyLookups) + assetBundles.Add(assetBundle); + } + else + { + foreach (var table in tables) { - if(materials.Contains(x.material)) + foreach (var x in table._materialPropertyLookups) { - assetBundles.SafeAdd(table.assetBundle); + if (materials.Contains(x.material)) + { + _materialCache.SafeAdd(x.material, table.assetBundle); + assetBundles.SafeAdd(table.assetBundle); + } } - } + } } } } foreach (var assetBundle in assetBundles) { - Logger.Log($"Loading {assetBundles.Count} : {assetBundle}"); StreamingManager.LoadStreamingAssets(assetBundle); } } From cb64ea3458231d0987669bb17b14d81f69fc6690 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 5 Mar 2022 20:38:48 -0500 Subject: [PATCH 3/6] Update OWAssetHandler.cs --- NewHorizons/Handlers/OWAssetHandler.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NewHorizons/Handlers/OWAssetHandler.cs b/NewHorizons/Handlers/OWAssetHandler.cs index 1f1841b8..74611aa4 100644 --- a/NewHorizons/Handlers/OWAssetHandler.cs +++ b/NewHorizons/Handlers/OWAssetHandler.cs @@ -37,6 +37,7 @@ namespace NewHorizons.Handlers if (_materialCache == null) _materialCache = new Dictionary(); + // Gonna assume that if theres more than one material its probably in the same asset bundle anyway right if (_materialCache.TryGetValue(materials[0], out assetBundle)) { assetBundles.Add(assetBundle); From fe4f7f59195b770fd8ed8a1a9a89458e96e73320 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 7 Mar 2022 00:06:06 -0500 Subject: [PATCH 4/6] Maybe fix warp bug --- .../Builder/General/PlanetDestroyer.cs | 166 +++++++++--------- .../Builder/General/SpawnPointBuilder.cs | 2 +- NewHorizons/Builder/Props/DetailBuilder.cs | 2 +- NewHorizons/Main.cs | 14 +- 4 files changed, 101 insertions(+), 83 deletions(-) diff --git a/NewHorizons/Builder/General/PlanetDestroyer.cs b/NewHorizons/Builder/General/PlanetDestroyer.cs index 48f5db46..0d3dd61a 100644 --- a/NewHorizons/Builder/General/PlanetDestroyer.cs +++ b/NewHorizons/Builder/General/PlanetDestroyer.cs @@ -85,93 +85,100 @@ namespace NewHorizons.Builder.General } } - if (ao.GetAstroObjectName() == AstroObject.Name.CaveTwin || ao.GetAstroObjectName() == AstroObject.Name.TowerTwin) + try { - if (ao.GetAstroObjectName() == AstroObject.Name.TowerTwin) - GameObject.Find("TimeLoopRing_Body").SetActive(false); - var focalBody = GameObject.Find("FocalBody"); - if (focalBody != null) focalBody.SetActive(false); - } - else if (ao.GetAstroObjectName() == AstroObject.Name.MapSatellite) - { - var msb = GameObject.Find("MapSatellite_Body"); - if (msb != null) msb.SetActive(false); - } - else if(ao.GetAstroObjectName() == AstroObject.Name.ProbeCannon) - { - GameObject.Find("NomaiProbe_Body").SetActive(false); - GameObject.Find("CannonMuzzle_Body").SetActive(false); - GameObject.Find("FakeCannonMuzzle_Body (1)").SetActive(false); - GameObject.Find("CannonBarrel_Body").SetActive(false); - GameObject.Find("FakeCannonBarrel_Body (1)").SetActive(false); - GameObject.Find("Debris_Body (1)").SetActive(false); - } - else if(ao.GetAstroObjectName() == AstroObject.Name.SunStation) - { - GameObject.Find("SS_Debris_Body").SetActive(false); - } - else if(ao.GetAstroObjectName() == AstroObject.Name.GiantsDeep) - { - GameObject.Find("BrambleIsland_Body").SetActive(false); - GameObject.Find("GabbroIsland_Body").SetActive(false); - GameObject.Find("QuantumIsland_Body").SetActive(false); - GameObject.Find("StatueIsland_Body").SetActive(false); - GameObject.Find("ConstructionYardIsland_Body").SetActive(false); - GameObject.Find("GabbroShip_Body").SetActive(false); - foreach(var jelly in GameObject.FindObjectsOfType()) + if (ao.GetAstroObjectName() == AstroObject.Name.CaveTwin || ao.GetAstroObjectName() == AstroObject.Name.TowerTwin) { - jelly.gameObject.SetActive(false); + if (ao.GetAstroObjectName() == AstroObject.Name.TowerTwin) + GameObject.Find("TimeLoopRing_Body").SetActive(false); + var focalBody = GameObject.Find("FocalBody"); + if (focalBody != null) focalBody.SetActive(false); } - } - else if(ao.GetAstroObjectName() == AstroObject.Name.WhiteHole) - { - GameObject.Find("WhiteholeStation_Body").SetActive(false); - GameObject.Find("WhiteholeStationSuperstructure_Body").SetActive(false); - } - else if(ao.GetAstroObjectName() == AstroObject.Name.TimberHearth) - { - GameObject.Find("MiningRig_Body").SetActive(false); + else if (ao.GetAstroObjectName() == AstroObject.Name.MapSatellite) + { + var msb = GameObject.Find("MapSatellite_Body"); + if (msb != null) msb.SetActive(false); + } + else if (ao.GetAstroObjectName() == AstroObject.Name.ProbeCannon) + { + GameObject.Find("NomaiProbe_Body").SetActive(false); + GameObject.Find("CannonMuzzle_Body").SetActive(false); + GameObject.Find("FakeCannonMuzzle_Body (1)").SetActive(false); + GameObject.Find("CannonBarrel_Body").SetActive(false); + GameObject.Find("FakeCannonBarrel_Body (1)").SetActive(false); + GameObject.Find("Debris_Body (1)").SetActive(false); + } + else if (ao.GetAstroObjectName() == AstroObject.Name.SunStation) + { + GameObject.Find("SS_Debris_Body").SetActive(false); + } + else if (ao.GetAstroObjectName() == AstroObject.Name.GiantsDeep) + { + GameObject.Find("BrambleIsland_Body").SetActive(false); + GameObject.Find("GabbroIsland_Body").SetActive(false); + GameObject.Find("QuantumIsland_Body").SetActive(false); + GameObject.Find("StatueIsland_Body").SetActive(false); + GameObject.Find("ConstructionYardIsland_Body").SetActive(false); + GameObject.Find("GabbroShip_Body").SetActive(false); + foreach (var jelly in GameObject.FindObjectsOfType()) + { + jelly.gameObject.SetActive(false); + } + } + else if (ao.GetAstroObjectName() == AstroObject.Name.WhiteHole) + { + GameObject.Find("WhiteholeStation_Body").SetActive(false); + GameObject.Find("WhiteholeStationSuperstructure_Body").SetActive(false); + } + else if (ao.GetAstroObjectName() == AstroObject.Name.TimberHearth) + { + GameObject.Find("MiningRig_Body").SetActive(false); - foreach(var obj in GameObject.FindObjectsOfType()) - { - GameObject.Destroy(obj); + foreach (var obj in GameObject.FindObjectsOfType()) + { + GameObject.Destroy(obj); + } + foreach (var obj in GameObject.FindObjectsOfType()) + { + GameObject.Destroy(obj); + } } - foreach (var obj in GameObject.FindObjectsOfType()) + else if (ao.GetAstroObjectName() == AstroObject.Name.Sun) { - GameObject.Destroy(obj); + var starController = ao.gameObject.GetComponent(); + StarLightController.RemoveStar(starController); + GameObject.Destroy(starController); + + var audio = ao.GetComponentInChildren(); + GameObject.Destroy(audio); + + foreach (var owAudioSource in ao.GetComponentsInChildren()) + { + owAudioSource.Stop(); + GameObject.Destroy(owAudioSource); + } + + foreach (var audioSource in ao.GetComponentsInChildren()) + { + audioSource.Stop(); + GameObject.Destroy(audioSource); + } + + foreach (var sunProxy in GameObject.FindObjectsOfType()) + { + Logger.Log($"Destroying SunProxy {sunProxy.gameObject.name}"); + GameObject.Destroy(sunProxy.gameObject); + } + } + else if (ao.GetAstroObjectName() == AstroObject.Name.DreamWorld) + { + GameObject.Find("BackRaft_Body").SetActive(false); + GameObject.Find("SealRaft_Body").SetActive(false); } } - else if(ao.GetAstroObjectName() == AstroObject.Name.Sun) + catch(Exception e) { - var starController = ao.gameObject.GetComponent(); - StarLightController.RemoveStar(starController); - GameObject.Destroy(starController); - - var audio = ao.GetComponentInChildren(); - GameObject.Destroy(audio); - - foreach(var owAudioSource in ao.GetComponentsInChildren()) - { - owAudioSource.Stop(); - GameObject.Destroy(owAudioSource); - } - - foreach (var audioSource in ao.GetComponentsInChildren()) - { - audioSource.Stop(); - GameObject.Destroy(audioSource); - } - - foreach(var sunProxy in GameObject.FindObjectsOfType()) - { - Logger.Log($"Destroying SunProxy {sunProxy.gameObject.name}"); - GameObject.Destroy(sunProxy.gameObject); - } - } - else if(ao.GetAstroObjectName() == AstroObject.Name.DreamWorld) - { - GameObject.Find("BackRaft_Body").SetActive(false); - GameObject.Find("SealRaft_Body").SetActive(false); + Logger.LogWarning($"Exception thrown when trying to delete bodies related to [{ao.name}]: {e.Message}, {e.StackTrace}"); } // Deal with proxies @@ -185,7 +192,8 @@ namespace NewHorizons.Builder.General } RemoveProxy(ao.name.Replace("_Body", "")); - ao.transform.root.gameObject.SetActive(false); + // For TH we wait until the player is fully loaded in + Main.Instance.ModHelper.Events.Unity.RunWhen(() => Main.IsSystemReady, () => ao.transform.root.gameObject.SetActive(false)); foreach (ProxyBody proxy in GameObject.FindObjectsOfType()) { diff --git a/NewHorizons/Builder/General/SpawnPointBuilder.cs b/NewHorizons/Builder/General/SpawnPointBuilder.cs index 0b729eee..bc8d0aba 100644 --- a/NewHorizons/Builder/General/SpawnPointBuilder.cs +++ b/NewHorizons/Builder/General/SpawnPointBuilder.cs @@ -60,7 +60,7 @@ namespace NewHorizons.Builder.General if(!Main.Instance.IsWarping && module.StartWithSuit && !suitUpQueued) { suitUpQueued = true; - Main.Instance.ModHelper.Events.Unity.FireInNUpdates(() => SuitUp(), 4); + Main.Instance.ModHelper.Events.Unity.RunWhen(() => Main.IsSystemReady, () => SuitUp()); } Logger.Log("Made spawnpoint on [" + body.name + "]"); diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 56a4d4e5..f74dac74 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -81,7 +81,7 @@ namespace NewHorizons.Builder.Props if(component is AnglerfishAnimController && component.GetComponentInParent() == null) Main.Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => (component as AnglerfishAnimController).enabled = false); - if (component is Animator) Main.Instance.ModHelper.Events.Unity.FireInNUpdates(() => (component as Animator).enabled = true, 5); + if (component is Animator) Main.Instance.ModHelper.Events.Unity.RunWhen(() => Main.IsSystemReady, () => (component as Animator).enabled = true); if (component is Collider) Main.Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => (component as Collider).enabled = true); if(component is Shape) Main.Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => (component as Shape).enabled = true); diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index 9475c095..0e9aca9a 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -43,6 +43,7 @@ namespace NewHorizons public static Dictionary AssetBundles = new Dictionary(); public static List MountedAddons = new List(); + public static bool IsSystemReady { get; private set; } public static float FurthestOrbit { get; set; } = 50000f; public string CurrentStarSystem { get { return Instance._currentStarSystem; } } @@ -91,6 +92,7 @@ namespace NewHorizons SceneManager.sceneLoaded += OnSceneLoaded; Instance = this; GlobalMessenger.AddListener("PlayerDeath", OnDeath); + GlobalMessenger.AddListener("WakeUp", new Callback(OnWakeUp)); ShaderBundle = Main.Instance.ModHelper.Assets.LoadBundle("AssetBundle/shader"); BodyDict["SolarSystem"] = new List(); SystemDict["SolarSystem"] = new NewHorizonsSystem("SolarSystem", new StarSystemConfig(null), this); @@ -170,6 +172,12 @@ namespace NewHorizons Logger.Log($"Destroying NewHorizons"); SceneManager.sceneLoaded -= OnSceneLoaded; GlobalMessenger.RemoveListener("PlayerDeath", OnDeath); + GlobalMessenger.RemoveListener("WakeUp", new Callback(OnWakeUp)); + } + + private static void OnWakeUp() + { + IsSystemReady = true; } void OnSceneLoaded(Scene scene, LoadSceneMode mode) @@ -185,6 +193,8 @@ namespace NewHorizons if(scene.name == "SolarSystem") { + IsSystemReady = false; + HeavenlyBodyBuilder.Reset(); NewHorizonsData.Load(); SignalBuilder.Init(); @@ -203,8 +213,8 @@ namespace NewHorizons if (HasWarpDrive == true) EnableWarpDrive(); Logger.Log($"Is the player warping in? {IsWarping}"); - if (IsWarping && _shipWarpController) Instance.ModHelper.Events.Unity.FireInNUpdates(() => _shipWarpController.WarpIn(WearingSuit), 5); - else Instance.ModHelper.Events.Unity.FireInNUpdates(() => GameObject.FindObjectOfType().DebugWarp(SystemDict[_currentStarSystem].SpawnPoint), 5); + if (IsWarping && _shipWarpController) Instance.ModHelper.Events.Unity.RunWhen(() => IsSystemReady, () => _shipWarpController.WarpIn(WearingSuit)); + else Instance.ModHelper.Events.Unity.RunWhen(() => IsSystemReady, () => FindObjectOfType().DebugWarp(SystemDict[_currentStarSystem].SpawnPoint)); IsWarping = false; var map = GameObject.FindObjectOfType(); From e9bba3fa9b65a149de6fccf5e08b5f287fc16bcb Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 7 Mar 2022 01:17:34 -0500 Subject: [PATCH 5/6] Cache LOD texture stuff better and gooder --- NewHorizons/Builder/Props/DetailBuilder.cs | 2 +- NewHorizons/Handlers/OWAssetHandler.cs | 65 ++++++++++++++-------- NewHorizons/Main.cs | 2 +- 3 files changed, 45 insertions(+), 24 deletions(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index f74dac74..72776897 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -64,7 +64,7 @@ namespace NewHorizons.Builder.Props GameObject prop = GameObject.Instantiate(prefab, sector.transform); prop.SetActive(false); - sector.OnOccupantEnterSector += (SectorDetector sd) => OWAssetHandler.LoadObject(prop); + sector.OnOccupantEnterSector += (SectorDetector sd) => OWAssetHandler.OnOccupantEnterSector(prop, sd, sector); OWAssetHandler.LoadObject(prop); foreach (var component in prop.GetComponents().Concat(prop.GetComponentsInChildren())) diff --git a/NewHorizons/Handlers/OWAssetHandler.cs b/NewHorizons/Handlers/OWAssetHandler.cs index 74611aa4..723a8545 100644 --- a/NewHorizons/Handlers/OWAssetHandler.cs +++ b/NewHorizons/Handlers/OWAssetHandler.cs @@ -11,52 +11,73 @@ namespace NewHorizons.Handlers public static class OWAssetHandler { private static Dictionary _materialCache; + private static Dictionary> _objectCache; public static void Init() { _materialCache = new Dictionary(); + _objectCache = new Dictionary>(); + } + + public static void OnOccupantEnterSector(GameObject obj, SectorDetector sd, Sector sector) + { + LoadObject(obj); + + // If its too laggy put this back idk + /* + if (sector.GetOccupants().Count > 0 || sd._occupantType == DynamicOccupant.Player) + { + LoadObject(obj); + } + */ } public static void LoadObject(GameObject obj) { var assetBundles = new List(); - var tables = Resources.FindObjectsOfTypeAll(); - foreach (var streamingHandle in obj.GetComponentsInChildren()) + if (_objectCache.ContainsKey(obj)) { - var assetBundle = streamingHandle.assetBundle; - if (!assetBundles.Contains(assetBundle)) + assetBundles = _objectCache[obj]; + } + else + { + var tables = Resources.FindObjectsOfTypeAll(); + foreach (var streamingHandle in obj.GetComponentsInChildren()) { - assetBundles.Add(assetBundle); - } - if (streamingHandle is StreamingRenderMeshHandle || streamingHandle is StreamingSkinnedMeshHandle) - { - var materials = streamingHandle.GetComponent().sharedMaterials; - - if (materials.Length == 0) continue; - - if (_materialCache == null) _materialCache = new Dictionary(); - - // Gonna assume that if theres more than one material its probably in the same asset bundle anyway right - if (_materialCache.TryGetValue(materials[0], out assetBundle)) + var assetBundle = streamingHandle.assetBundle; + if (!assetBundles.Contains(assetBundle)) { assetBundles.Add(assetBundle); } - else + if (streamingHandle is StreamingRenderMeshHandle || streamingHandle is StreamingSkinnedMeshHandle) { - foreach (var table in tables) + var materials = streamingHandle.GetComponent().sharedMaterials; + + if (materials.Length == 0) continue; + + // Gonna assume that if theres more than one material its probably in the same asset bundle anyway right + if (_materialCache.TryGetValue(materials[0], out assetBundle)) { - foreach (var x in table._materialPropertyLookups) + assetBundles.Add(assetBundle); + } + else + { + foreach (var table in tables) { - if (materials.Contains(x.material)) + foreach (var x in table._materialPropertyLookups) { - _materialCache.SafeAdd(x.material, table.assetBundle); - assetBundles.SafeAdd(table.assetBundle); + if (materials.Contains(x.material)) + { + _materialCache.SafeAdd(x.material, table.assetBundle); + assetBundles.SafeAdd(table.assetBundle); + } } } } } } + _objectCache[obj] = assetBundles; } foreach (var assetBundle in assetBundles) diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index 0e9aca9a..6e1aaebf 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -199,8 +199,8 @@ namespace NewHorizons NewHorizonsData.Load(); SignalBuilder.Init(); AstroObjectLocator.RefreshList(); - PlanetCreationHandler.Init(BodyDict[CurrentStarSystem]); OWAssetHandler.Init(); + PlanetCreationHandler.Init(BodyDict[CurrentStarSystem]); LoadTranslations(ModHelper.Manifest.ModFolderPath + "AssetBundle/", this); Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => Locator.GetPlayerBody().gameObject.AddComponent()); From dcae801ac5a8128f21e289078254d8cb7fdfda9b Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 7 Mar 2022 01:21:36 -0500 Subject: [PATCH 6/6] Update manifest.json --- NewHorizons/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index e26ae9d1..ae914472 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -3,7 +3,7 @@ "author": "xen, Idiot, & Book", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "0.9.2", + "version": "0.9.3", "owmlVersion": "2.1.0", "dependencies": [ "PacificEngine.OW_CommonResources" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "Vesper.OuterWildsMMO", "Vesper.AutoResume" ]