1
0
mirror of https://github.com/originalnicodr/CinematicUnityExplorer.git synced 2025-07-18 17:38:01 +08:00

Add Adjust ArrowSize (#101)
Some checks failed
Build CinematicUnityExplorer / build_dotnet (push) Has been cancelled
Build CinematicUnityExplorer / build_connector (push) Has been cancelled

Co-authored-by: originalnicodr <niconavall@gmail.com>
This commit is contained in:
Yuki.kaco
2025-02-08 06:39:21 +08:00
committed by GitHub
parent 3bc1268444
commit 9144f89e32
5 changed files with 23 additions and 6 deletions

View File

@ -1,6 +1,7 @@
using HarmonyLib; using HarmonyLib;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityExplorer.Config;
#if UNHOLLOWER #if UNHOLLOWER
using IL2CPPUtils = UnhollowerBaseLib.UnhollowerUtils; using IL2CPPUtils = UnhollowerBaseLib.UnhollowerUtils;
#endif #endif
@ -12,8 +13,12 @@ namespace UnityExplorer
{ {
public class ArrowGenerator public class ArrowGenerator
{ {
public static GameObject CreateArrow(Vector3 arrowPosition, Quaternion arrowRotation, Color color){ public static GameObject CreateArrow(Vector3 arrowPosition, Quaternion arrowRotation, Color color)
{
try { try {
float arrowSizeValue = ConfigManager.Arrow_Size.Value;
Vector3 arrowSize = new Vector3(Math.Max(arrowSizeValue, 0.1f), Math.Max(arrowSizeValue, 0.1f), Math.Max(arrowSizeValue, 0.1f));
GameObject cylinder = GameObject.CreatePrimitive(PrimitiveType.Cylinder); GameObject cylinder = GameObject.CreatePrimitive(PrimitiveType.Cylinder);
cylinder.GetComponent<Collider>().enabled = false; cylinder.GetComponent<Collider>().enabled = false;
cylinder.GetComponent<MeshFilter>().mesh = CreateCylinderMesh(0.01f, 20, 2); cylinder.GetComponent<MeshFilter>().mesh = CreateCylinderMesh(0.01f, 20, 2);
@ -34,6 +39,7 @@ namespace UnityExplorer
GameObject arrow = new GameObject("CUE-Arrow"); GameObject arrow = new GameObject("CUE-Arrow");
cylinder.transform.SetParent(arrow.transform, true); cylinder.transform.SetParent(arrow.transform, true);
arrow.transform.localScale = arrowSize;
arrow.transform.position = arrowPosition; arrow.transform.position = arrowPosition;
arrow.transform.rotation = arrowRotation; arrow.transform.rotation = arrowRotation;
arrow.transform.position += 0.5f * arrow.transform.forward; // Move the arrow forward so the cylinder starts on the wanted position arrow.transform.position += 0.5f * arrow.transform.forward; // Move the arrow forward so the cylinder starts on the wanted position

View File

@ -1,4 +1,5 @@
using UnityEngine; using UnityEngine;
using UnityExplorer.Config;
using UniverseLib.UI; using UniverseLib.UI;
using UniverseLib.UI.Models; using UniverseLib.UI.Models;
using UniverseLib.UI.Widgets.ScrollView; using UniverseLib.UI.Widgets.ScrollView;
@ -69,6 +70,9 @@ namespace UnityExplorer.UI.Panels
private void ToggleVisualizer(){ private void ToggleVisualizer(){
GameObject visualizer = light.transform.GetChild(0).gameObject; GameObject visualizer = light.transform.GetChild(0).gameObject;
float arrowSize = ConfigManager.Arrow_Size.Value;
Vector3 arrowSizeVec = new Vector3(Math.Max(arrowSize, 0.1f), Math.Max(arrowSize, 0.1f), Math.Max(arrowSize, 0.1f));
light.transform.GetChild(0).localScale = arrowSizeVec;
visualizer.SetActive(!visualizer.activeSelf); visualizer.SetActive(!visualizer.activeSelf);
} }

View File

@ -32,6 +32,7 @@ namespace UnityExplorer.Config
public static ConfigElement<bool> Reflection_Hide_NativeInfoPtrs; public static ConfigElement<bool> Reflection_Hide_NativeInfoPtrs;
public static ConfigElement<bool> Auto_Scale_UI; public static ConfigElement<bool> Auto_Scale_UI;
public static ConfigElement<bool> Reset_Camera_Transform; public static ConfigElement<bool> Reset_Camera_Transform;
public static ConfigElement<float> Arrow_Size;
public static ConfigElement<KeyCode> Pause; public static ConfigElement<KeyCode> Pause;
public static ConfigElement<KeyCode> Frameskip; public static ConfigElement<KeyCode> Frameskip;
@ -167,7 +168,7 @@ namespace UnityExplorer.Config
"Optional keybind to begin a UI-mode Mouse Inspect.", "Optional keybind to begin a UI-mode Mouse Inspect.",
KeyCode.None); KeyCode.None);
CSConsole_Assembly_Blacklist = new("CSharp Console Assembly Blacklist", CSConsole_Assembly_Blacklist = new("CSharp Console Assembly Blacklist",
"Use this to blacklist Assembly names from being referenced by the C# Console. Requires a Reset of the C# Console.\n" + "Use this to blacklist Assembly names from being referenced by the C# Console. Requires a Reset of the C# Console.\n" +
"Separate each Assembly with a semicolon ';'." + "Separate each Assembly with a semicolon ';'." +
"For example, to blacklist Assembly-CSharp, you would add 'Assembly-CSharp;'", "For example, to blacklist Assembly-CSharp, you would add 'Assembly-CSharp;'",
@ -178,7 +179,7 @@ namespace UnityExplorer.Config
"Seperate signatures with a semicolon ';'.\r\n" + "Seperate signatures with a semicolon ';'.\r\n" +
"For example, to blacklist Camera.main, you would add 'UnityEngine.Camera.main;'", "For example, to blacklist Camera.main, you would add 'UnityEngine.Camera.main;'",
""); "");
Reflection_Hide_NativeInfoPtrs = new("Hide NativeMethodInfoPtr_s and NativeFieldInfoPtr_s", Reflection_Hide_NativeInfoPtrs = new("Hide NativeMethodInfoPtr_s and NativeFieldInfoPtr_s",
"Use this to blacklist NativeMethodPtr_s and NativeFieldInfoPtrs_s from the class inspector, mainly to reduce clutter.\r\n" + "Use this to blacklist NativeMethodPtr_s and NativeFieldInfoPtrs_s from the class inspector, mainly to reduce clutter.\r\n" +
"For example, this will hide 'Class.NativeFieldInfoPtr_value' for the field 'Class.value'.", "For example, this will hide 'Class.NativeFieldInfoPtr_value' for the field 'Class.value'.",
@ -187,15 +188,19 @@ namespace UnityExplorer.Config
Auto_Scale_UI = new("Make the mod UI automatically scale with resolution", Auto_Scale_UI = new("Make the mod UI automatically scale with resolution",
"Especially useful when running games in high resolutions and you are having a hard time reading the mods menu (requires restart).", "Especially useful when running games in high resolutions and you are having a hard time reading the mods menu (requires restart).",
true); true);
Reset_Camera_Transform = new("Reset Camera transform on freecam disable", Reset_Camera_Transform = new("Reset Camera transform on freecam disable",
"Reset the camera position and rotation between freecam sessions, so the freecam always starts from the gameplay position and rotation.", "Reset the camera position and rotation between freecam sessions, so the freecam always starts from the gameplay position and rotation.",
false); false);
Arrow_Size = new("Visualizers arrows size",
"Cam Paths nodes and Lights Manager lights visualizers' arrow size (must be positive) (needs visualizer toggled to reflect changes).",
1f);
Pause = new("Pause", Pause = new("Pause",
"Toggle the pause of the game.", "Toggle the pause of the game.",
KeyCode.PageUp); KeyCode.PageUp);
Frameskip = new("Frameskip", Frameskip = new("Frameskip",
"Skip a frame when the game is paused.", "Skip a frame when the game is paused.",
KeyCode.PageDown); KeyCode.PageDown);
@ -249,7 +254,7 @@ namespace UnityExplorer.Config
Left_1 = new("Left 1", Left_1 = new("Left 1",
"Move the freecam to the left.", "Move the freecam to the left.",
KeyCode.A); KeyCode.A);
Left_2 = new("Left 2", Left_2 = new("Left 2",
"Move the freecam to the left, alt key.", "Move the freecam to the left, alt key.",
KeyCode.LeftArrow); KeyCode.LeftArrow);

View File

@ -30,6 +30,7 @@ namespace UnityExplorer.Loader.Standalone
public bool Auto_Scale_UI; public bool Auto_Scale_UI;
public bool Reset_Camera_Transform; public bool Reset_Camera_Transform;
public FreeCamPanel.FreeCameraType Default_Freecam; public FreeCamPanel.FreeCameraType Default_Freecam;
public float Arrow_Size = 1f;
public KeyCode Pause; public KeyCode Pause;
public KeyCode Frameskip; public KeyCode Frameskip;
@ -87,6 +88,7 @@ namespace UnityExplorer.Loader.Standalone
ConfigManager.Auto_Scale_UI.Value = this.Auto_Scale_UI; ConfigManager.Auto_Scale_UI.Value = this.Auto_Scale_UI;
ConfigManager.Reset_Camera_Transform.Value = this.Reset_Camera_Transform; ConfigManager.Reset_Camera_Transform.Value = this.Reset_Camera_Transform;
ConfigManager.Default_Freecam.Value = this.Default_Freecam; ConfigManager.Default_Freecam.Value = this.Default_Freecam;
ConfigManager.Arrow_Size.Value = this.Arrow_Size;
ConfigManager.Pause.Value = this.Pause; ConfigManager.Pause.Value = this.Pause;
ConfigManager.Frameskip.Value = this.Frameskip; ConfigManager.Frameskip.Value = this.Frameskip;