-
Notifications
You must be signed in to change notification settings - Fork 0
/
SkaterControllerPatch.cs
40 lines (37 loc) · 1.33 KB
/
SkaterControllerPatch.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using System.Reflection;
using UnityModManagerNet;
using SkaterXL.Core;
using Dreamteck.Splines;
namespace fro_mod
{
[HarmonyPatch(typeof(SkaterController), "InAirRotation", new Type[] { typeof(float) })]
class InAirRotationPatch
{
static bool Prefix(float p_slerp, SkaterController __instance)
{
return Main.controller.InAirRotationPatch(p_slerp, __instance);
}
}
[HarmonyPatch(typeof(SkaterController), "AddTurnTorque", new Type[] { typeof(float) })]
class AddTurnTorquePatch
{
static bool Prefix(float p_value, SkaterController __instance)
{
if (Main.controller.enabled && Main.settings.customTurn)
{
p_value *= (Main.settings.customTurnMultiplier / 10f);
__instance.skaterRigidbody.AddTorque(__instance.skaterTransform.up * p_value * Time.deltaTime * Main.settings.customTurnSpeed, ForceMode.VelocityChange);
__instance.leanProxy.AddTorque(__instance.skaterTransform.up * p_value * Time.deltaTime * Main.settings.customTurnSpeed, ForceMode.VelocityChange);
return false;
}
else return true;
}
}
}