mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Merge pull request #44 from xen-42/debug-raycast
Fixed Reloading and Debug Raycast
This commit is contained in:
commit
b6e71c0792
@ -141,6 +141,11 @@ namespace NewHorizons
|
||||
{
|
||||
BodyDict["SolarSystem"] = new List<NewHorizonsBody>();
|
||||
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);
|
||||
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user