探索课程 / BepInEx IL2CPP 游戏模组开发:架构、互操作与 IMGUI / 1.2 [BepInPlugin] 核心特性与模组元数据配置
+15 积分

1.2 [BepInPlugin] 核心特性与模组元数据配置

25 分钟 CSHARP

The [BepInPlugin] Attribute

Every BepInEx plugin starts with the [BepInPlugin] attribute to specify the mod's unique GUID, Name, and Version:

csharp
using BepInEx;
using BepInEx.IL2CPP;

[BepInPlugin("top.hanaverse.trainer", "Hana IL2CPP Trainer", "1.0.0")]
public class Plugin : BasePlugin {
    public override void Load() {
        Log.LogInfo("Plugin loaded into IL2CPP domain!");
    }
}

Requirements:

  1. GUID: A unique identifier like com.author.modname or top.hanaverse.trainer.
  2. Name: Human-readable name displayed in the console.
  3. Version: Semantic version (e.g. 1.0.0).

动手交互式云端实验室

借助浏览器内置的云端实验室和自动化评测引擎,全面掌握 Python、C#、C++ 以及游戏 Mod 架构开发。

进入云端实验