-
Notifications
You must be signed in to change notification settings - Fork 1
/
ScorchedEarth.cs
57 lines (50 loc) · 1.51 KB
/
ScorchedEarth.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
48
49
50
51
52
53
54
55
56
57
using System;
using Harmony;
using Newtonsoft.Json;
using UnityEngine;
// ReSharper disable NotAccessedVariable
// ReSharper disable ClassNeverInstantiated.Global
// ReSharper disable InconsistentNaming
namespace ScorchedEarth
{
public class ScorchedEarth
{
// must be at least this far away to not be filtered out
public const float DecalDistance = 4.25f;
public const float FootstepDistance = 1f;
internal const int chunkSize = 125;
internal static readonly HarmonyInstance harmony = HarmonyInstance.Create("ca.gnivler.BattleTech.ScorchedEarth");
internal static Settings modSettings;
public static void Init(string settingsJson, string modDirectory)
{
try
{
modSettings = JsonConvert.DeserializeObject<Settings>(settingsJson);
modSettings.SaveDirectory = modDirectory + "\\Saves\\";
}
catch (Exception ex)
{
Log(ex);
modSettings = new Settings();
}
Helpers.SetMaxDecals();
Patches.Init();
}
internal static void Log(object input)
{
//FileLog.Log($"[ScorchedEarth] {input}");
}
}
internal class Settings
{
public int MaxDecals;
public bool SaveState = true;
public string SaveDirectory;
}
internal class DecalInfo
{
public Vector3 pos;
public Quaternion rot;
public Vector3 scale;
}
}