mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
two small fixes so thirdperson feels better to use no longer scrolls while in menus or unity explorer, and frontview
49 lines
No EOL
1.5 KiB
C#
49 lines
No EOL
1.5 KiB
C#
using MelonLoader;
|
|
using System;
|
|
using System.Reflection;
|
|
using UnityEngine;
|
|
using static NAK.ThirdPerson.CameraLogic;
|
|
using BuildInfo = NAK.ThirdPerson.BuildInfo;
|
|
|
|
[assembly: AssemblyCopyright("Created by " + BuildInfo.Author)]
|
|
[assembly: MelonInfo(typeof(NAK.ThirdPerson.ThirdPerson), BuildInfo.Name, BuildInfo.Version, BuildInfo.Author)]
|
|
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
|
|
[assembly: MelonColor(ConsoleColor.DarkMagenta)]
|
|
|
|
namespace NAK.ThirdPerson;
|
|
|
|
public static class BuildInfo
|
|
{
|
|
public const string Name = "ThirdPerson";
|
|
public const string Author = "Davi & NotAKidoS";
|
|
public const string Version = "1.0.1";
|
|
}
|
|
|
|
public class ThirdPerson : MelonMod
|
|
{
|
|
internal static MelonLogger.Instance Logger;
|
|
|
|
public override void OnInitializeMelon()
|
|
{
|
|
Logger = LoggerInstance;
|
|
|
|
MelonCoroutines.Start(SetupCamera());
|
|
|
|
Patches.Apply(HarmonyInstance);
|
|
}
|
|
|
|
public override void OnUpdate()
|
|
{
|
|
// Prevents scrolling while in Menus or UnityExplorer
|
|
if (State && Cursor.lockState == CursorLockMode.Locked)
|
|
{
|
|
if (Input.GetAxis("Mouse ScrollWheel") > 0f) IncrementDist();
|
|
else if (Input.GetAxis("Mouse ScrollWheel") < 0f) DecrementDist();
|
|
}
|
|
|
|
if (!Input.GetKey(KeyCode.LeftControl)) return;
|
|
if (Input.GetKeyDown(KeyCode.T)) State = !State;
|
|
if (!State || !Input.GetKeyDown(KeyCode.Y)) return;
|
|
RelocateCam((CameraLocation)(((int)CurrentLocation + 1) % Enum.GetValues(typeof(CameraLocation)).Length), true);
|
|
}
|
|
} |