mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-03 23:09:22 +00:00
[AvatarScaleMod] Add settings & cleanup.
why do i obsess with making my mods look pretty when staring them down in dnspy
This commit is contained in:
parent
e8d3183bc3
commit
f92e842f41
7 changed files with 111 additions and 4 deletions
|
@ -1,15 +1,22 @@
|
|||
using UnityEngine;
|
||||
using ABI_RC.Core.Savior;
|
||||
|
||||
namespace NAK.AvatarScaleMod;
|
||||
|
||||
public static class AvatarScaleGesture
|
||||
{
|
||||
public static bool GestureEnabled;
|
||||
public static bool RequireTriggers = true;
|
||||
public static float InitialModifier = 1f;
|
||||
public static float InitialTargetHeight = 1.8f;
|
||||
|
||||
public static void OnScaleStart(float modifier, Transform transform1, Transform transform2)
|
||||
{
|
||||
// AvatarScaleMod.Logger.Msg("OnScaleStart!");
|
||||
if (!GestureEnabled)
|
||||
return;
|
||||
|
||||
// you can start the scale, but cant interact with it without holding triggers
|
||||
|
||||
if (AvatarScaleManager.LocalAvatar != null)
|
||||
{
|
||||
|
@ -22,6 +29,11 @@ public static class AvatarScaleGesture
|
|||
public static void OnScaleStay(float modifier, Transform transform1, Transform transform2)
|
||||
{
|
||||
// AvatarScaleMod.Logger.Msg("OnScaleStay!");
|
||||
if (!GestureEnabled)
|
||||
return;
|
||||
|
||||
if (RequireTriggers && !IsBothTriggersDown())
|
||||
return;
|
||||
|
||||
if (AvatarScaleManager.LocalAvatar != null)
|
||||
{
|
||||
|
@ -39,4 +51,9 @@ public static class AvatarScaleGesture
|
|||
{
|
||||
// AvatarScaleMod.Logger.Msg("OnScaleEnd!");
|
||||
}
|
||||
|
||||
public static bool IsBothTriggersDown()
|
||||
{
|
||||
return CVRInputManager.Instance.interactLeftValue > 0.75f && CVRInputManager.Instance.interactRightValue > 0.75f;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue