-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnityDummyDll.cs
More file actions
40 lines (34 loc) · 1.3 KB
/
UnityDummyDll.cs
File metadata and controls
40 lines (34 loc) · 1.3 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
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using CG.SDK.Dotnet.Attributes;
using CG.SDK.Dotnet.Engine;
using CG.SDK.Dotnet.Engine.Unity;
using CG.SDK.Dotnet.Helper.IO;
using CG.SDK.Dotnet.Plugin.Output;
namespace CG.Output;
[PluginInfo(
Name = nameof(UnityDummyDll),
Version = "5.0.0",
Author = "CorrM",
Description = "Generate dummy dll",
WebsiteLink = "https://github.com/CheatGear",
SourceCodeLink = "https://github.com/CheatGear/Output.UnityDummyDll"
)]
public sealed class UnityDummyDll : OutputPlugin<UnitySdkFile>
{
public override string OutputName => "DummyDll";
public override GameEngine SupportedEngines => GameEngine.Unity;
public override OutputPurpose SupportedPurpose => OutputPurpose.Internal | OutputPurpose.External;
public override IReadOnlyDictionary<Enum, OutputOption> Options { get; } = new Dictionary<Enum, OutputOption>();
public override async ValueTask SaveAsync(string saveDirPath, OutputPurpose processPurpose)
{
// Write assemblies
foreach ((string fileName, byte[] fileContent) in SdkFile.Assemblies)
{
using var ms = new MemoryStream(fileContent);
await FileManager.WriteAsync(saveDirPath, fileName, ms).ConfigureAwait(false);
}
}
}