Changed the lights config button to only show the inspector with the lights properties, and added a new option for the default freecam (so to be able to use the gameplay camera if you can't interact with the menu).

This commit is contained in:
originalnicodr committed 2024-03-10 12:15:32 -03:00
1 parent 180139dcd2
commit 463fec38b2
5 files changed
+20 -9

No files matched your search

+1 -2
View File
@@ -43,8 +43,7 @@ namespace UnityExplorer.UI.Panels
ButtonRef inspectButton = UIFactory.CreateButton(UIRoot, "InspectButton", "Config");
UIFactory.SetLayoutElement(inspectButton.GameObject, minWidth: 50, minHeight: 25, flexibleWidth: 9999);
inspectButton.OnClick += () => InspectorManager.InspectWithFilters(light.GetComponent<Light>(), "Light",
UnityExplorer.Inspectors.MemberFilter.Property |
UnityExplorer.Inspectors.MemberFilter.Field
UnityExplorer.Inspectors.MemberFilter.Property
);
//Move to Camera
+5
View File
@@ -30,6 +30,7 @@ namespace UnityExplorer.Config
public static ConfigElement<string> Reflection_Signature_Blacklist;
public static ConfigElement<bool> Reflection_Hide_NativeInfoPtrs;
public static ConfigElement<bool> Default_Gameplay_Freecam;
public static ConfigElement<KeyCode> Pause;
public static ConfigElement<KeyCode> Frameskip;
public static ConfigElement<KeyCode> Screenshot;
@@ -179,6 +180,10 @@ namespace UnityExplorer.Config
"For example, this will hide 'Class.NativeFieldInfoPtr_value' for the field 'Class.value'.",
false);
Default_Gameplay_Freecam = new("Default Gameplay Freecam",
"Turn this on if you want the default gameplay freecam toggle on the Freecam panel to be on on startup.",
false);
Pause = new("Pause",
"Toggle the pause of the game.",
KeyCode.PageUp);
+6 -3
View File
@@ -276,9 +276,12 @@ namespace UnityExplorer.UI.Panels
Quaternion arrowRot = lookaheadPoints[i].rotation;
if (followObject != null && FreeCamPanel.followRotationToggle.isOn) arrowRot = followObject.transform.rotation * arrowRot;
// We could expose the color of the arrow to a setting
GameObject arrow = ArrowGenerator.CreateArrow(arrowPos, arrowRot, Color.green);
arrow.transform.SetParent(pathVisualizer.transform, true);
try {
// We could expose the color of the arrow to a setting
GameObject arrow = ArrowGenerator.CreateArrow(arrowPos, arrowRot, Color.green);
arrow.transform.SetParent(pathVisualizer.transform, true);
}
catch { ExplorerCore.LogWarning("Couldn't create campath visualizer."); }
n = 0;
}
}
+2 -1
View File
@@ -270,7 +270,7 @@ namespace UnityExplorer.UI.Panels
GameObject toggleObj = UIFactory.CreateToggle(ContentRoot, "UseGameCameraToggle", out useGameCameraToggle, out Text useGameCameraText);
UIFactory.SetLayoutElement(toggleObj, minHeight: 25, flexibleWidth: 9999);
useGameCameraToggle.onValueChanged.AddListener(OnUseGameCameraToggled);
useGameCameraToggle.isOn = false;
useGameCameraToggle.isOn = ConfigManager.Default_Gameplay_Freecam.Value;
useGameCameraText.text = "Use Game Camera?";
AddSpacer(5);
@@ -499,6 +499,7 @@ namespace UnityExplorer.UI.Panels
void OnUseGameCameraToggled(bool value)
{
// TODO: Change the value on ConfigManager.Default_Gameplay_Freecam and save it
EventSystemHelper.SetSelectedGameObject(null);
if (!inFreeCamMode)
+6 -3
View File
@@ -158,9 +158,12 @@ namespace UnityExplorer.UI.Panels
switch(requestedType){
case LightType.Spot:
lightComponent.range = 10;
GameObject arrow = ArrowGenerator.CreateArrow(Vector3.zero, Quaternion.identity, lightComponent.color);
arrow.SetActive(false);
arrow.transform.SetParent(obj.transform, true);
try {
GameObject arrow = ArrowGenerator.CreateArrow(Vector3.zero, Quaternion.identity, lightComponent.color);
arrow.SetActive(false);
arrow.transform.SetParent(obj.transform, true);
}
catch { ExplorerCore.LogWarning("Couldn't create spotlight visualizer."); }
break;
case LightType.Point:
GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);