diff --git a/BepInEx.AutoPlugin/AutoPluginGenerator.cs b/BepInEx.AutoPlugin/AutoPluginGenerator.cs index cf884b6..395f05c 100644 --- a/BepInEx.AutoPlugin/AutoPluginGenerator.cs +++ b/BepInEx.AutoPlugin/AutoPluginGenerator.cs @@ -122,7 +122,7 @@ public void Execute(GeneratorExecutionContext context) var source = SourceText.From($@"// namespace {typeSymbol.ContainingNamespace.ToDisplayString()} {{ - [{attributeName}({typeSymbol.Name}.Id, {typeSymbol.Name}.Name, {typeSymbol.Name}.Version)] + [{attributeName}({typeSymbol.Name}.Id, ""{name}"", ""{version}"")] public partial class {typeSymbol.Name} {{ /// @@ -133,12 +133,12 @@ public partial class {typeSymbol.Name} /// /// Gets the name of the . /// - public const Name = ""{name}""; + public static string Name => ""{name}""; /// /// Gets the version of the . /// - public const Version = ""{version}""; + public static string Version => ""{version}""; }} }} ", Encoding.UTF8); diff --git a/README.md b/README.md index d39b954..10422db 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,11 @@ public partial class ExamplePlugin : BaseUnityPlugin into ```cs -[BepInEx.BepInPlugin(ExamplePlugin.Id, ExamplePlugin.Name, ExamplePlugin.Version)] +[BepInEx.BepInPlugin(ExamplePlugin.Id, "ExamplePlugin", "0.1.0")] public class ExamplePlugin : BaseUnityPlugin { public const string Id = "com.example.ExamplePlugin"; - public const string Name = "ExamplePlugin"; - public const string Version = "0.1.0"; + public static string Name => "ExamplePlugin"; + public static string Version => "0.1.0"; } ```