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;
@ -192,6 +193,10 @@ namespace UnityExplorer.Config
"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);

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;