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/.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/README.md b/README.md
index 2a2879a7..c97a7045 100644
--- a/README.md
+++ b/README.md
@@ -1,25 +1,29 @@
-# Cinematic Unity Explorer
+# Cinematic Unity Explorer Adapted for Night-Runners
+
+
+Night-Runners Discord modding community server: click
+
-
+
- 🎥 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.
- ✔️ Supports most Unity versions from 5.2 to 2021+ (IL2CPP and Mono).
+ To see the forks features we have worked on so far check out the Features section.
✨ Powered by UniverseLib
-# Releases [](../../releases)
+# Releases [](../../releases)
-[](../../releases/latest) [](https://github.com/originalnicodr/CinematicUnityExplorer/actions) [](../../releases/latest)
+[](../../releases/latest) [](https://github.com/Scoolnik/NR-CinematicUnityExplorer/actions) [](../../releases/latest)
@@ -30,15 +34,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).
+
+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/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) |
+| 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/`
@@ -47,35 +51,18 @@ Nightly builds can be found [here](https://github.com/originalnicodr/CinematicUn
## MelonLoader
-| 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) |
+| 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/originalnicodr/CinematicUnityExplorer/releases/latest/download/CinematicUnityExplorer.Standalone.IL2CPP.zip) | ✅ [link](https://github.com/originalnicodr/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.
-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/originalnicodr/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
@@ -94,7 +81,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 +111,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 +138,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 +170,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 +192,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 +216,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 +228,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 +239,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 +251,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 +271,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 +281,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));
```
diff --git a/UniverseLib b/UniverseLib
index 3dc1aba1..503ea77c 160000
--- a/UniverseLib
+++ b/UniverseLib
@@ -1 +1 @@
-Subproject commit 3dc1aba123650cf829cc2ea828aff737f197a4a9
+Subproject commit 503ea77c5e6e56a10ac84754b5d4b1de20286ac9
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
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/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/CinematicUnityExplorer.csproj b/src/CinematicUnityExplorer.csproj
index a2063dd8..4d648ff0 100644
--- a/src/CinematicUnityExplorer.csproj
+++ b/src/CinematicUnityExplorer.csproj
@@ -16,7 +16,7 @@
-
+
@@ -346,4 +346,45 @@
False
+
+
+
+
+ ..\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
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/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";
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..9e42f806
--- /dev/null
+++ b/src/NightRunners/Utils/RCCUtils.cs
@@ -0,0 +1,128 @@
+using CinematicUnityExplorer.NightRunners.Extensions;
+using Il2CppInterop.Runtime;
+using Rewired;
+
+namespace CinematicUnityExplorer.NightRunners.Utils
+{
+ public static class RCCUtils
+ {
+ 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_UI(enable);
+ }
+
+ public static GameObject GetCameraContainer(Camera camera)
+ {
+ 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)");
+ }
+ }
+
+ 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)
+ {
+ return container.NullCheck()?.GetComponent();
+ }
+
+ 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;
+ if (controller.homegarage)
+ {
+ controller.homegarage.noInput = !enable;
+ }
+ var vCamera = controller.transform.Find("vCamera");
+ if (vCamera)
+ {
+ vCamera.transform.localPosition = enable ? new Vector3(0, 0.85f, 0) : Vector3.zero; //direct camera GO parent
+ vCamera.transform.localRotation = Quaternion.identity;
+ }
+ }
+ else
+ {
+ Debug.LogWarning("FPEFirstPersonController not found ");
+ }
+ }
+
+ private static void ToggleRCC_Camera(GameObject container, bool enable)
+ {
+ var rcc = GetRCC_Camera(container);
+ 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");
+ }
+ }
+
+ 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/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/FreeCamPanel.cs b/src/UI/Panels/FreeCamPanel.cs
index 123e8cc0..60e90e57 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;
@@ -41,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;
@@ -65,6 +67,7 @@ public FreeCamPanel(UIBase owner) : base(owner)
static InputFieldRef positionInput;
static InputFieldRef moveSpeedInput;
static Text followObjectLabel;
+ static Text lookAtObjectLabel;
static ButtonRef inspectButton;
public static Toggle followRotationToggle;
static bool disabledCinemachine;
@@ -82,6 +85,9 @@ 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;
+
+ public static GameObject lookAtObject = null;
private static FreecamCursorUnlocker freecamCursorUnlocker = null;
@@ -92,6 +98,11 @@ internal static void BeginFreecam()
inFreeCamMode = true;
connector?.UpdateFreecamStatus(true);
+ RCCUtils.ToggleGameUI(false);
+ if (blockGamesInputOnFreecamToggle.isOn)
+ {
+ RCCUtils.SetDefaultInputEnabled(false);
+ }
previousMousePosition = IInputManager.MousePosition;
CacheMainCamera();
@@ -108,17 +119,19 @@ internal static void BeginFreecam()
static void CacheMainCamera()
{
Camera currentMain = Camera.main;
+ CameraContainer = RCCUtils.GetCameraContainer(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
@@ -139,6 +152,7 @@ static void SetupFreeCamera()
usingGameCamera = true;
ourCamera = lastMainCamera;
MaybeToggleCinemachine(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){
@@ -165,16 +179,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;
@@ -191,18 +205,24 @@ internal static void EndFreecam()
inFreeCamMode = false;
connector?.UpdateFreecamStatus(false);
+ RCCUtils.ToggleGameUI(true);
+ RCCUtils.SetDefaultInputEnabled(true);
+
if (usingGameCamera)
{
-
MaybeToggleCinemachine(true);
ourCamera = null;
if (lastMainCamera)
{
- lastMainCamera.transform.position = originalCameraPosition;
- lastMainCamera.transform.rotation = originalCameraRotation;
lastMainCamera.fieldOfView = originalCameraFOV;
}
+
+ if (CameraContainer)
+ {
+ RCCUtils.ToggleCameraController(CameraContainer.gameObject, true);
+ CameraContainer.SetPositionAndRotation(originalCameraPosition, originalCameraRotation);
+ }
}
if (ourCamera)
@@ -256,7 +276,7 @@ static void SetCameraPositionInput(Vector3 pos)
if (!ourCamera || lastSetCameraPosition == pos)
return;
- ourCamera.transform.position = pos;
+ CameraContainer.position = pos;
lastSetCameraPosition = pos;
}
@@ -271,7 +291,7 @@ internal static void UpdatePositionInput()
if (connector != null && connector.IsActive)
return;
- lastSetCameraPosition = ourCamera.transform.position;
+ lastSetCameraPosition = CameraContainer.position;
positionInput.Text = ParseUtility.ToStringForInput(lastSetCameraPosition);
}
@@ -296,7 +316,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);
@@ -326,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);
@@ -383,6 +409,10 @@ protected override void ConstructPanelContent()
UIFactory.SetLayoutElement(releaseFollowButton.GameObject, minWidth: 150, minHeight: 25, flexibleWidth: 9999);
releaseFollowButton.OnClick += ReleaseFollowButton_OnClick;
+ var followPlayerCarButton = UIFactory.CreateButton(ContentRoot, "FollowPlayerCarButton", "Follow Car");
+ UIFactory.SetLayoutElement(followPlayerCarButton.GameObject, minWidth: 150, minHeight: 25, flexibleWidth: 9999);
+ followPlayerCarButton.OnClick += FollowPlayerCar;
+
GameObject followRotationGameObject = UIFactory.CreateToggle(ContentRoot, "followRotationToggle", out followRotationToggle, out Text followRotationText);
UIFactory.SetLayoutElement(followRotationGameObject, minHeight: 25, flexibleWidth: 9999);
followRotationToggle.isOn = false;
@@ -403,6 +433,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" +
@@ -494,6 +543,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){
@@ -509,6 +578,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)
@@ -618,50 +730,51 @@ 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;
}
+ lastKnownPosition = CameraContainer.position;
}
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;
}
}
}
@@ -686,35 +799,49 @@ internal void Update()
FreeCamPanel.EndFreecam();
return;
}
- Transform transform = FreeCamPanel.ourCamera.transform;
+ 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
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);
+ if (FreeCamPanel.lookAtObject != null && !FreeCamPanel.cameraPathMover.playingPath)
+ {
+ transform.LookAt(FreeCamPanel.lookAtObject.transform);
+ }
+
+ 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;
@@ -727,24 +854,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);
@@ -806,6 +935,8 @@ internal void ProcessInput(){
}
FreeCamPanel.previousMousePosition = IInputManager.MousePosition;
+ transform.position += delta;
+ return delta;
}
}
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){
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));
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;