-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSRAirNetUpgrade.cs
50 lines (45 loc) · 1.19 KB
/
SRAirNetUpgrade.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
using UnityEngine;
using UModFramework.API;
using System;
using System.Linq;
using System.Collections.Generic;
namespace SRAirNetUpgrade
{
[UMFHarmony(1)] //Set this to the number of harmony patches in your mod.
[UMFScript]
class SRAirNetUpgrade : MonoBehaviour
{
internal static void Log(string text, bool clean = false)
{
using (UMFLog log = new UMFLog()) log.Log(text, clean);
}
[UMFConfig]
public static void LoadConfig()
{
SRAirNetUpgradeConfig.Instance.Load();
}
void Awake()
{
Log("SRAirNetUpgrade v" + UMFMod.GetModVersion().ToString(), true);
UMFGUI.RegisterPauseHandler(Pause);
}
public static void Pause(bool pause)
{
TimeDirector timeDirector = null;
try
{
timeDirector = SRSingleton<SceneContext>.Instance.TimeDirector;
}
catch { }
if (!timeDirector) return;
if (pause)
{
if (!timeDirector.HasPauser()) timeDirector.Pause();
}
else timeDirector.Unpause();
}
void Update()
{
}
}
}