diff --git a/NewHorizons/Utility/DebugPropPlacer.cs b/NewHorizons/Utility/DebugPropPlacer.cs index 990ff6af..269b5052 100644 --- a/NewHorizons/Utility/DebugPropPlacer.cs +++ b/NewHorizons/Utility/DebugPropPlacer.cs @@ -46,6 +46,10 @@ namespace NewHorizons.Utility PropPlacementData propData = RegisterProp_WithReturn(data.bodyName, prop); propData.initial_pos = data.pos; propData.initial_rotation = data.norm; + + string origEul = prop.transform.localEulerAngles.ToString(); + prop.transform.localRotation = Quaternion.LookRotation(data.norm) * Quaternion.FromToRotation(Vector3.up, Vector3.forward); + Logger.Log($"{data.norm.ToString()} -=- {prop.transform.localEulerAngles.ToString()} => {prop.transform.localEulerAngles.ToString()}"); } catch (Exception e) { @@ -60,6 +64,11 @@ namespace NewHorizons.Utility private static PropPlacementData RegisterProp_WithReturn(string bodyGameObjectName, GameObject prop) { + if (Main.Debug) + { + // TOOD: make this prop an item + } + string bodyName = bodyGameObjectName.Substring(0, bodyGameObjectName.Length-"_Body".Length); PropPlacementData data = new PropPlacementData { diff --git a/NewHorizons/Utility/DebugRaycaster.cs b/NewHorizons/Utility/DebugRaycaster.cs index 3cde50b9..adc79ce8 100644 --- a/NewHorizons/Utility/DebugRaycaster.cs +++ b/NewHorizons/Utility/DebugRaycaster.cs @@ -18,11 +18,20 @@ namespace NewHorizons.Utility private GameObject _normalSphere1; private GameObject _normalSphere2; + public string temp_placepath = "BrittleHollow_Body/Sector_BH/Sector_NorthHemisphere/Sector_NorthPole/Sector_HangingCity/Sector_HangingCity_District1/Props_HangingCity_District1/OtherComponentsGroup/Props_HangingCity_Building_10/Prefab_NOM_VaseThin"; + private void Awake() { _rb = this.GetRequiredComponent(); } + //private void OnGui() + //{ + // //TODO: add gui for stuff https://github.com/Bwc9876/OW-SaveEditor/blob/master/SaveEditor/SaveEditor.cs + // // https://docs.unity3d.com/ScriptReference/GUI.TextField.html + // GUILayout.BeginArea(new Rect(menuPosition.x, menuPosition.y, EditorMenuSize.x, EditorMenuSize.y), _editorMenuStyle); + //} + private void Update() { if (!Main.Debug) return; @@ -35,6 +44,7 @@ namespace NewHorizons.Utility if (Keyboard.current[Key.L].wasReleasedThisFrame) { + DebugPropPlacer.currentObject = temp_placepath; PlaceObject(); }