TestingLib

版本 v1.2.2·更新於 2026-02-15

A library that implements methods to help with testing.

模組介紹 作者原文

WARNING

This (DevTools / TestingLib) is no longer developed. It'd be better to create an alternative solution for development tools, or use Imperium.

If you want to fork this, do not! The code and architecture is bad, you're better off creating something from the ground up.

TestingLib

This is a tool intended for making testing of enemy mods faster in Lethal Company. This is intended to be used in debug builds of your mods. For example:

//... in your Plugin class:

private void Awake() {

Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");

var ExampleEnemy = Assets.MainAssetBundle.LoadAsset("ExampleEnemy");

//...

if DEBUG

TestingLib.Patch.PatchAll();

TestingLib.OnEvent.PlayerSpawn += OnEvent_PlayerSpawn;

endif

}

if DEBUG

private void OnEvent_PlayerSpawn()

{

TestingLib.Execute.ToggleTestRoom();

TestingLib.Tools.GiveItemToSelf(TestingLib.Lookup.Item.Shovel);

TestingLib.Tools.TeleportSelf(TestingLib.Tools.TeleportLocation.Outside);

TestingLib.Tools.SpawnEnemyInFrontOfSelf(ExampleEnemy.enemyName);

}

endif

//...

Currently, this library is used on DevTools and the experimental branch of LC-ExampleEnemy.

TestingLib Modules

TestingLib.Patch

Contains methods that patch various things in the game.

IsEditor()

Patches the game to think it is running in Unity Editor, allowing us to use the in-game debug menu.

SkipSpawnPlayerAnimation()

Skips the spawn player animation so you can start moving and looking around as soon as you spawn.

InfiniteSprint()

Patches the game to allow infinite sprinting by always setting SprintMeter to full.

OnDeathHeal()

Instead of dying, set health to full instead.

This helps with testing taking damage from your enemy, without death being a concern.

MovementCheat()

Allows jumping at any moment and by performing a double jump, the movement will become much

faster and a lot more responsive, and running will also increase jump height and gravity.

Note: This completely overrides PlayerControllerB's Jump_performed() method.

InfiniteCredits()

Credits get always set to 100 000 000.

InfiniteShotgunAmmo()

Skips the check for ammo when using the shotgun.

PatchAll()

Calls all methods in TestingLib.Patch:

Patch.IsEditor()

Patch.SkipSpawnPlayerAnimation()

Patch.OnDeathHeal()

Patch.MovementCheat()

Patch.InfiniteSprint()

Patch.InfiniteCredits()

Patch.InfiniteShotgunAmmo()

UnpatchAll()

Unpatches all applied patches.

TestingLib.Execute

Contains actions that can be executed.

ToggleTestRoom()

Toggles the testing room from the debug menu.

Should be ran on OnEvent.PlayerSpawn or later.

TestingLib.OnEvent

Contains Events that can be subscribed to.

PlayerSpawn

Event for when player spawns.

Called on On.GameNetcodeStuff.PlayerControllerB.SpawnPlayerAnimation.

TestingLib.Tools

Contains helpful methods for testing.

TeleportSelf(TeleportLocation location = 0)

  • TeleportLocation.Inside = 1
  • TeleportLocation.Outside = 2

Teleports you to the location specified in the test level.

TeleportSelfToEntrance()

Teleport yourself to entrance.

SpawnEnemyInFrontOfSelf(string enemyName)

Will find the enemy by name, and spawn it.

If name is invalid, prints all valid enemy names to console.

GiveItemToSelf(string itemName)

Will find item by name, and give it to your inventory.

If name is invalid, prints all valid item names to console.

TestingLib.Lookup

Get the names of items and enemies in the vanilla game without having to look them up.

TestingLib.Lookup.Item

Names of items.

TestingLib.Lookup.EnemyInside

Names of inside enemies.

TestingLib.Lookup.EnemyOutside

Names of outside enemies.

TestingLib.Lookup.EnemyDaytime

Names of daytime Enemies.

TestingLib.Enemy

Helpful methods for making debugging of enemies easier.

DrawPath(LineRenderer line, NavMeshAgent agent) // Consider not using this for now, as this is not an optimal solution.

Draws the NavMeshAgent's pathfinding. Should be used in DoAIInterval(). Do note that you need to add line renderer in your enemy prefab. This can be done as such:

//... in your

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

BepInEx-BepInExPackEvaisa-HookGenPatcher

檔案與校驗

檔案名稱
TestingLib-1.2.2.zip
檔案大小
73.9 KiB