From 1d75601e5ddb07f5923e6c901f4d353db326959c Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Sat, 9 Nov 2024 23:02:07 +0500 Subject: [PATCH 01/21] chore: bump UniverseLib --- UniverseLib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UniverseLib b/UniverseLib index 3dc1aba1..503ea77c 160000 --- a/UniverseLib +++ b/UniverseLib @@ -1 +1 @@ -Subproject commit 3dc1aba123650cf829cc2ea828aff737f197a4a9 +Subproject commit 503ea77c5e6e56a10ac84754b5d4b1de20286ac9 From f297f23d3ce36fbff6d82dc84e2ef4d4d7c26f50 Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Sun, 10 Nov 2024 01:09:17 +0500 Subject: [PATCH 02/21] feat: basic adaptation for NR + hide game ui + disable default camera behaviour when using free cam + reset camera rotation when enabling free cam --- src/CinematicUnityExplorer.csproj | 14 +++++ .../Extensions/GameObjectExtensions.cs | 16 ++++++ src/NightRunners/Utils/RCCUtils.cs | 54 +++++++++++++++++++ src/UI/Panels/FreeCamPanel.cs | 3 ++ 4 files changed, 87 insertions(+) create mode 100644 src/NightRunners/Extensions/GameObjectExtensions.cs create mode 100644 src/NightRunners/Utils/RCCUtils.cs diff --git a/src/CinematicUnityExplorer.csproj b/src/CinematicUnityExplorer.csproj index a2063dd8..3f5ad2b4 100644 --- a/src/CinematicUnityExplorer.csproj +++ b/src/CinematicUnityExplorer.csproj @@ -346,4 +346,18 @@ False + + + ..\..\..\..\Games\NIGHT-RUNNERS PROLOGUE 1.139\BepInEx\interop\Assembly-CSharp.dll + + + ..\..\..\..\Games\NIGHT-RUNNERS PROLOGUE 1.139\BepInEx\interop\Assembly-CSharp-firstpass.dll + + + ..\..\..\..\Games\NIGHT-RUNNERS PROLOGUE 1.139\BepInEx\interop\Rewired_Core.dll + + + ..\..\..\..\Games\NIGHT-RUNNERS PROLOGUE 1.139\BepInEx\interop\Rewired_Windows.dll + + \ No newline at end of file diff --git a/src/NightRunners/Extensions/GameObjectExtensions.cs b/src/NightRunners/Extensions/GameObjectExtensions.cs new file mode 100644 index 00000000..78802a30 --- /dev/null +++ b/src/NightRunners/Extensions/GameObjectExtensions.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CinematicUnityExplorer.NightRunners.Extensions +{ + public static class GameObjectExtensions + { + public static T NullCheck(this T unityObject) where T : UnityEngine.Object + { + return unityObject ? unityObject : null; + } + } +} diff --git a/src/NightRunners/Utils/RCCUtils.cs b/src/NightRunners/Utils/RCCUtils.cs new file mode 100644 index 00000000..68c5f292 --- /dev/null +++ b/src/NightRunners/Utils/RCCUtils.cs @@ -0,0 +1,54 @@ +using CinematicUnityExplorer.NightRunners.Extensions; +using Il2CppInterop.Runtime; +using UnityEngine; + +namespace CinematicUnityExplorer.NightRunners.Utils +{ + public static class RCCUtils + { + public static void ToggleRCC(Camera camera, bool enable) + { + ToggleRCC_Camera(camera, enable); + ToggleRCC_UI(enable); + } + + private static RCC_Camera GetRCC_Camera(Camera camera) + { + return camera.GetComponentInParent(Il2CppType.Of()) as RCC_Camera ?? + GameObject.Find("MAIN_CAMERA(Clone)").NullCheck()?.GetComponent(); + } + + private static void ToggleRCC_Camera(Camera camera, bool enable) + { + var rcc = GetRCC_Camera(camera); + if (rcc) + { + if (!enable) + { + rcc.gameObject.transform.rotation = Quaternion.identity; + } + rcc.enabled = enable; + } + else + { + Debug.LogWarning("Rcc camera not found"); + } + } + + private static void ToggleRCC_UI(bool enable) + { + var ui = GodConstant.Instance.UI_Data; + + var mainCanvas = ui.gameObject; + if (mainCanvas) + { + mainCanvas.SetActive(enable); + ui.loading_blackScreen.transform.parent.parent.gameObject.SetActive(enable); //loading screen canvas, includes "now playing" ui + } + else + { + Debug.LogWarning("Rcc ui canvas not found"); + } + } + } +} diff --git a/src/UI/Panels/FreeCamPanel.cs b/src/UI/Panels/FreeCamPanel.cs index 123e8cc0..21f46bbb 100644 --- a/src/UI/Panels/FreeCamPanel.cs +++ b/src/UI/Panels/FreeCamPanel.cs @@ -6,6 +6,7 @@ using UniverseLib.UI.Models; using System.Runtime.InteropServices; using CinematicUnityExplorer.Cinematic; +using CinematicUnityExplorer.NightRunners.Utils; #if UNHOLLOWER using UnhollowerRuntimeLib; @@ -139,6 +140,7 @@ static void SetupFreeCamera() usingGameCamera = true; ourCamera = lastMainCamera; MaybeToggleCinemachine(false); + RCCUtils.ToggleRCC(ourCamera, false); // If the farClipPlaneValue is the default one try to use the one from the gameplay camera if (farClipPlaneValue == 2000){ @@ -195,6 +197,7 @@ internal static void EndFreecam() { MaybeToggleCinemachine(true); + RCCUtils.ToggleRCC(ourCamera, true); ourCamera = null; if (lastMainCamera) From 9ffb52a2e2409f84cb9783c9b61dd996b8c0dfc0 Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Sun, 10 Nov 2024 23:53:17 +0500 Subject: [PATCH 03/21] fix: move camera container, not camera itself --- src/Cinematic/UnityIGCSConnector.cs | 4 +- src/Config/ConfigManager.cs | 2 +- src/NightRunners/Utils/RCCUtils.cs | 2 +- src/UI/Panels/FreeCamPanel.cs | 65 ++++++++++++++++------------- 4 files changed, 38 insertions(+), 35 deletions(-) diff --git a/src/Cinematic/UnityIGCSConnector.cs b/src/Cinematic/UnityIGCSConnector.cs index 1f12f051..f87186a0 100644 --- a/src/Cinematic/UnityIGCSConnector.cs +++ b/src/Cinematic/UnityIGCSConnector.cs @@ -58,10 +58,8 @@ public void UpdateFreecamStatus(bool enabled) Marshal.WriteByte(CameraStatus, enabled ? (byte)0x1 : (byte)0x0); } - public void ExecuteCameraCommand(Camera cam) + public void ExecuteCameraCommand(Transform transform) { - var transform = cam.transform; - // Check whether we should go back to the original position despite being active or not this.ShouldMoveToOriginalPosition(transform); diff --git a/src/Config/ConfigManager.cs b/src/Config/ConfigManager.cs index 277070e0..9e57790a 100644 --- a/src/Config/ConfigManager.cs +++ b/src/Config/ConfigManager.cs @@ -187,7 +187,7 @@ private static void CreateConfigElements() 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); + true); Pause = new("Pause", "Toggle the pause of the game.", diff --git a/src/NightRunners/Utils/RCCUtils.cs b/src/NightRunners/Utils/RCCUtils.cs index 68c5f292..23ba80e8 100644 --- a/src/NightRunners/Utils/RCCUtils.cs +++ b/src/NightRunners/Utils/RCCUtils.cs @@ -12,7 +12,7 @@ public static void ToggleRCC(Camera camera, bool enable) ToggleRCC_UI(enable); } - private static RCC_Camera GetRCC_Camera(Camera camera) + public static RCC_Camera GetRCC_Camera(Camera camera) { return camera.GetComponentInParent(Il2CppType.Of()) as RCC_Camera ?? GameObject.Find("MAIN_CAMERA(Clone)").NullCheck()?.GetComponent(); diff --git a/src/UI/Panels/FreeCamPanel.cs b/src/UI/Panels/FreeCamPanel.cs index 21f46bbb..6afa708d 100644 --- a/src/UI/Panels/FreeCamPanel.cs +++ b/src/UI/Panels/FreeCamPanel.cs @@ -42,6 +42,7 @@ public FreeCamPanel(UIBase owner) : base(owner) internal static bool usingGameCamera; public static Camera ourCamera; public static Camera lastMainCamera; + public static Transform CameraContainer; internal static FreeCamBehaviour freeCamScript; internal static CatmullRom.CatmullRomMover cameraPathMover; @@ -109,17 +110,19 @@ internal static void BeginFreecam() static void CacheMainCamera() { Camera currentMain = Camera.main; + CameraContainer = RCCUtils.GetRCC_Camera(currentMain).transform; + if (currentMain) { lastMainCamera = currentMain; - originalCameraPosition = currentMain.transform.position; - originalCameraRotation = currentMain.transform.rotation; + originalCameraPosition = CameraContainer.position; + originalCameraRotation = CameraContainer.rotation; originalCameraFOV = currentMain.fieldOfView; if (currentUserCameraPosition == null) { - currentUserCameraPosition = currentMain.transform.position; - currentUserCameraRotation = currentMain.transform.rotation; + currentUserCameraPosition = CameraContainer.position; + currentUserCameraRotation = CameraContainer.rotation; } } else @@ -167,16 +170,16 @@ static void SetupFreeCamera() ourCamera.gameObject.tag = "MainCamera"; GameObject.DontDestroyOnLoad(ourCamera.gameObject); ourCamera.gameObject.hideFlags = HideFlags.HideAndDontSave; + CameraContainer = ourCamera.transform; } if (!freeCamScript) - freeCamScript = ourCamera.gameObject.AddComponent(); + freeCamScript = CameraContainer.gameObject.AddComponent(); if (!cameraPathMover) - cameraPathMover = ourCamera.gameObject.AddComponent(); + cameraPathMover = CameraContainer.gameObject.AddComponent(); - ourCamera.transform.position = (Vector3)currentUserCameraPosition; - ourCamera.transform.rotation = (Quaternion)currentUserCameraRotation; + CameraContainer.SetPositionAndRotation((Vector3)currentUserCameraPosition, (Quaternion)currentUserCameraRotation); ourCamera.gameObject.SetActive(true); ourCamera.enabled = true; @@ -202,10 +205,13 @@ internal static void EndFreecam() if (lastMainCamera) { - lastMainCamera.transform.position = originalCameraPosition; - lastMainCamera.transform.rotation = originalCameraRotation; lastMainCamera.fieldOfView = originalCameraFOV; } + + if (CameraContainer) + { + CameraContainer.SetPositionAndRotation(originalCameraPosition, originalCameraRotation); + } } if (ourCamera) @@ -259,7 +265,7 @@ static void SetCameraPositionInput(Vector3 pos) if (!ourCamera || lastSetCameraPosition == pos) return; - ourCamera.transform.position = pos; + CameraContainer.position = pos; lastSetCameraPosition = pos; } @@ -274,7 +280,7 @@ internal static void UpdatePositionInput() if (connector != null && connector.IsActive) return; - lastSetCameraPosition = ourCamera.transform.position; + lastSetCameraPosition = CameraContainer.position; positionInput.Text = ParseUtility.ToStringForInput(lastSetCameraPosition); } @@ -621,50 +627,50 @@ public static bool ShouldOverrideInput(){ // Getters and Setters for camera position and rotation public static Vector3 GetCameraPosition(bool isAbsolute = false){ - if (isAbsolute) return ourCamera.transform.position; + if (isAbsolute) return CameraContainer.position; if (followObject){ if (followRotationToggle.isOn){ - return Quaternion.Inverse(followObject.transform.rotation) * (ourCamera.transform.position - followObject.transform.position); + return Quaternion.Inverse(followObject.transform.rotation) * (CameraContainer.position - followObject.transform.position); } else { - return ourCamera.transform.position - followObject.transform.position; + return CameraContainer.position - followObject.transform.position; } } - return ourCamera.transform.position; + return CameraContainer.position; } public static Quaternion GetCameraRotation(bool isAbsolute = false){ - if (isAbsolute) return ourCamera.transform.rotation; - if (followObject && followRotationToggle.isOn) return Quaternion.Inverse(followObjectLastRotation) * ourCamera.transform.rotation; - return ourCamera.transform.rotation; + if (isAbsolute) return CameraContainer.rotation; + if (followObject && followRotationToggle.isOn) return Quaternion.Inverse(followObjectLastRotation) * CameraContainer.rotation; + return CameraContainer.rotation; } public static void SetCameraPosition(Vector3 newPosition, bool isAbsolute = false){ if (isAbsolute){ - ourCamera.transform.position = newPosition; + CameraContainer.position = newPosition; } else if (followObject){ if (followRotationToggle.isOn){ - ourCamera.transform.position = followObject.transform.rotation * newPosition + followObject.transform.position; + CameraContainer.position = followObject.transform.rotation * newPosition + followObject.transform.position; } else { - ourCamera.transform.position = newPosition + followObject.transform.position; + CameraContainer.position = newPosition + followObject.transform.position; } } else { - ourCamera.transform.position = newPosition; + CameraContainer.position = newPosition; } } public static void SetCameraRotation(Quaternion newRotation, bool isAbsolute = false){ if (isAbsolute){ - ourCamera.transform.rotation = newRotation; + CameraContainer.rotation = newRotation; } else if (followObject && followRotationToggle.isOn){ - ourCamera.transform.rotation = followObjectLastRotation * newRotation; + CameraContainer.rotation = followObjectLastRotation * newRotation; } else { - ourCamera.transform.rotation = newRotation; + CameraContainer.rotation = newRotation; } } } @@ -689,7 +695,7 @@ internal void Update() FreeCamPanel.EndFreecam(); return; } - Transform transform = FreeCamPanel.ourCamera.transform; + Transform transform = FreeCamPanel.CameraContainer; if (!FreeCamPanel.blockFreecamMovementToggle.isOn && !FreeCamPanel.cameraPathMover.playingPath && FreeCamPanel.connector?.IsActive != true) { ProcessInput(); @@ -703,15 +709,14 @@ internal void Update() // rotation update Quaternion deltaRotation = FreeCamPanel.followObject.transform.rotation * Quaternion.Inverse(FreeCamPanel.followObjectLastRotation); Vector3 offset = transform.position - FreeCamPanel.followObject.transform.position; - transform.position = transform.position - offset + deltaRotation * offset; - transform.rotation = deltaRotation * transform.rotation; + transform.SetPositionAndRotation(transform.position - offset + deltaRotation * offset, deltaRotation * transform.rotation); } FreeCamPanel.followObjectLastPosition = FreeCamPanel.followObject.transform.position; FreeCamPanel.followObjectLastRotation = FreeCamPanel.followObject.transform.rotation; } - FreeCamPanel.connector?.ExecuteCameraCommand(FreeCamPanel.ourCamera); + FreeCamPanel.connector?.ExecuteCameraCommand(transform); FreeCamPanel.UpdatePositionInput(); } From 2fe20461037a5218ee87d94869de16a089b284c3 Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Mon, 11 Nov 2024 00:54:14 +0500 Subject: [PATCH 04/21] feat: add "Follow Car" button --- src/UI/Panels/FreeCamPanel.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/UI/Panels/FreeCamPanel.cs b/src/UI/Panels/FreeCamPanel.cs index 6afa708d..cf0944fd 100644 --- a/src/UI/Panels/FreeCamPanel.cs +++ b/src/UI/Panels/FreeCamPanel.cs @@ -68,6 +68,7 @@ public FreeCamPanel(UIBase owner) : base(owner) static InputFieldRef moveSpeedInput; static Text followObjectLabel; static ButtonRef inspectButton; + static ButtonRef followPlayerCarButton; public static Toggle followRotationToggle; static bool disabledCinemachine; @@ -392,6 +393,11 @@ protected override void ConstructPanelContent() UIFactory.SetLayoutElement(releaseFollowButton.GameObject, minWidth: 150, minHeight: 25, flexibleWidth: 9999); releaseFollowButton.OnClick += ReleaseFollowButton_OnClick; + followPlayerCarButton = UIFactory.CreateButton(ContentRoot, "FollowPlayerCarButton", "Follow Car"); + UIFactory.SetLayoutElement(followPlayerCarButton.GameObject, minWidth: 150, minHeight: 25, flexibleWidth: 9999); + followPlayerCarButton.OnClick += FollowPlayerCar; + //followPlayerCarButton.GameObject.SetActive(false); + GameObject followRotationGameObject = UIFactory.CreateToggle(ContentRoot, "followRotationToggle", out followRotationToggle, out Text followRotationText); UIFactory.SetLayoutElement(followRotationGameObject, minHeight: 25, flexibleWidth: 9999); followRotationToggle.isOn = false; @@ -503,6 +509,26 @@ void FollowButton_OnClick() MouseInspector.Instance.StartInspect(MouseInspectMode.World, FollowObjectAction); } + void FollowPlayerCar() + { + try + { + var go = GodConstant.Instance.playerCar.gameObject; + if (go) + { + FollowObjectAction(go); + } + else + { + Debug.LogWarning("failed to find player car"); + } + } + catch (Exception e) + { + Debug.LogError(e.Message); + } + } + void ReleaseFollowButton_OnClick() { if (followObject){ From 138d13f8a4f05cbbbb5fca6672e1f19735ef71f6 Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Tue, 12 Nov 2024 21:43:45 +0500 Subject: [PATCH 05/21] build: update ci + add nightly workflow --- .github/workflows/dotnet_nightly.yml | 55 +++++++++++++++++++++++++++ build_nightly.ps1 | 13 +++++++ src/CinematicUnityExplorer.csproj | 57 ++++++++++++++++++++-------- 3 files changed, 110 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/dotnet_nightly.yml create mode 100644 build_nightly.ps1 diff --git a/.github/workflows/dotnet_nightly.yml b/.github/workflows/dotnet_nightly.yml new file mode 100644 index 00000000..58d79691 --- /dev/null +++ b/.github/workflows/dotnet_nightly.yml @@ -0,0 +1,55 @@ +name: Build CinematicUnityExplorer (Nightly) + +# Controls when the action will run. +on: + push: + branches: [development] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build_dotnet: + runs-on: windows-latest + if: "!contains(github.event.head_commit.message, '-noci')" + + steps: + # Setup + + - name: Checkout latest + uses: actions/checkout@v4 + with: + submodules: true + - name: Checkout private tools + uses: actions/checkout@v4 + with: + repository: ${{ secrets.NR_INTEROP_REPO }} + token: ${{ secrets.NR_INTEROP_TOKEN }} + path: NR_INTEROP + - name: Setup dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "6.x" + + - name: Cache UniverseLib + id: cache-universe-lib-build + uses: actions/cache@v4 + env: + cache-name: cache-universe-lib + with: + path: ./UniverseLib/Release + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('.git\modules\UniverseLib\HEAD') }} + + - if: ${{ steps.cache-universe-lib-build.outputs.cache-hit != 'true' }} + name: Build UniverseLib + working-directory: ./UniverseLib + run: dotnet build src\UniverseLib.sln -c Release_IL2CPP_Interop_BIE + + - name: Build UE + run: ./build_nightly.ps1 + + # Upload artifacts + - name: Upload BepInEx.Unity.IL2CPP.CoreCLR + uses: actions/upload-artifact@v4 + with: + name: CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR.zip + path: ./Release/CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR/output diff --git a/build_nightly.ps1 b/build_nightly.ps1 new file mode 100644 index 00000000..21f9a381 --- /dev/null +++ b/build_nightly.ps1 @@ -0,0 +1,13 @@ +# ----------- BepInEx Unity IL2CPP CoreCLR ----------- +$Path = "Release/CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR" +$OutputPath = "$Path/output/BepInEx/plugins/CinematicUnityExplorer" + +dotnet build src/CinematicUnityExplorer.sln -c Release_BIE_Unity_Cpp -p:IS_CI=true + +New-Item -ItemType Directory -Path $OutputPath -Force + +# ILRepack +lib/ILRepack.exe /target:library /lib:lib/net472/BepInEx/build647+ /lib:lib/net6/ /lib:lib/interop/ /lib:$Path /internalize /out:$OutputPath/CinematicUnityExplorer.BIE.Unity.IL2CPP.CoreCLR.dll $Path/CinematicUnityExplorer.BIE.Unity.IL2CPP.CoreCLR.dll $Path/mcs.dll $Path/Tomlet.dll + +# (cleanup and move files) +Move-Item -Path $Path/UniverseLib.BIE.IL2CPP.Interop.dll -Destination $OutputPath -Force diff --git a/src/CinematicUnityExplorer.csproj b/src/CinematicUnityExplorer.csproj index 3f5ad2b4..4d648ff0 100644 --- a/src/CinematicUnityExplorer.csproj +++ b/src/CinematicUnityExplorer.csproj @@ -16,7 +16,7 @@ - + @@ -346,18 +346,45 @@ False - - - ..\..\..\..\Games\NIGHT-RUNNERS PROLOGUE 1.139\BepInEx\interop\Assembly-CSharp.dll - - - ..\..\..\..\Games\NIGHT-RUNNERS PROLOGUE 1.139\BepInEx\interop\Assembly-CSharp-firstpass.dll - - - ..\..\..\..\Games\NIGHT-RUNNERS PROLOGUE 1.139\BepInEx\interop\Rewired_Core.dll - - - ..\..\..\..\Games\NIGHT-RUNNERS PROLOGUE 1.139\BepInEx\interop\Rewired_Windows.dll - - + + + + + ..\NR_INTEROP\Assembly-CSharp.dll + + + ..\NR_INTEROP\Assembly-CSharp-firstpass.dll + + + ..\NR_INTEROP\Rewired_Core.dll + + + ..\NR_INTEROP\Rewired_Windows.dll + + + + + + + ..\..\..\..\Games\NIGHT-RUNNERS PROLOGUE 1.139\BepInEx\interop\Assembly-CSharp.dll + + + ..\..\..\..\Games\NIGHT-RUNNERS PROLOGUE 1.139\BepInEx\interop\Assembly-CSharp-firstpass.dll + + + ..\..\..\..\Games\NIGHT-RUNNERS PROLOGUE 1.139\BepInEx\interop\Rewired_Core.dll + + + ..\..\..\..\Games\NIGHT-RUNNERS PROLOGUE 1.139\BepInEx\interop\Rewired_Windows.dll + + + + + + + + + False + + \ No newline at end of file From 67f90d9d96c48aec1055b61fffc299f24716b2df Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Wed, 13 Nov 2024 03:15:46 +0500 Subject: [PATCH 06/21] docs: update readme [-noci] --- README.md | 74 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 2a2879a7..3fed1e4b 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,21 @@ # Cinematic Unity Explorer +

+Adapted for Night-Runners. +

+

- 🎥 Fork of the excellent UnityExplorer mod made by sinai-dev focused on providing tools for creating marketing material for Unity games. + Fork of the excellent CinematicUnityExplorer mod made by originalnicodr focused on providing support for Night-Runners game.

- To see the forks features I have worked on so far check out the Features section. + 🎥 CinematicUnityExplorer is a fork of the excellent UnityExplorer mod made by sinai-dev focused on providing tools for creating marketing material for Unity games. +

+

+ To see the forks features we have worked on so far check out the Features section.

✔️ Supports most Unity versions from 5.2 to 2021+ (IL2CPP and Mono). @@ -17,9 +24,11 @@ ✨ Powered by UniverseLib

-# Releases [![](https://img.shields.io/github/downloads/originalnicodr/CinematicUnityExplorer/total.svg)](../../releases) +# Releases [![](https://img.shields.io/github/downloads/Scoolnik/NR-CinematicUnityExplorer/total.svg)](../../releases) + +[![](https://img.shields.io/github/release/Scoolnik/NR-CinematicUnityExplorer.svg?label=version)](../../releases/latest) [![](https://img.shields.io/github/actions/workflow/status/Scoolnik/NR-CinematicUnityExplorer/dotnet.yml)](https://github.com/Scoolnik/NR-CinematicUnityExplorer/actions) [![](https://img.shields.io/github/downloads/Scoolnik/NR-CinematicUnityExplorer/latest/total.svg)](../../releases/latest) -[![](https://img.shields.io/github/release/originalnicodr/CinematicUnityExplorer.svg?label=version)](../../releases/latest) [![](https://img.shields.io/github/actions/workflow/status/originalnicodr/CinematicUnityExplorer/dotnet.yml)](https://github.com/originalnicodr/CinematicUnityExplorer/actions) [![](https://img.shields.io/github/downloads/originalnicodr/CinematicUnityExplorer/latest/total.svg)](../../releases/latest) +Nightly build: https://nightly.link/Scoolnik/NR-CinematicUnityExplorer/workflows/dotnet_nightly/development/CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR.zip

@@ -30,15 +39,15 @@ ## Release schedule -Nightly builds can be found [here](https://github.com/originalnicodr/CinematicUnityExplorer/actions). +Nightly builds can be found [here](https://github.com/Scoolnik/NR-CinematicUnityExplorer/actions). ## BepInEx | Release | IL2CPP(CoreCLR) | IL2CPP(Unhollower) | Mono | | ------- | ------ | ------ | ---- | -| BIE 6.X be.647+ | ✅ [link](https://github.com/originalnicodr/CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR.zip) | ✖️ n/a | ✅ [link](https://github.com/originalnicodr/CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx6.Unity.Mono.zip) | -| BIE 6.X be.472 to be.577 | ✅ [link](https://github.com/originalnicodr/CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx.IL2CPP.CoreCLR.zip) | ✅ [link](https://github.com/originalnicodr/CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx.IL2CPP.zip) | ✅ [link](https://github.com/originalnicodr/CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx6.Mono.zip) | -| BIE 5.X | ✖️ n/a | ✖️ n/a | ✅ [link](https://github.com/originalnicodr/CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx5.Mono.zip) | +| BIE 6.X be.647+ | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR.zip) | ✖️ n/a | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx6.Unity.Mono.zip) | +| BIE 6.X be.472 to be.577 | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx.IL2CPP.CoreCLR.zip) | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx.IL2CPP.zip) | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx6.Mono.zip) | +| BIE 5.X | ✖️ n/a | ✖️ n/a | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx5.Mono.zip) | 1. Unzip the release file into a folder 2. Take the `plugins/CinematicUnityExplorer` folder and place it in `BepInEx/plugins/` @@ -49,9 +58,9 @@ Nightly builds can be found [here](https://github.com/originalnicodr/CinematicUn | Release | IL2CPP | Mono | | ------- | ------ | ---- | -| ML 0.6.x | ✅ [link](https://github.com/originalnicodr/CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.MelonLoader.IL2CPP.CoreCLR.zip) | ✖️ | -| ML 0.6(only alpha build) | ✅ [link](https://github.com/originalnicodr/CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.MelonLoader.IL2CPP.net6preview.zip) | ✖️ | -| ML 0.5 | ✅ [link](https://github.com/originalnicodr/CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.MelonLoader.IL2CPP.zip) | ✅ [link](https://github.com/originalnicodr/CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.MelonLoader.Mono.zip) | +| ML 0.6.x | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.MelonLoader.IL2CPP.CoreCLR.zip) | ✖️ | +| ML 0.6(only alpha build) | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.MelonLoader.IL2CPP.net6preview.zip) | ✖️ | +| ML 0.5 | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.MelonLoader.IL2CPP.zip) | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.MelonLoader.Mono.zip) | 1. Unzip the release file into a folder 2. Copy the DLL inside the `Mods` folder into your MelonLoader `Mods` folder @@ -61,11 +70,11 @@ Nightly builds can be found [here](https://github.com/originalnicodr/CinematicUn | IL2CPP | Mono | | ------ | ---- | -| ✅ [link](https://github.com/originalnicodr/CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.Standalone.IL2CPP.zip) | ✅ [link](https://github.com/originalnicodr/CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.Standalone.Mono.zip) | +| ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.Standalone.IL2CPP.zip) | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.Standalone.Mono.zip) | The standalone release can be used with any injector or loader of your choice, but it requires you to load the dependencies manually. -1. Ensure the required libs are loaded - UniverseLib, HarmonyX and MonoMod. Take them from the [`CinematicUnityExplorer.Editor`](https://github.com/originalnicodr/CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.Editor.zip) release if you need them. +1. Ensure the required libs are loaded - UniverseLib, HarmonyX and MonoMod. Take them from the [`CinematicUnityExplorer.Editor`](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.Editor.zip) release if you need them. 2. For IL2CPP, load Il2CppAssemblyUnhollower and start an [Il2CppAssemblyUnhollower runtime](https://github.com/knah/Il2CppAssemblyUnhollower#required-external-setup) 2. Load the CinematicUnityExplorer DLL 3. Create an instance of Unity Explorer with `UnityExplorer.ExplorerStandalone.CreateInstance();` @@ -73,7 +82,7 @@ The standalone release can be used with any injector or loader of your choice, b ## Unity Editor -1. Download the [`CinematicUnityExplorer.Editor`](https://github.com/originalnicodr/CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.Editor.zip) release. +1. Download the [`CinematicUnityExplorer.Editor`](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.Editor.zip) release. 2. Install the package, either by using the Package Manager and importing the `package.json` file, or by manually dragging the folder into your `Assets` folder. 3. Drag the `Runtime/CinematicUnityExplorer` prefab into your scene, or create a GameObject and add the `Explorer Editor Behaviour` script to it. @@ -94,7 +103,7 @@ If these fixes do not work, please create an issue in this repo and I'll do my b # Guide and documentation -I wrote a [guide](https://framedsc.com/GeneralGuides/cinematic-unity-explorer.htm) explaining different things regarding the Cinematic Unity Explorer over the Framed website, from knowing what version to download with your game and troubleshooting, to usage and tips and tricks. Feel free to create a PR on the [Framed GitHub repo](https://github.com/framedsc/Sitesource) if you want to improve it. +originalnicodr wrote a [guide](https://framedsc.com/GeneralGuides/cinematic-unity-explorer.htm) explaining different things regarding the Cinematic Unity Explorer over the Framed website, from knowing what version to download with your game and troubleshooting, to usage and tips and tricks. Feel free to create a PR on the [Framed GitHub repo](https://github.com/framedsc/Sitesource) if you want to improve it. # Default Hotkeys @@ -124,9 +133,17 @@ Freeze NPC animations | `Numpad 0` # Features +NR fork features: +- "Follow car" button +- Hide game ui +- Disable default camera behaviour when using free cam +- Move camera container, not camera itself + +## The following are features from the original CinematicUnityExplorer project which I have not made myself (text left as is). + The following are the features I developed for this fork. All focused on making things easier for capture artists to get marketing material for studios. -If you found a bug or a problem (or want to see the things I want to work on) head over to the [issues page](https://github.com/originalnicodr/CinematicUnityExplorer/issues). +If you found a bug or a problem (or want to see the things I want to work on) head over to the [issues page](https://github.com/Scoolnik/NR-CinematicUnityExplorer/issues). ## Improved Freecam @@ -143,25 +160,28 @@ The original Unity Explorer had a Freecam feature, but even if it was useful at - Blocked rotation from going further when looking directly up or directly down. ### Follow Object + You can click on the "Follow object" button on the panel and select the object you want the camera to follow or click on the "Follow object" button in the inspector screen for more granularity. This can be used as it is, but it's even more useful when playing with [camera paths](#camera-paths), as you can create a path for the camera to walk relative to the object By default the camera only follows the object's position, but you can also make it follow its rotation as if the camera was physically bound to the object by checking the "Follow Object Rotation" toggle. Should be useful for mimicking a car camera, a character POV, or creating motion blur. ### Game input block for Unity's legacy system + Added game input block for Unity's legacy system. You can now block (or unblock) the game's input when using the freecam, as long as the game is using the Unity Legacy Input system. If the game uses a custom solution or the latest Unity system then this won't work. Implementing this for Unity's new system is in the backlog, so if you find a game using it (should say "Initialized new InputSystem support." on the logs) then please let me know so I can implement it using that game! ## Lights manager + It allows you to spawn spotlights and pointlights, as well as toggle the game's original lights to allow you to relight the scene however you want (a task that is pretty common for screenshots and lighting artists). Please note that this only turns off scene lights and won't turn off ambient light or lights created by emissive materials, effects, or shaders.

- +

You can edit the light parameters by clicking on the "Config" button. There might be a ton of stuff there, but you would want to focus on these properties: -- **Intensity**: How strong the light is. +- **Intensity**: How strong the light is. - **Range**: How far the light travels. - **Color**: Pretty self explanatory. - **Color Temperature**: In case you want to use more natural colors. You would also need to enable the `useColorTemperature` property. @@ -172,9 +192,11 @@ If you want to move an already created light you can use the "Move to Camera" op There also is a default intensity input field on the panel. Since the intensity varies a lot from game to game you have to increase/decrease this property on a light until it looks right, and once you figure out a value that works for your game you can write it as the default intensity and don't have to edit it on the new lights you spawn from that point. ### Visualizer + You can also draw an arrow or sphere representing the light source from spotlights and point lights respectively, to understand your light setups better. To do so click on the "Toggle visualizer" button on a light in the panel. ## Camera paths + It allows you to create nodes to build camera paths for videos and cinematics. Features include: - Add and delete camera path nodes. @@ -192,14 +214,17 @@ It allows you to create nodes to build camera paths for videos and cinematics. F As a side note, the mod UI will be disabled once the path starts, to ease video recording. ### Visualizer + Similarly to the Light Manager, you can visualize a camera path with arrows, whose origin and orientation represent the position and orientation that the camera will have at that point in the curve. You can turn this on by clicking on the "Visualize path" checkbox. Keep in mind that this will be turned off once the path starts playing since its purpose is to help the user set up the path itself. ## Post-processing panel + It loads all the current vanilla post-processing effects being used and offers togglers to disable them. It also lets you inspect the postprocessing objects yourself if you want to edit their parameters instead. [Shader toggler](https://github.com/FransBouma/ShaderToggler) would still be preferred (especially as it will be able to catch custom effects that this mod can't), but it might still be useful for some. ## Animator + Allows you to manually play characters and NPC animations in a scene. This should be pretty useful for getting the right animation on each enemy to set up marketing screenshots. Favorite animations so they appear first on the dropdown list by clicking on the star button with the animation selected. @@ -213,6 +238,7 @@ Alongside all of this, you can also open each character game object by clicking For each animator, you can also spawn a Bones Panel. This panel will list all of the character's bones and meshes, and provide easy-to-access toggles to disable them and sliders to move them around, allowing you to pose a character to your liking. ## Misc Panel + - HUD toggle. - Force high LODs toggle. This means that the highest models possible will be forced on all meshes. - Screenshot support. Allows you to momentarily render the game at a higher resolution than the one being used and take a screenshot. You can enter the multiplier of the current resolution at which the screenshot should render in the "Supersize" field. @@ -224,6 +250,7 @@ For each animator, you can also spawn a Bones Panel. This panel will list all of - Toggle to change the resolution of shadows generated by the game's vanilla lights. Beware using this one with the two options from above. Also, take in mind that lights created with the Light Manager already generate high-resolution shadows. ## And more! + - Refactored the pause to make it more reliable. - Hotkey to pause the game. - Added a slider to the TimeScale. @@ -234,6 +261,7 @@ For each animator, you can also spawn a Bones Panel. This panel will list all of # IGCSDOF Support The mod also supports [IGCSConnector](https://github.com/FransBouma/IgcsConnector/releases), and therefore [IGCSDOF](https://opm.fransbouma.com/igcsdof.htm), the best modded DOF available. This is an accumulated DOF solution similar to Forza Horizon's or other offline rendering software. This accumulated solution brings some advantages compared to real-time solutions, such as: + - Accurate near-plane bleed. - Particle & alpha effects in DOF. - Depth-accurate reflections. @@ -245,11 +273,11 @@ The mod also supports [IGCSConnector](https://github.com/FransBouma/IgcsConnecto You can download it, read how to install it, and how to use it [here](https://opm.fransbouma.com/igcsdof.htm). ->[!IMPORTANT] -> To be able to use IGCSDOF, besides following the instructions above, make sure to download [UnityIGCSConnector.dll](https://github.com/originalnicodr/CinematicUnityExplorer/releases/latest/download/UnityIGCSConnector.dll) and put it in the same folder as the games .exe. +> [!IMPORTANT] +> To be able to use IGCSDOF, besides following the instructions above, make sure to download [UnityIGCSConnector.dll](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/UnityIGCSConnector.dll) and put it in the same folder as the games .exe. > This is a necessary middleware so the Reshade add-on can communicate with the mod. ->[!IMPORTANT] +> [!IMPORTANT] > Be sure to select `Classic (slower)` mode instead of `Fast`, as the latter one seems to render the image out of focus. However `Fast` might still work in some games. Huge shout out to [etra0](https://github.com/etra0) for implementing this! @@ -265,7 +293,7 @@ Maybe I would make a separate version one day, but for now, it is what it is. The following are features from the original UnityExplorer project which I have not made myself.

- +

@@ -275,11 +303,13 @@ The following are features from the original UnityExplorer project which I have If you want to inspect an object or Type from outside the C# console, use the `InspectorManager` class: **To inspect an object:** + ```csharp UnityExplorer.InspectorManager.Inspect(theObject); ``` **To inspect a Type:** + ```cs UnityExplorer.InspectorManager.Inspect(typeof(SomeClass)); ``` From 8f37ae6b87b6ef798a0b9162ae06a78533d2326f Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Thu, 14 Nov 2024 05:30:59 +0500 Subject: [PATCH 07/21] fix: keep in mind camera might be moved by external script --- src/UI/Panels/FreeCamPanel.cs | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/UI/Panels/FreeCamPanel.cs b/src/UI/Panels/FreeCamPanel.cs index cf0944fd..81a898d9 100644 --- a/src/UI/Panels/FreeCamPanel.cs +++ b/src/UI/Panels/FreeCamPanel.cs @@ -85,6 +85,7 @@ public FreeCamPanel(UIBase owner) : base(owner) public static GameObject followObject = null; public static Vector3 followObjectLastPosition = Vector3.zero; public static Quaternion followObjectLastRotation = Quaternion.identity; + public static Vector3 lastKnownPosition = Vector3.zero; private static FreecamCursorUnlocker freecamCursorUnlocker = null; @@ -723,13 +724,21 @@ internal void Update() } Transform transform = FreeCamPanel.CameraContainer; + var inputDelta = Vector3.zero; if (!FreeCamPanel.blockFreecamMovementToggle.isOn && !FreeCamPanel.cameraPathMover.playingPath && FreeCamPanel.connector?.IsActive != true) { - ProcessInput(); + inputDelta = ProcessInput(); } - if (FreeCamPanel.followObject != null){ + if (FreeCamPanel.followObject != null){ // position update - transform.position += FreeCamPanel.followObject.transform.position - FreeCamPanel.followObjectLastPosition; + var positionDelta = FreeCamPanel.followObject.transform.position - FreeCamPanel.followObjectLastPosition; + + if (FreeCamPanel.lastKnownPosition != Vector3.zero) + { + //TODO: check delta + positionDelta -= transform.position - (FreeCamPanel.lastKnownPosition + inputDelta); + } + transform.position += positionDelta; if (FreeCamPanel.followRotationToggle.isOn){ // rotation update @@ -745,10 +754,12 @@ internal void Update() FreeCamPanel.connector?.ExecuteCameraCommand(transform); FreeCamPanel.UpdatePositionInput(); + + FreeCamPanel.lastKnownPosition = FreeCamPanel.followObject ? transform.position : Vector3.zero; } } - internal void ProcessInput(){ + internal Vector3 ProcessInput(){ FreeCamPanel.currentUserCameraPosition = transform.position; FreeCamPanel.currentUserCameraRotation = transform.rotation; @@ -761,24 +772,26 @@ internal void ProcessInput(){ speedModifier = 0.1f; moveSpeed *= speedModifier; + + var delta = Vector3.zero; if (IInputManager.GetKey(ConfigManager.Left_1.Value) || IInputManager.GetKey(ConfigManager.Left_2.Value)) - transform.position += transform.right * -1 * moveSpeed; + delta += transform.right * -1 * moveSpeed; if (IInputManager.GetKey(ConfigManager.Right_1.Value) || IInputManager.GetKey(ConfigManager.Right_2.Value)) - transform.position += transform.right * moveSpeed; + delta += transform.right * moveSpeed; if (IInputManager.GetKey(ConfigManager.Forwards_1.Value) || IInputManager.GetKey(ConfigManager.Forwards_2.Value)) - transform.position += transform.forward * moveSpeed; + delta += transform.forward * moveSpeed; if (IInputManager.GetKey(ConfigManager.Backwards_1.Value) || IInputManager.GetKey(ConfigManager.Backwards_2.Value)) - transform.position += transform.forward * -1 * moveSpeed; + delta += transform.forward * -1 * moveSpeed; if (IInputManager.GetKey(ConfigManager.Up.Value)) - transform.position += transform.up * moveSpeed; + delta += transform.up * moveSpeed; if (IInputManager.GetKey(ConfigManager.Down.Value)) - transform.position += transform.up * -1 * moveSpeed; + delta += transform.up * -1 * moveSpeed; if (IInputManager.GetKey(ConfigManager.Tilt_Left.Value)) transform.Rotate(0, 0, moveSpeed * 10, Space.Self); @@ -840,6 +853,8 @@ internal void ProcessInput(){ } FreeCamPanel.previousMousePosition = IInputManager.MousePosition; + transform.position += delta; + return delta; } } From a0effd1f306affd95a95d2082242f8abacceaf0a Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Thu, 14 Nov 2024 22:17:28 +0500 Subject: [PATCH 08/21] fix: update last known position in FreeCamPanel.SetCameraPosition --- src/UI/Panels/FreeCamPanel.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/UI/Panels/FreeCamPanel.cs b/src/UI/Panels/FreeCamPanel.cs index 81a898d9..83a50d37 100644 --- a/src/UI/Panels/FreeCamPanel.cs +++ b/src/UI/Panels/FreeCamPanel.cs @@ -687,6 +687,7 @@ public static void SetCameraPosition(Vector3 newPosition, bool isAbsolute = fals else { CameraContainer.position = newPosition; } + lastKnownPosition = CameraContainer.position; } public static void SetCameraRotation(Quaternion newRotation, bool isAbsolute = false){ From 5f7e09d2802eba32d3e3add8d713a9726f9c42a3 Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Thu, 14 Nov 2024 22:21:09 +0500 Subject: [PATCH 09/21] chore: use game camera by default --- src/UI/Panels/FreeCamPanel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UI/Panels/FreeCamPanel.cs b/src/UI/Panels/FreeCamPanel.cs index 83a50d37..cc63d0ea 100644 --- a/src/UI/Panels/FreeCamPanel.cs +++ b/src/UI/Panels/FreeCamPanel.cs @@ -307,7 +307,7 @@ protected override void ConstructPanelContent() GameObject toggleObj = UIFactory.CreateToggle(ContentRoot, "UseGameCameraToggle", out useGameCameraToggle, out Text useGameCameraText); UIFactory.SetLayoutElement(toggleObj, minHeight: 25, flexibleWidth: 9999); useGameCameraToggle.onValueChanged.AddListener(OnUseGameCameraToggled); - useGameCameraToggle.isOn = ConfigManager.Default_Gameplay_Freecam.Value; + useGameCameraToggle.isOn = true;//ConfigManager.Default_Gameplay_Freecam.Value; useGameCameraText.text = "Use Game Camera?"; AddSpacer(5); From 6785706ea521eba2e2c5e96a4224163f8afd1fa8 Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Thu, 14 Nov 2024 23:01:17 +0500 Subject: [PATCH 10/21] fix: get camera container in garage and meetspot --- src/NightRunners/Utils/RCCUtils.cs | 61 ++++++++++++++++++++++++++---- src/UI/Panels/FreeCamPanel.cs | 9 +++-- 2 files changed, 59 insertions(+), 11 deletions(-) diff --git a/src/NightRunners/Utils/RCCUtils.cs b/src/NightRunners/Utils/RCCUtils.cs index 23ba80e8..e2295574 100644 --- a/src/NightRunners/Utils/RCCUtils.cs +++ b/src/NightRunners/Utils/RCCUtils.cs @@ -6,21 +6,62 @@ namespace CinematicUnityExplorer.NightRunners.Utils { public static class RCCUtils { - public static void ToggleRCC(Camera camera, bool enable) + public static void ToggleCameraController(GameObject container, bool enable) + { + if (IsPlayerCameraScene()) + { + TogglePersonController(container, enable); + } + else + { + ToggleRCC_Camera(container, enable); + } + } + + public static void ToggleGameUI(bool enable) { - ToggleRCC_Camera(camera, enable); ToggleRCC_UI(enable); } - public static RCC_Camera GetRCC_Camera(Camera camera) + public static GameObject GetCameraContainer(Camera camera) { - return camera.GetComponentInParent(Il2CppType.Of()) as RCC_Camera ?? - GameObject.Find("MAIN_CAMERA(Clone)").NullCheck()?.GetComponent(); + var scene = GodConstant.Instance.scene_currentType; + if (scene == GodConstant.Scene_currentType.GARAGE) + { + return GameObject.Find("homeGarage_player(Clone)"); + } + else if (scene == GodConstant.Scene_currentType.MEETSPOT) + { + return GameObject.Find("walkScene_player(Clone)"); + } + else + { + return camera.GetComponentInParent(Il2CppType.Of()).gameObject.NullCheck() ?? GameObject.Find("MAIN_CAMERA(Clone)"); + } } - private static void ToggleRCC_Camera(Camera camera, bool enable) + + private static RCC_Camera GetRCC_Camera(GameObject container) + { + return container.NullCheck()?.GetComponent(); + } + + private static void TogglePersonController(GameObject container, bool enable) + { + var controller = container.GetComponent(); + if (controller) + { + controller.enabled = enable; + } + else + { + Debug.LogWarning("FPEFirstPersonController not found "); + } + } + + private static void ToggleRCC_Camera(GameObject container, bool enable) { - var rcc = GetRCC_Camera(camera); + var rcc = GetRCC_Camera(container); if (rcc) { if (!enable) @@ -50,5 +91,11 @@ private static void ToggleRCC_UI(bool enable) Debug.LogWarning("Rcc ui canvas not found"); } } + + private static bool IsPlayerCameraScene() + { + var scene = GodConstant.Instance.scene_currentType; + return scene == GodConstant.Scene_currentType.GARAGE || scene == GodConstant.Scene_currentType.MEETSPOT; + } } } diff --git a/src/UI/Panels/FreeCamPanel.cs b/src/UI/Panels/FreeCamPanel.cs index cc63d0ea..c38a668d 100644 --- a/src/UI/Panels/FreeCamPanel.cs +++ b/src/UI/Panels/FreeCamPanel.cs @@ -96,6 +96,7 @@ internal static void BeginFreecam() inFreeCamMode = true; connector?.UpdateFreecamStatus(true); + RCCUtils.ToggleGameUI(false); previousMousePosition = IInputManager.MousePosition; CacheMainCamera(); @@ -112,7 +113,7 @@ internal static void BeginFreecam() static void CacheMainCamera() { Camera currentMain = Camera.main; - CameraContainer = RCCUtils.GetRCC_Camera(currentMain).transform; + CameraContainer = RCCUtils.GetCameraContainer(currentMain).transform; if (currentMain) { @@ -145,7 +146,7 @@ static void SetupFreeCamera() usingGameCamera = true; ourCamera = lastMainCamera; MaybeToggleCinemachine(false); - RCCUtils.ToggleRCC(ourCamera, false); + RCCUtils.ToggleCameraController(CameraContainer.gameObject, false); // If the farClipPlaneValue is the default one try to use the one from the gameplay camera if (farClipPlaneValue == 2000){ @@ -198,11 +199,10 @@ internal static void EndFreecam() inFreeCamMode = false; connector?.UpdateFreecamStatus(false); + RCCUtils.ToggleGameUI(true); if (usingGameCamera) { - MaybeToggleCinemachine(true); - RCCUtils.ToggleRCC(ourCamera, true); ourCamera = null; if (lastMainCamera) @@ -212,6 +212,7 @@ internal static void EndFreecam() if (CameraContainer) { + RCCUtils.ToggleCameraController(CameraContainer.gameObject, true); CameraContainer.SetPositionAndRotation(originalCameraPosition, originalCameraRotation); } } From 5031658eedcd3551041fa4125ab53d1e4ab76774 Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Thu, 14 Nov 2024 23:36:30 +0500 Subject: [PATCH 11/21] fix: disable player interactions in garage and meetspot --- src/NightRunners/Utils/RCCUtils.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/NightRunners/Utils/RCCUtils.cs b/src/NightRunners/Utils/RCCUtils.cs index e2295574..179bdfa7 100644 --- a/src/NightRunners/Utils/RCCUtils.cs +++ b/src/NightRunners/Utils/RCCUtils.cs @@ -52,6 +52,11 @@ private static void TogglePersonController(GameObject container, bool enable) if (controller) { controller.enabled = enable; + if (controller.homegarage) + { + controller.homegarage.noInput = !enable; + } + GodConstant.Instance.UI_Data.ui_showWarning = !enable; //prevents user interactions on meetspot } else { From 7695e1f265f5da77e4a984a9e8b25245d6b39a7c Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Thu, 14 Nov 2024 23:37:56 +0500 Subject: [PATCH 12/21] fix: reset camera parent transform in freecam mode in garage and meetspot --- src/NightRunners/Utils/RCCUtils.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/NightRunners/Utils/RCCUtils.cs b/src/NightRunners/Utils/RCCUtils.cs index 179bdfa7..b2cf9e60 100644 --- a/src/NightRunners/Utils/RCCUtils.cs +++ b/src/NightRunners/Utils/RCCUtils.cs @@ -57,6 +57,11 @@ private static void TogglePersonController(GameObject container, bool enable) controller.homegarage.noInput = !enable; } GodConstant.Instance.UI_Data.ui_showWarning = !enable; //prevents user interactions on meetspot + var vCamera = controller.transform.Find("vCamera"); + if (vCamera) + { + vCamera.transform.localPosition = enable ? new Vector3(0, 0.85f, 0) : Vector3.zero; //direct camera GO parent + } } else { From 5eb476cf13507755ba8df6d67ae1e1f72a3f3bb6 Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Thu, 14 Nov 2024 23:54:50 +0500 Subject: [PATCH 13/21] fix: save default lod bias --- src/UI/Panels/MiscPanel.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/UI/Panels/MiscPanel.cs b/src/UI/Panels/MiscPanel.cs index 3e346f3f..70f44bdc 100644 --- a/src/UI/Panels/MiscPanel.cs +++ b/src/UI/Panels/MiscPanel.cs @@ -48,6 +48,7 @@ public Misc(UIBase owner) : base(owner) Toggle HighLodToggle; object qualitySettings = null; PropertyInfo lodBias = null; + float _defaultLodBias = 1; // We save the current properties of the Renderers and Lights to restore them after editing them with togglers internal Dictionary renderersReceiveShadows = new(); @@ -122,9 +123,9 @@ private void ToogleHighLods(bool areHighLodsOn){ if (lodBias == null){ Type qualitySettingsType = qualitySettings is Type type ? type : qualitySettings.GetActualType(); lodBias = qualitySettingsType.GetProperty("lodBias"); + _defaultLodBias = (float)lodBias.GetValue(null); } - - lodBias.SetValue(null, areHighLodsOn ? 10000 : 1, null); + lodBias.SetValue(null, areHighLodsOn ? 10000 : _defaultLodBias, null); } private void ToggleAllMeshesCastAndRecieveShadows(bool enable){ From 47787ee4bd2014b8305bf9f0d3e20569a4fa41db Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Sat, 23 Nov 2024 19:21:44 +0500 Subject: [PATCH 14/21] fix: reset vCamera rotation in garage/meetspot --- src/NightRunners/Utils/RCCUtils.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/NightRunners/Utils/RCCUtils.cs b/src/NightRunners/Utils/RCCUtils.cs index b2cf9e60..ff775cbe 100644 --- a/src/NightRunners/Utils/RCCUtils.cs +++ b/src/NightRunners/Utils/RCCUtils.cs @@ -61,6 +61,7 @@ private static void TogglePersonController(GameObject container, bool enable) if (vCamera) { vCamera.transform.localPosition = enable ? new Vector3(0, 0.85f, 0) : Vector3.zero; //direct camera GO parent + vCamera.transform.localRotation = Quaternion.identity; } } else From d04be3a550451eef8dfe34c18eed51e768621784 Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Sat, 23 Nov 2024 19:22:03 +0500 Subject: [PATCH 15/21] feat: add "Look at" option --- src/UI/Panels/FreeCamPanel.cs | 76 ++++++++++++++++++- .../GameObjects/GameObjectInfoPanel.cs | 5 ++ 2 files changed, 77 insertions(+), 4 deletions(-) diff --git a/src/UI/Panels/FreeCamPanel.cs b/src/UI/Panels/FreeCamPanel.cs index c38a668d..fe878bb1 100644 --- a/src/UI/Panels/FreeCamPanel.cs +++ b/src/UI/Panels/FreeCamPanel.cs @@ -67,8 +67,8 @@ public FreeCamPanel(UIBase owner) : base(owner) static InputFieldRef positionInput; static InputFieldRef moveSpeedInput; static Text followObjectLabel; + static Text lookAtObjectLabel; static ButtonRef inspectButton; - static ButtonRef followPlayerCarButton; public static Toggle followRotationToggle; static bool disabledCinemachine; @@ -87,6 +87,8 @@ public FreeCamPanel(UIBase owner) : base(owner) public static Quaternion followObjectLastRotation = Quaternion.identity; public static Vector3 lastKnownPosition = Vector3.zero; + public static GameObject lookAtObject = null; + private static FreecamCursorUnlocker freecamCursorUnlocker = null; public static UnityIGCSConnector connector = null; @@ -395,11 +397,10 @@ protected override void ConstructPanelContent() UIFactory.SetLayoutElement(releaseFollowButton.GameObject, minWidth: 150, minHeight: 25, flexibleWidth: 9999); releaseFollowButton.OnClick += ReleaseFollowButton_OnClick; - followPlayerCarButton = UIFactory.CreateButton(ContentRoot, "FollowPlayerCarButton", "Follow Car"); + var followPlayerCarButton = UIFactory.CreateButton(ContentRoot, "FollowPlayerCarButton", "Follow Car"); UIFactory.SetLayoutElement(followPlayerCarButton.GameObject, minWidth: 150, minHeight: 25, flexibleWidth: 9999); followPlayerCarButton.OnClick += FollowPlayerCar; - //followPlayerCarButton.GameObject.SetActive(false); - + GameObject followRotationGameObject = UIFactory.CreateToggle(ContentRoot, "followRotationToggle", out followRotationToggle, out Text followRotationText); UIFactory.SetLayoutElement(followRotationGameObject, minHeight: 25, flexibleWidth: 9999); followRotationToggle.isOn = false; @@ -420,6 +421,25 @@ protected override void ConstructPanelContent() AddSpacer(5); + lookAtObjectLabel = UIFactory.CreateLabel(ContentRoot, "CurrentLookAtObject", "Not looking at any object."); + UIFactory.SetLayoutElement(lookAtObjectLabel.gameObject, minWidth: 100, minHeight: 25); + + GameObject lookAtObjectRow = UIFactory.CreateHorizontalGroup(ContentRoot, "LookAtObjectRow", false, false, true, true, 3, default, new(1, 1, 1, 0)); + + ButtonRef lookAtButton = UIFactory.CreateButton(lookAtObjectRow, "LookAtButton", "Look at GameObject"); + UIFactory.SetLayoutElement(lookAtButton.GameObject, minWidth: 150, minHeight: 25, flexibleWidth: 9999); + lookAtButton.OnClick += LookAtButton_OnClick; + + ButtonRef releaseLookAtButton = UIFactory.CreateButton(lookAtObjectRow, "ReleaseLookAtButton", "Release Look at GameObject"); + UIFactory.SetLayoutElement(releaseLookAtButton.GameObject, minWidth: 150, minHeight: 25, flexibleWidth: 9999); + releaseLookAtButton.OnClick += ReleaseLookAtButton_OnClick; + + var lookAtPlayerCarButton = UIFactory.CreateButton(ContentRoot, "LookAtPlayerCarButton", "Look at Car"); + UIFactory.SetLayoutElement(lookAtPlayerCarButton.GameObject, minWidth: 150, minHeight: 25, flexibleWidth: 9999); + lookAtPlayerCarButton.OnClick += LookAtPlayerCar; + + AddSpacer(5); + string instructions = "Controls:\n" + $"- {ConfigManager.Forwards_1.Value},{ConfigManager.Backwards_1.Value},{ConfigManager.Left_1.Value},{ConfigManager.Right_1.Value} / {ConfigManager.Forwards_2.Value},{ConfigManager.Backwards_2.Value},{ConfigManager.Left_2.Value},{ConfigManager.Right_2.Value}: Movement\n" + $"- {ConfigManager.Up.Value}: Move up\n" + @@ -546,6 +566,49 @@ void ReleaseFollowButton_OnClick() CamPathsPanel.UpdatedFollowObject(null); } + public static void LookAtObjectAction(GameObject obj) + { + lookAtObject = obj; + lookAtObjectLabel.text = $"Looking at: {obj.name}"; + } + + void LookAtButton_OnClick() + { + MouseInspector.Instance.StartInspect(MouseInspectMode.World, LookAtObjectAction); + followRotationToggle.interactable = false; + followRotationToggle.isOn = false; + } + + void LookAtPlayerCar() + { + try + { + var go = GodConstant.Instance.playerCar.gameObject; + if (go) + { + LookAtObjectAction(go); + } + else + { + Debug.LogWarning("failed to find player car"); + } + } + catch (Exception e) + { + Debug.LogError(e.Message); + } + } + + void ReleaseLookAtButton_OnClick() + { + followRotationToggle.interactable = true; + if (lookAtObject) + { + lookAtObject = null; + lookAtObjectLabel.text = "Not looking at any object"; + } + } + static void SetToggleButtonState() { if (inFreeCamMode) @@ -753,6 +816,11 @@ internal void Update() FreeCamPanel.followObjectLastRotation = FreeCamPanel.followObject.transform.rotation; } + if (FreeCamPanel.lookAtObject != null && !FreeCamPanel.cameraPathMover.playingPath) + { + transform.LookAt(FreeCamPanel.lookAtObject.transform); + } + FreeCamPanel.connector?.ExecuteCameraCommand(transform); FreeCamPanel.UpdatePositionInput(); diff --git a/src/UI/Widgets/GameObjects/GameObjectInfoPanel.cs b/src/UI/Widgets/GameObjects/GameObjectInfoPanel.cs index c5dd89af..f8cf22bb 100644 --- a/src/UI/Widgets/GameObjects/GameObjectInfoPanel.cs +++ b/src/UI/Widgets/GameObjects/GameObjectInfoPanel.cs @@ -295,6 +295,11 @@ public void Create() UIFactory.SetLayoutElement(FollowObjectButton.Component.gameObject, minHeight: 25, minWidth: 100); FollowObjectButton.OnClick += () => FreeCamPanel.FollowObjectAction(this.Target.gameObject); + var lookAtObjectButton = UIFactory.CreateButton(firstRow, "LookAtObjectButton", "Look at object with Freecam", new Color(0.2f, 0.2f, 0.2f)); + lookAtObjectButton.ButtonText.fontSize = 13; + UIFactory.SetLayoutElement(lookAtObjectButton.Component.gameObject, minHeight: 25, minWidth: 100); + lookAtObjectButton.OnClick += () => FreeCamPanel.LookAtObjectAction(this.Target.gameObject); + this.PathInput = UIFactory.CreateInputField(firstRow, "PathInput", "..."); PathInput.Component.textComponent.color = Color.grey; PathInput.Component.textComponent.fontSize = 14; From 71ea2db32ba1f2c0c5073bd9fb0579e4f484d580 Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Sun, 24 Nov 2024 12:39:55 +0500 Subject: [PATCH 16/21] feat: block ReWired input in free cam mode --- src/NightRunners/Utils/RCCUtils.cs | 20 ++++++++++++++++++-- src/UI/Panels/FreeCamPanel.cs | 12 ++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/NightRunners/Utils/RCCUtils.cs b/src/NightRunners/Utils/RCCUtils.cs index ff775cbe..9e42f806 100644 --- a/src/NightRunners/Utils/RCCUtils.cs +++ b/src/NightRunners/Utils/RCCUtils.cs @@ -1,6 +1,6 @@ using CinematicUnityExplorer.NightRunners.Extensions; using Il2CppInterop.Runtime; -using UnityEngine; +using Rewired; namespace CinematicUnityExplorer.NightRunners.Utils { @@ -40,6 +40,22 @@ public static GameObject GetCameraContainer(Camera camera) } } + public static void SetDefaultInputEnabled(bool enable) + { + try + { + ReInput.controllers.Keyboard.enabled = enable; + var joysticks = ReInput.controllers.GetJoysticks(); + foreach (var joystick in joysticks) + { + joystick.enabled = enable; + } + } + catch (Exception e) + { + Debug.LogError($"{e.Message}\n{e.StackTrace}"); + } + } private static RCC_Camera GetRCC_Camera(GameObject container) { @@ -49,6 +65,7 @@ private static RCC_Camera GetRCC_Camera(GameObject container) private static void TogglePersonController(GameObject container, bool enable) { var controller = container.GetComponent(); + GodConstant.Instance.UI_Data.ui_showWarning = !enable; //prevents user interactions on meetspot if (controller) { controller.enabled = enable; @@ -56,7 +73,6 @@ private static void TogglePersonController(GameObject container, bool enable) { controller.homegarage.noInput = !enable; } - GodConstant.Instance.UI_Data.ui_showWarning = !enable; //prevents user interactions on meetspot var vCamera = controller.transform.Find("vCamera"); if (vCamera) { diff --git a/src/UI/Panels/FreeCamPanel.cs b/src/UI/Panels/FreeCamPanel.cs index fe878bb1..60e90e57 100644 --- a/src/UI/Panels/FreeCamPanel.cs +++ b/src/UI/Panels/FreeCamPanel.cs @@ -99,6 +99,10 @@ internal static void BeginFreecam() connector?.UpdateFreecamStatus(true); RCCUtils.ToggleGameUI(false); + if (blockGamesInputOnFreecamToggle.isOn) + { + RCCUtils.SetDefaultInputEnabled(false); + } previousMousePosition = IInputManager.MousePosition; CacheMainCamera(); @@ -202,6 +206,8 @@ internal static void EndFreecam() connector?.UpdateFreecamStatus(false); RCCUtils.ToggleGameUI(true); + RCCUtils.SetDefaultInputEnabled(true); + if (usingGameCamera) { MaybeToggleCinemachine(true); @@ -340,6 +346,12 @@ protected override void ConstructPanelContent() UIFactory.SetLayoutElement(blockGamesInputOnFreecam, minHeight: 25, flexibleWidth: 9999); blockGamesInputOnFreecamToggle.isOn = true; blockGamesInputOnFreecamText.text = "Block games input on Freecam"; + blockGamesInputOnFreecamToggle.onValueChanged.AddListener(blockInput => { + if (inFreeCamMode) + { + RCCUtils.SetDefaultInputEnabled(!blockInput); + } + }); } AddSpacer(5); From 304c5a38c037ce53413713813ac1de3c9d08f0d7 Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Sun, 24 Nov 2024 17:03:30 +0500 Subject: [PATCH 17/21] feat: add experimantal record feature --- src/NightRunners/Utils/RecordUtils.cs | 38 +++++++++++++++++++ src/UI/Panels/RecordPanel.cs | 53 +++++++++++++++++++++++++++ src/UI/UIManager.cs | 5 ++- 3 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 src/NightRunners/Utils/RecordUtils.cs create mode 100644 src/UI/Panels/RecordPanel.cs diff --git a/src/NightRunners/Utils/RecordUtils.cs b/src/NightRunners/Utils/RecordUtils.cs new file mode 100644 index 00000000..fd75dadd --- /dev/null +++ b/src/NightRunners/Utils/RecordUtils.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CinematicUnityExplorer.NightRunners.Utils +{ + public static class RecordUtils + { + public static RCC_Recorder.Mode GetMode() + { + return RCC_SceneManager.instance.recorder.mode; + } + + public static void StartRecord() + { + RCC.StartStopRecord(); + } + + public static void StopRecord() + { + RCC.StartStopRecord(); + } + + public static void StartReplay() + { + RCC_SceneManager.instance.recorder.carController.externalControllerAI = new RCC_AICarController(); + RCC.StartStopReplay(); + } + + public static void StopReplay() + { + RCC_SceneManager.instance.recorder.carController.externalControllerAI = null; + RCC.StartStopReplay(); + } + } +} diff --git a/src/UI/Panels/RecordPanel.cs b/src/UI/Panels/RecordPanel.cs new file mode 100644 index 00000000..3e862a7b --- /dev/null +++ b/src/UI/Panels/RecordPanel.cs @@ -0,0 +1,53 @@ +using CinematicUnityExplorer.NightRunners.Utils; +using UnityExplorer.UI; +using UnityExplorer.UI.Panels; +using UniverseLib.UI; + +namespace CinematicUnityExplorer.UI.Panels +{ + public class RecordPanel : UEPanel + { + public override UIManager.Panels PanelType => UIManager.Panels.Record; + public override string Name => "Record"; + public override int MinWidth => 325; + public override int MinHeight => 200; + public override Vector2 DefaultAnchorMin => new(0.4f, 0.4f); + public override Vector2 DefaultAnchorMax => new(0.6f, 0.6f); + + public RecordPanel(UIBase owner) : base(owner) + { + } + + protected override void ConstructPanelContent() + { + UIFactory.SetLayoutElement( + UIFactory.CreateLabel(ContentRoot, "Warning", "Experimental, only player's car will be recorded", TextAnchor.MiddleCenter).gameObject, + minWidth: 150, minHeight: 25, flexibleWidth: 9999 + ); + + var recordButton = UIFactory.CreateButton(ContentRoot, "ToggleRecordButton", "Record"); + UIFactory.SetLayoutElement(recordButton.GameObject, minWidth: 150, minHeight: 25, flexibleWidth: 9999); + recordButton.OnClick += () => + { + RecordUtils.StartRecord(); + var mode = RecordUtils.GetMode(); + recordButton.ButtonText.text = $"{(mode == RCC_Recorder.Mode.Neutral ? "Start" : "Stop")} Record"; + }; + + var replayButton = UIFactory.CreateButton(ContentRoot, "ToggleReplayButton", "Replay"); + UIFactory.SetLayoutElement(replayButton.GameObject, minWidth: 150, minHeight: 25, flexibleWidth: 9999); + replayButton.OnClick += () => + { + var mode = RecordUtils.GetMode(); + if (mode == RCC_Recorder.Mode.Play) + { + RecordUtils.StopReplay(); + } + else + { + RecordUtils.StartReplay(); + } + }; + } + } +} diff --git a/src/UI/UIManager.cs b/src/UI/UIManager.cs index cc0ddf6f..137821f9 100644 --- a/src/UI/UIManager.cs +++ b/src/UI/UIManager.cs @@ -1,4 +1,5 @@ -using UnityExplorer.Config; +using CinematicUnityExplorer.UI.Panels; +using UnityExplorer.Config; using UnityExplorer.CSConsole; using UnityExplorer.Inspectors; using UnityExplorer.UI.Panels; @@ -28,6 +29,7 @@ public enum Panels PostProcessingPanel, AnimatorPanel, Misc, + Record } public enum VerticalAnchor @@ -102,6 +104,7 @@ internal static void InitUI() UIPanels.Add(Panels.PostProcessingPanel, new PostProcessingPanel(UiBase)); UIPanels.Add(Panels.AnimatorPanel, new AnimatorPanel(UiBase)); UIPanels.Add(Panels.Misc, new UnityExplorer.UI.Panels.Misc(UiBase)); + UIPanels.Add(Panels.Record, new RecordPanel(UiBase)); UIPanels.Add(Panels.Options, new OptionsPanel(UiBase)); UIPanels.Add(Panels.UIInspectorResults, new MouseInspectorResultsPanel(UiBase)); From a474492702aadeca50221568489a98b45a389ddf Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Sun, 24 Nov 2024 17:07:27 +0500 Subject: [PATCH 18/21] Bump version 1.2.0.1 --- src/ExplorerCore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ExplorerCore.cs b/src/ExplorerCore.cs index 140f086b..1dac77c7 100644 --- a/src/ExplorerCore.cs +++ b/src/ExplorerCore.cs @@ -20,7 +20,7 @@ namespace UnityExplorer public static class ExplorerCore { public const string NAME = "CinematicUnityExplorer"; - public const string VERSION = "1.2.0"; + public const string VERSION = "1.2.0.1"; public const string AUTHOR = "originalnicodr, Sinai, yukieiji"; public const string GUID = "com.originalnicodr.cinematicunityexplorer"; From 13199b278ad80add3d4c3913565e9bec0ca6a1d5 Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Sun, 24 Nov 2024 17:23:27 +0500 Subject: [PATCH 19/21] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3fed1e4b..b14c7369 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Cinematic Unity Explorer +# Cinematic Unity Explorer Adapted for Night-Runners -

-Adapted for Night-Runners. -

+

+Discord modding community server: click +

From 460f85fa554fda069c0c16fb6375e1ba66141c96 Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Sun, 24 Nov 2024 17:38:53 +0500 Subject: [PATCH 20/21] Update README.md --- README.md | 50 ++++++++++++++------------------------------------ 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index b14c7369..c97a7045 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ # Cinematic Unity Explorer Adapted for Night-Runners

-Discord modding community server: click +Night-Runners Discord modding community server: click

- +

- Fork of the excellent CinematicUnityExplorer mod made by originalnicodr focused on providing support for Night-Runners game. + 🚗 Fork of the excellent CinematicUnityExplorer mod made by originalnicodr focused on providing support for Night-Runners game.

🎥 CinematicUnityExplorer is a fork of the excellent UnityExplorer mod made by sinai-dev focused on providing tools for creating marketing material for Unity games. @@ -17,9 +17,6 @@ Discord modding community server: To see the forks features we have worked on so far check out the Features section.

-

- ✔️ Supports most Unity versions from 5.2 to 2021+ (IL2CPP and Mono). -

✨ Powered by UniverseLib

@@ -28,8 +25,6 @@ Discord modding community server: @@ -41,13 +36,13 @@ Nightly build: https://nightly.link/Scoolnik/NR-CinematicUnityExplorer/workflows Nightly builds can be found [here](https://github.com/Scoolnik/NR-CinematicUnityExplorer/actions). +Main BepinEx Nightly build: [click](https://nightly.link/Scoolnik/NR-CinematicUnityExplorer/workflows/dotnet_nightly/development/CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR.zip) + ## BepInEx -| Release | IL2CPP(CoreCLR) | IL2CPP(Unhollower) | Mono | -| ------- | ------ | ------ | ---- | -| BIE 6.X be.647+ | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR.zip) | ✖️ n/a | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx6.Unity.Mono.zip) | -| BIE 6.X be.472 to be.577 | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx.IL2CPP.CoreCLR.zip) | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx.IL2CPP.zip) | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx6.Mono.zip) | -| BIE 5.X | ✖️ n/a | ✖️ n/a | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx5.Mono.zip) | +| Release | IL2CPP(CoreCLR) | +| ------- | ------ | +| BIE 6.X be.647+ | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR.zip) | 1. Unzip the release file into a folder 2. Take the `plugins/CinematicUnityExplorer` folder and place it in `BepInEx/plugins/` @@ -56,35 +51,18 @@ Nightly builds can be found [here](https://github.com/Scoolnik/NR-CinematicUnity ## MelonLoader -| Release | IL2CPP | Mono | -| ------- | ------ | ---- | -| ML 0.6.x | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.MelonLoader.IL2CPP.CoreCLR.zip) | ✖️ | -| ML 0.6(only alpha build) | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.MelonLoader.IL2CPP.net6preview.zip) | ✖️ | -| ML 0.5 | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.MelonLoader.IL2CPP.zip) | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.MelonLoader.Mono.zip) | +| Release | IL2CPP | +| ------- | ------ | +| ML 0.6.x | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.MelonLoader.IL2CPP.CoreCLR.zip) | +| ML 0.5 | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.MelonLoader.IL2CPP.zip) | 1. Unzip the release file into a folder 2. Copy the DLL inside the `Mods` folder into your MelonLoader `Mods` folder 3. Copy all of the DLLs inside the `UserLibs` folder into your MelonLoader `UserLibs` folder -## Standalone - -| IL2CPP | Mono | -| ------ | ---- | -| ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.Standalone.IL2CPP.zip) | ✅ [link](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.Standalone.Mono.zip) | - -The standalone release can be used with any injector or loader of your choice, but it requires you to load the dependencies manually. - -1. Ensure the required libs are loaded - UniverseLib, HarmonyX and MonoMod. Take them from the [`CinematicUnityExplorer.Editor`](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.Editor.zip) release if you need them. -2. For IL2CPP, load Il2CppAssemblyUnhollower and start an [Il2CppAssemblyUnhollower runtime](https://github.com/knah/Il2CppAssemblyUnhollower#required-external-setup) -2. Load the CinematicUnityExplorer DLL -3. Create an instance of Unity Explorer with `UnityExplorer.ExplorerStandalone.CreateInstance();` -4. Optionally subscribe to the `ExplorerStandalone.OnLog` event to handle logging if you wish - -## Unity Editor +## Standalone and Unity Editor -1. Download the [`CinematicUnityExplorer.Editor`](https://github.com/Scoolnik/NR-CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.Editor.zip) release. -2. Install the package, either by using the Package Manager and importing the `package.json` file, or by manually dragging the folder into your `Assets` folder. -3. Drag the `Runtime/CinematicUnityExplorer` prefab into your scene, or create a GameObject and add the `Explorer Editor Behaviour` script to it. +✖️ n/a, use original [CinematicUnityExplorer](https://github.com/originalnicodr/CinematicUnityExplorer) # Common issues and solutions From 5d6d431bcf6b5e156d81c4aa613e095d163b43ff Mon Sep 17 00:00:00 2001 From: Scoolnik <62171058+Scoolnik@users.noreply.github.com> Date: Sun, 24 Nov 2024 17:50:36 +0500 Subject: [PATCH 21/21] build: update master branch ci [-noci] --- .github/workflows/dotnet.yml | 93 ++++----------- build.ps1 | 211 +++-------------------------------- 2 files changed, 38 insertions(+), 266 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index ccc273e2..056d1f7f 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -16,96 +16,43 @@ jobs: # Setup - name: Checkout latest - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true + + - name: Checkout private tools + uses: actions/checkout@v4 + with: + repository: ${{ secrets.NR_INTEROP_REPO }} + token: ${{ secrets.NR_INTEROP_TOKEN }} + path: NR_INTEROP + - name: Setup dotnet - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: - dotnet-version: '6.x' + dotnet-version: "6.x" # Run build script - name: Build UE run: ./build.ps1 # Upload artifacts - - name: Upload BepInEx.IL2CPP - uses: actions/upload-artifact@v3 - with: - name: CinematicUnityExplorer.BepInEx.IL2CPP.zip - path: ./Release/CinematicUnityExplorer.BepInEx.IL2CPP/ - - - name: Upload BepInEx.IL2CPP.CoreCLR - uses: actions/upload-artifact@v3 - with: - name: CinematicUnityExplorer.BepInEx.IL2CPP.CoreCLR.zip - path: ./Release/CinematicUnityExplorer.BepInEx.IL2CPP.CoreCLR/ - - name: Upload BepInEx.Unity.IL2CPP.CoreCLR - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR.zip - path: ./Release/CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR/ - - - name: Upload BepInEx5.Mono - uses: actions/upload-artifact@v3 - with: - name: CinematicUnityExplorer.BepInEx5.Mono.zip - path: ./Release/CinematicUnityExplorer.BepInEx5.Mono/ - - - name: Upload BepInEx6.Mono - uses: actions/upload-artifact@v3 - with: - name: CinematicUnityExplorer.BepInEx6.Mono.zip - path: ./Release/CinematicUnityExplorer.BepInEx6.Mono/ - - - name: Upload BepInEx6.Unity.Mono - uses: actions/upload-artifact@v3 - with: - name: CinematicUnityExplorer.BepInEx6.Unity.Mono.zip - path: ./Release/CinematicUnityExplorer.BepInEx6.Unity.Mono/ + path: ./Release/CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR/output - name: Upload MelonLoader.IL2CPP - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: CinematicUnityExplorer.MelonLoader.IL2CPP.zip - path: ./Release/CinematicUnityExplorer.MelonLoader.IL2CPP/ - - - name: Upload MelonLoader.IL2CPP.net6preview - uses: actions/upload-artifact@v3 - with: - name: CinematicUnityExplorer.MelonLoader.IL2CPP.net6preview.zip - path: ./Release/CinematicUnityExplorer.MelonLoader.IL2CPP.net6preview/ + path: ./Release/CinematicUnityExplorer.MelonLoader.IL2CPP/output - name: Upload MelonLoader.IL2CPP.CoreCLR - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: CinematicUnityExplorer.MelonLoader.IL2CPP.CoreCLR.zip - path: ./Release/CinematicUnityExplorer.MelonLoader.IL2CPP.CoreCLR/ - - - name: Upload MelonLoader.Mono - uses: actions/upload-artifact@v3 - with: - name: CinematicUnityExplorer.MelonLoader.Mono.zip - path: ./Release/CinematicUnityExplorer.MelonLoader.Mono/ - - - name: Upload Standalone.IL2CPP - uses: actions/upload-artifact@v3 - with: - name: CinematicUnityExplorer.Standalone.IL2CPP.zip - path: ./Release/CinematicUnityExplorer.Standalone.IL2CPP/ - - - name: Upload Standalone.Mono - uses: actions/upload-artifact@v3 - with: - name: CinematicUnityExplorer.Standalone.Mono.zip - path: ./Release/CinematicUnityExplorer.Standalone.Mono/ - - - name: Upload Editor - uses: actions/upload-artifact@v3 - with: - name: CinematicUnityExplorer.Editor.zip - path: ./UnityEditorPackage/ - + path: ./Release/CinematicUnityExplorer.MelonLoader.IL2CPP.CoreCLR/output build_connector: runs-on: windows-latest @@ -113,7 +60,7 @@ jobs: steps: - name: Checkout latest - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true @@ -127,13 +74,13 @@ jobs: run: ./build_connector.ps1 - name: Upload Unity IGCS Connector - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: UnityIGCSConnector.dll path: ./Release/UnityIGCSConnector.dll - name: Upload Unity IGCS Connector 32bit - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: UnityIGCSConnector.32.dll path: ./Release/UnityIGCSConnector.32.dll diff --git a/build.ps1 b/build.ps1 index e151b63c..9afcc888 100644 --- a/build.ps1 +++ b/build.ps1 @@ -2,216 +2,41 @@ cd UniverseLib .\build.ps1 cd .. -# ----------- MelonLoader IL2CPP (net6) ----------- -dotnet build src/CinematicUnityExplorer.sln -c Release_ML_Cpp_net6preview -$Path = "Release\CinematicUnityExplorer.MelonLoader.IL2CPP.net6preview" -# ILRepack -lib/ILRepack.exe /target:library /lib:lib/net6 /lib:lib/unhollowed /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.ML.IL2CPP.net6preview.dll $Path/CinematicUnityExplorer.ML.IL2CPP.net6preview.dll $Path/mcs.dll -# (cleanup and move files) -Remove-Item $Path/CinematicUnityExplorer.ML.IL2CPP.net6preview.deps.json -Remove-Item $Path/Tomlet.dll -Remove-Item $Path/mcs.dll -Remove-Item $Path/Iced.dll -Remove-Item $Path/UnhollowerBaseLib.dll -New-Item -Path "$Path" -Name "Mods" -ItemType "directory" -Force -Move-Item -Path $Path/CinematicUnityExplorer.ML.IL2CPP.net6preview.dll -Destination $Path/Mods -Force -New-Item -Path "$Path" -Name "UserLibs" -ItemType "directory" -Force -Move-Item -Path $Path/UniverseLib.IL2CPP.Unhollower.dll -Destination $Path/UserLibs -Force -# (create zip archive) -Remove-Item $Path/../CinematicUnityExplorer.MelonLoader.IL2CPP.net6preview.zip -ErrorAction SilentlyContinue -compress-archive .\$Path\* $Path/../CinematicUnityExplorer.MelonLoader.IL2CPP.net6preview.zip - # ----------- MelonLoader IL2CPP CoreCLR (net6) ----------- -dotnet build src/CinematicUnityExplorer.sln -c Release_ML_Cpp_CoreCLR +dotnet build src/CinematicUnityExplorer.sln -c Release_ML_Cpp_CoreCLR -p:IS_CI=true $Path = "Release\CinematicUnityExplorer.MelonLoader.IL2CPP.CoreCLR" + +New-Item -ItemType Directory -Path "$Path/output/Mods" -Force +New-Item -ItemType Directory -Path "$Path/output/UserLibs" -Force + # ILRepack -lib/ILRepack.exe /target:library /lib:lib/net6 /lib:lib/interop /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.ML.IL2CPP.CoreCLR.dll $Path/CinematicUnityExplorer.ML.IL2CPP.CoreCLR.dll $Path/mcs.dll -# (cleanup and move files) -Remove-Item $Path/CinematicUnityExplorer.ML.IL2CPP.CoreCLR.deps.json -Remove-Item $Path/Tomlet.dll -Remove-Item $Path/mcs.dll -Remove-Item $Path/Iced.dll -Remove-Item $Path/Il2CppInterop.Common.dll -Remove-Item $Path/Il2CppInterop.Runtime.dll -Remove-Item $Path/Microsoft.Extensions.Logging.Abstractions.dll -New-Item -Path "$Path" -Name "Mods" -ItemType "directory" -Force -Move-Item -Path $Path/CinematicUnityExplorer.ML.IL2CPP.CoreCLR.dll -Destination $Path/Mods -Force -New-Item -Path "$Path" -Name "UserLibs" -ItemType "directory" -Force -Move-Item -Path $Path/UniverseLib.ML.IL2CPP.Interop.dll -Destination $Path/UserLibs -Force -# (create zip archive) -Remove-Item $Path/../CinematicUnityExplorer.MelonLoader.IL2CPP.CoreCLR.zip -ErrorAction SilentlyContinue -compress-archive .\$Path\* $Path/../CinematicUnityExplorer.MelonLoader.IL2CPP.CoreCLR.zip +lib/ILRepack.exe /target:library /lib:lib/net6 /lib:lib/interop /lib:$Path /internalize /out:$Path/output/Mods/CinematicUnityExplorer.ML.IL2CPP.CoreCLR.dll $Path/CinematicUnityExplorer.ML.IL2CPP.CoreCLR.dll $Path/mcs.dll + +Move-Item -Path $Path/UniverseLib.ML.IL2CPP.Interop.dll -Destination $Path/output/UserLibs -Force # ----------- MelonLoader IL2CPP (net472) ----------- -dotnet build src/CinematicUnityExplorer.sln -c Release_ML_Cpp_net472 +dotnet build src/CinematicUnityExplorer.sln -c Release_ML_Cpp_net472 -p:IS_CI=true $Path = "Release/CinematicUnityExplorer.MelonLoader.IL2CPP" -# ILRepack -lib/ILRepack.exe /target:library /lib:lib/net472 /lib:lib/net35 /lib:lib/unhollowed /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.ML.IL2CPP.dll $Path/CinematicUnityExplorer.ML.IL2CPP.dll $Path/mcs.dll -# (cleanup and move files) -Remove-Item $Path/Tomlet.dll -Remove-Item $Path/mcs.dll -Remove-Item $Path/Iced.dll -Remove-Item $Path/UnhollowerBaseLib.dll -New-Item -Path "$Path" -Name "Mods" -ItemType "directory" -Force -Move-Item -Path $Path/CinematicUnityExplorer.ML.IL2CPP.dll -Destination $Path/Mods -Force -New-Item -Path "$Path" -Name "UserLibs" -ItemType "directory" -Force -Move-Item -Path $Path/UniverseLib.IL2CPP.Unhollower.dll -Destination $Path/UserLibs -Force -# (create zip archive) -Remove-Item $Path/../CinematicUnityExplorer.MelonLoader.IL2CPP.zip -ErrorAction SilentlyContinue -compress-archive .\$Path\* $Path/../CinematicUnityExplorer.MelonLoader.IL2CPP.zip -# ----------- MelonLoader Mono ----------- -dotnet build src/CinematicUnityExplorer.sln -c Release_ML_Mono -$Path = "Release/CinematicUnityExplorer.MelonLoader.Mono" -# ILRepack -lib/ILRepack.exe /target:library /lib:lib/net35 /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.ML.Mono.dll $Path/CinematicUnityExplorer.ML.Mono.dll $Path/mcs.dll -# (cleanup and move files) -Remove-Item $Path/Tomlet.dll -Remove-Item $Path/mcs.dll -New-Item -Path "$Path" -Name "Mods" -ItemType "directory" -Force -Move-Item -Path $Path/CinematicUnityExplorer.ML.Mono.dll -Destination $Path/Mods -Force -New-Item -Path "$Path" -Name "UserLibs" -ItemType "directory" -Force -Move-Item -Path $Path/UniverseLib.Mono.dll -Destination $Path/UserLibs -Force -# (create zip archive) -Remove-Item $Path/../CinematicUnityExplorer.MelonLoader.Mono.zip -ErrorAction SilentlyContinue -compress-archive .\$Path\* $Path/../CinematicUnityExplorer.MelonLoader.Mono.zip +New-Item -ItemType Directory -Path "$Path/output/Mods" -Force +New-Item -ItemType Directory -Path "$Path/output/UserLibs" -Force -# ----------- BepInEx IL2CPP ----------- -dotnet build src/CinematicUnityExplorer.sln -c Release_BIE_Cpp -$Path = "Release/CinematicUnityExplorer.BepInEx.IL2CPP" # ILRepack -lib/ILRepack.exe /target:library /lib:lib/net472/BepInEx/build423~577 /lib:lib/unhollowed /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.BIE.IL2CPP.dll $Path/CinematicUnityExplorer.BIE.IL2CPP.dll $Path/mcs.dll $Path/Tomlet.dll -# (cleanup and move files) -Remove-Item $Path/Tomlet.dll -Remove-Item $Path/mcs.dll -Remove-Item $Path/Iced.dll -Remove-Item $Path/UnhollowerBaseLib.dll -New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force -New-Item -Path "$Path" -Name "plugins/CinematicUnityExplorer" -ItemType "directory" -Force -Move-Item -Path $Path/CinematicUnityExplorer.BIE.IL2CPP.dll -Destination $Path/plugins/CinematicUnityExplorer -Force -Move-Item -Path $Path/UniverseLib.IL2CPP.Unhollower.dll -Destination $Path/plugins/CinematicUnityExplorer -Force -# (create zip archive) -Remove-Item $Path/../CinematicUnityExplorer.BepInEx.IL2CPP.zip -ErrorAction SilentlyContinue -compress-archive .\$Path\* $Path/../CinematicUnityExplorer.BepInEx.IL2CPP.zip +lib/ILRepack.exe /target:library /lib:lib/net472 /lib:lib/net35 /lib:lib/unhollowed /lib:$Path /internalize /out:$Path/output/Mods/CinematicUnityExplorer.ML.IL2CPP.dll $Path/CinematicUnityExplorer.ML.IL2CPP.dll $Path/mcs.dll -# ----------- BepInEx IL2CPP CoreCLR ----------- -dotnet build src/CinematicUnityExplorer.sln -c Release_BIE_CoreCLR -$Path = "Release/CinematicUnityExplorer.BepInEx.IL2CPP.CoreCLR" -# ILRepack -lib/ILRepack.exe /target:library /lib:lib/net472/BepInEx/build423~577 /lib:lib/net6/ /lib:lib/interop/ /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.BIE.IL2CPP.CoreCLR.dll $Path/CinematicUnityExplorer.BIE.IL2CPP.CoreCLR.dll $Path/mcs.dll $Path/Tomlet.dll # (cleanup and move files) -Remove-Item $Path/Tomlet.dll -Remove-Item $Path/mcs.dll -Remove-Item $Path/Iced.dll -Remove-Item $Path/Il2CppInterop.Common.dll -Remove-Item $Path/Il2CppInterop.Runtime.dll -Remove-Item $Path/Microsoft.Extensions.Logging.Abstractions.dll -Remove-Item $Path/CinematicUnityExplorer.BIE.IL2CPP.CoreCLR.deps.json -New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force -New-Item -Path "$Path" -Name "plugins/CinematicUnityExplorer" -ItemType "directory" -Force -Move-Item -Path $Path/CinematicUnityExplorer.BIE.IL2CPP.CoreCLR.dll -Destination $Path/plugins/CinematicUnityExplorer -Force -Move-Item -Path $Path/UniverseLib.BIE.IL2CPP.Interop.dll -Destination $Path/plugins/CinematicUnityExplorer -Force -# (create zip archive) -Remove-Item $Path/../CinematicUnityExplorer.BepInEx.IL2CPP.CoreCLR.zip -ErrorAction SilentlyContinue -compress-archive .\$Path\* $Path/../CinematicUnityExplorer.BepInEx.IL2CPP.CoreCLR.zip +Move-Item -Path $Path/UniverseLib.IL2CPP.Unhollower.dll -Destination $Path/output/UserLibs -Force # ----------- BepInEx Unity IL2CPP CoreCLR ----------- -dotnet build src/CinematicUnityExplorer.sln -c Release_BIE_Unity_Cpp +dotnet build src/CinematicUnityExplorer.sln -c Release_BIE_Unity_Cpp -p:IS_CI=true $Path = "Release/CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR" -# ILRepack -lib/ILRepack.exe /target:library /lib:lib/net472/BepInEx/build647+ /lib:lib/net6/ /lib:lib/interop/ /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.BIE.Unity.IL2CPP.CoreCLR.dll $Path/CinematicUnityExplorer.BIE.Unity.IL2CPP.CoreCLR.dll $Path/mcs.dll $Path/Tomlet.dll -# (cleanup and move files) -Remove-Item $Path/Tomlet.dll -Remove-Item $Path/mcs.dll -Remove-Item $Path/Iced.dll -Remove-Item $Path/Il2CppInterop.Common.dll -Remove-Item $Path/Il2CppInterop.Runtime.dll -Remove-Item $Path/Microsoft.Extensions.Logging.Abstractions.dll -Remove-Item $Path/CinematicUnityExplorer.BIE.Unity.IL2CPP.CoreCLR.deps.json -New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force -New-Item -Path "$Path" -Name "plugins/CinematicUnityExplorer" -ItemType "directory" -Force -Move-Item -Path $Path/CinematicUnityExplorer.BIE.Unity.IL2CPP.CoreCLR.dll -Destination $Path/plugins/CinematicUnityExplorer -Force -Move-Item -Path $Path/UniverseLib.BIE.IL2CPP.Interop.dll -Destination $Path/plugins/CinematicUnityExplorer -Force -# (create zip archive) -Remove-Item $Path/../CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR.zip -ErrorAction SilentlyContinue -compress-archive .\$Path\* $Path/../CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR.zip - -# ----------- BepInEx 5 Mono ----------- -dotnet build src/CinematicUnityExplorer.sln -c Release_BIE5_Mono -$Path = "Release/CinematicUnityExplorer.BepInEx5.Mono" -# ILRepack -lib/ILRepack.exe /target:library /lib:lib/net35 /lib:lib/net35/BepInEx /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.BIE5.Mono.dll $Path/CinematicUnityExplorer.BIE5.Mono.dll $Path/mcs.dll $Path/Tomlet.dll -# (cleanup and move files) -Remove-Item $Path/Tomlet.dll -Remove-Item $Path/mcs.dll -New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force -New-Item -Path "$Path" -Name "plugins/CinematicUnityExplorer" -ItemType "directory" -Force -Move-Item -Path $Path/CinematicUnityExplorer.BIE5.Mono.dll -Destination $Path/plugins/CinematicUnityExplorer -Force -Move-Item -Path $Path/UniverseLib.Mono.dll -Destination $Path/plugins/CinematicUnityExplorer -Force -# (create zip archive) -Remove-Item $Path/../CinematicUnityExplorer.BepInEx5.Mono.zip -ErrorAction SilentlyContinue -compress-archive .\$Path\* $Path/../CinematicUnityExplorer.BepInEx5.Mono.zip - -# ----------- BepInEx 6 Mono ----------- -dotnet build src/CinematicUnityExplorer.sln -c Release_BIE6_Mono -$Path = "Release/CinematicUnityExplorer.BepInEx6.Mono" -# ILRepack -lib/ILRepack.exe /target:library /lib:lib/net35 /lib:lib/net35/BepInEx/build423~577 /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.BIE6.Mono.dll $Path/CinematicUnityExplorer.BIE6.Mono.dll $Path/mcs.dll $Path/Tomlet.dll -# (cleanup and move files) -Remove-Item $Path/Tomlet.dll -Remove-Item $Path/mcs.dll -New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force -New-Item -Path "$Path" -Name "plugins/CinematicUnityExplorer" -ItemType "directory" -Force -Move-Item -Path $Path/CinematicUnityExplorer.BIE6.Mono.dll -Destination $Path/plugins/CinematicUnityExplorer -Force -Move-Item -Path $Path/UniverseLib.Mono.dll -Destination $Path/plugins/CinematicUnityExplorer -Force -# (create zip archive) -Remove-Item $Path/../CinematicUnityExplorer.BepInEx6.Mono.zip -ErrorAction SilentlyContinue -compress-archive .\$Path\* $Path/../CinematicUnityExplorer.BepInEx6.Mono.zip +$OutputPath = "$Path/output/BepInEx/plugins/CinematicUnityExplorer" -# ----------- BepInEx 6 Unity Mono ----------- -dotnet build src/CinematicUnityExplorer.sln -c Release_BIE6_Unity_Mono -$Path = "Release/CinematicUnityExplorer.BepInEx6.Unity.Mono" -# ILRepack -lib/ILRepack.exe /target:library /lib:lib/net35 /lib:lib/net35/BepInEx/build647+ /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.BIE6.Unity.Mono.dll $Path/CinematicUnityExplorer.BIE6.Unity.Mono.dll $Path/mcs.dll $Path/Tomlet.dll -# (cleanup and move files) -Remove-Item $Path/Tomlet.dll -Remove-Item $Path/mcs.dll -New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force -New-Item -Path "$Path" -Name "plugins/CinematicUnityExplorer" -ItemType "directory" -Force -Move-Item -Path $Path/CinematicUnityExplorer.BIE6.Unity.Mono.dll -Destination $Path/plugins/CinematicUnityExplorer -Force -Move-Item -Path $Path/UniverseLib.Mono.dll -Destination $Path/plugins/CinematicUnityExplorer -Force -# (create zip archive) -Remove-Item $Path/../CinematicUnityExplorer.BepInEx6.Unity.Mono.zip -ErrorAction SilentlyContinue -compress-archive .\$Path\* $Path/../CinematicUnityExplorer.BepInEx6.Unity.Mono.zip +New-Item -ItemType Directory -Path $OutputPath -Force -# ----------- Standalone Mono ----------- -dotnet build src/CinematicUnityExplorer.sln -c Release_STANDALONE_Mono -$Path = "Release/CinematicUnityExplorer.Standalone.Mono" # ILRepack -lib/ILRepack.exe /target:library /lib:lib/net35 /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.Standalone.Mono.dll $Path/CinematicUnityExplorer.Standalone.Mono.dll $Path/mcs.dll $Path/Tomlet.dll -# (cleanup and move files) -Remove-Item $Path/Tomlet.dll -Remove-Item $Path/mcs.dll -Remove-Item $Path/../CinematicUnityExplorer.Standalone.Mono.zip -ErrorAction SilentlyContinue -compress-archive .\$Path\* $Path/../CinematicUnityExplorer.Standalone.Mono.zip +lib/ILRepack.exe /target:library /lib:lib/net472/BepInEx/build647+ /lib:lib/net6/ /lib:lib/interop/ /lib:$Path /internalize /out:$OutputPath/CinematicUnityExplorer.BIE.Unity.IL2CPP.CoreCLR.dll $Path/CinematicUnityExplorer.BIE.Unity.IL2CPP.CoreCLR.dll $Path/mcs.dll $Path/Tomlet.dll -# ----------- Standalone IL2CPP ----------- -dotnet build src/CinematicUnityExplorer.sln -c Release_STANDALONE_Cpp -$Path = "Release/CinematicUnityExplorer.Standalone.IL2CPP" -# ILRepack -lib/ILRepack.exe /target:library /lib:lib/net472 /lib:lib/unhollowed /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.Standalone.IL2CPP.dll $Path/CinematicUnityExplorer.Standalone.IL2CPP.dll $Path/mcs.dll $Path/Tomlet.dll # (cleanup and move files) -Remove-Item $Path/Tomlet.dll -Remove-Item $Path/mcs.dll -Remove-Item $Path/Iced.dll -Remove-Item $Path/UnhollowerBaseLib.dll -Remove-Item $Path/../CinematicUnityExplorer.Standalone.IL2CPP.zip -ErrorAction SilentlyContinue -compress-archive .\$Path\* $Path/../CinematicUnityExplorer.Standalone.IL2CPP.zip +Move-Item -Path $Path/UniverseLib.BIE.IL2CPP.Interop.dll -Destination $OutputPath -Force -# ----------- Editor (mono) ----------- -$Path1 = "Release/CinematicUnityExplorer.Standalone.Mono" -$Path2 = "UnityEditorPackage/Runtime" -Copy-Item $Path1/CinematicUnityExplorer.STANDALONE.Mono.dll -Destination $Path2 -Copy-Item $Path1/UniverseLib.Mono.dll -Destination $Path2 -Remove-Item Release/CinematicUnityExplorer.Editor.zip -ErrorAction SilentlyContinue -compress-archive .\UnityEditorPackage\* Release/CinematicUnityExplorer.Editor.zip