-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.cs
44 lines (39 loc) · 1.67 KB
/
Main.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
using System;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using Cysharp.Threading.Tasks;
using OpenMod.Unturned.Plugins;
using OpenMod.API.Plugins;
// For more, visit https://openmod.github.io/openmod-docs/devdoc/guides/getting-started.html
[assembly: PluginMetadata("ImmersiveBleeding", DisplayName = "ImmersiveBleeding")]
namespace MyOpenModPlugin
{
public class MyOpenModPlugin : OpenModUnturnedPlugin
{
private readonly IConfiguration m_Configuration;
private readonly IStringLocalizer m_StringLocalizer;
private readonly ILogger<MyOpenModPlugin> m_Logger;
public MyOpenModPlugin(
IConfiguration configuration,
IStringLocalizer stringLocalizer,
ILogger<MyOpenModPlugin> logger,
IServiceProvider serviceProvider) : base(serviceProvider)
{
m_Configuration = configuration;
m_StringLocalizer = stringLocalizer;
m_Logger = logger;
}
protected override async UniTask OnLoadAsync()
{
// await UniTask.SwitchToMainThread(); uncomment if you have to access Unturned or UnityEngine APIs
m_Logger.LogInformation("Immersive Bleeding is loaded! - By EliteWise");
// await UniTask.SwitchToThreadPool(); // you can switch back to a different thread
}
protected override async UniTask OnUnloadAsync()
{
// await UniTask.SwitchToMainThread(); uncomment if you have to access Unturned or UnityEngine APIs
m_Logger.LogInformation(m_StringLocalizer["plugin_events:plugin_stop"]);
}
}
}