-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCamera_Patch.cs
47 lines (38 loc) · 1.37 KB
/
Camera_Patch.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
41
42
43
44
45
46
47
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using static ErrorMessage;
namespace Tweaks_Fixes
{
internal class Camera_Patch
{
[HarmonyPatch(typeof(MainCameraControl), "ShakeCamera")]
class MainCameraControl_ShakeCamera_Patch
{
static bool Prefix(MainCameraControl __instance)
{
//AddDebug("MainCameraControl ShakeCamera");
return ConfigToEdit.cameraShake.Value;
}
}
[HarmonyPatch(typeof(DamageFX), "AddHudDamage")]
class DamageFX_AddHudDamage_Patch
{
public static bool Prefix(DamageFX __instance, float damageScalar, Vector3 damageSource, DamageInfo damageInfo)
{
//Main.config.crushDamageScreenEffect = false;
//AddDebug("AddHudDamage " + damageInfo.type);
if (!ConfigToEdit.crushDamageScreenEffect.Value && damageInfo.type == DamageType.Pressure)
return false;
if (ConfigMenu.damageImpactEffect.Value)
__instance.CreateImpactEffect(damageScalar, damageSource, damageInfo.type);
if (ConfigMenu.damageScreenFX.Value)
__instance.PlayScreenFX(damageInfo);
return false;
}
}
}
}