-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
54 lines (47 loc) · 1.36 KB
/
Plugin.cs
File metadata and controls
54 lines (47 loc) · 1.36 KB
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
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using System;
using System.Text;
using UnityEngine;
namespace GCMod;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
public class Plugin : BasePlugin
{
public static new ConfigFile Config;
public static new ManualLogSource Log;
public static MonoBehaviour Instance;
public override void Load()
{
try {
Console.OutputEncoding = Encoding.UTF8;
} catch (Exception)
{
}
// Plugin startup logic
Log = base.Log;
Config = base.Config;
Log.LogInfo(new string('-', 50));
Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!");
Log.LogInfo("项目地址: https://github.com/anosu/GCMod");
Log.LogInfo(new string('-', 50));
GCMod.Config.Initialize();
foreach (string arg in Environment.GetCommandLineArgs())
{
if (arg.Equals("--offline"))
{
GCMod.Config.offline = true;
}
}
Patch.Initialize();
Notification.Initialize();
Instance = AddComponent<PluginBehaviour>();
Translation.Initialize();
}
public override bool Unload()
{
Notification.Cleanup();
return base.Unload();
}
}