diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index 14e5a067..007771bb 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -141,6 +141,11 @@ namespace NewHorizons { BodyDict["SolarSystem"] = new List(); SystemDict["SolarSystem"] = new NewHorizonsSystem("SolarSystem", new StarSystemConfig(null), this); + foreach (AssetBundle bundle in AssetBundles.Values) + { + bundle.Unload(true); + } + AssetBundles.Clear(); Logger.Log("Begin reload of config files...", Logger.LogType.Log); diff --git a/NewHorizons/Utility/DebugRaycaster.cs b/NewHorizons/Utility/DebugRaycaster.cs index fa7d4760..ce398b65 100644 --- a/NewHorizons/Utility/DebugRaycaster.cs +++ b/NewHorizons/Utility/DebugRaycaster.cs @@ -1,4 +1,5 @@ -using NewHorizons.Builder.Body; +using NewHorizons; +using NewHorizons.Builder.Body; using System; using System.Collections.Generic; using System.Linq; @@ -21,7 +22,7 @@ namespace NewHorizons.Utility private void Update() { - if (Keyboard.current != null && Keyboard.current[Key.P].wasReleasedThisFrame) + if (Main.Debug && Keyboard.current != null && Keyboard.current[Key.P].wasReleasedThisFrame) { // Raycast _rb.DisableCollisionDetection(); @@ -31,7 +32,8 @@ namespace NewHorizons.Utility if (Physics.Raycast(origin, direction, out RaycastHit hitInfo, 100f, layerMask)) { var pos = hitInfo.transform.InverseTransformPoint(hitInfo.point); - Logger.Log($"Raycast hit {{\"x\": {pos.x}, \"y\": {pos.y}, \"z\": {pos.z}}} on [{hitInfo.transform.gameObject.name}]"); + var o = hitInfo.transform.gameObject; + Logger.Log($"Raycast hit {{\"x\": {pos.x}, \"y\": {pos.y}, \"z\": {pos.z}}} on [{o.name}] at [{SearchUtilities.GetPath(o.transform)}]"); } _rb.EnableCollisionDetection(); }