UnityExplorerAddons

版本 v0.1.0·更新於 2025-08-12

Small addition(s) to UnityExplorer. Right now, Watches (live updating fields on screen)

模組介紹 作者原文

UnityExplorerAddons

This adds some features to the very useful unity game mod UnityExplorer by sinai-dev.

Right now, this is only one additional feature added: Watches

What are Watches?

Watches are, simply, a way to watch a value update in real time. In this mod, they are implemented via a Popup box on the righthand side of your screen which can be toggled via a new button on the main UnityExplorer Nav bar. After a watch has been added to the list, it can be removed by pressing the X button next to it when the UnityExplorer UI is open.

Simple watches

When you're inspecting a component or class, you will see a new, blue "Watch" button next to the Copy and Paste buttons for each field. When pressed, it will add a "Simple Watch" to the watch box. This will always follow the format of:

Class.FieldName: value.ToString(). If it's a component attached to a GameObject, the GameObject's name will be added to the end. The watch will ensure that the object hasn't been destroyed, and if it has, will remove the watch from the list.

If you click watch on a method, it will attempt to evaluate that method every frame and show the return value from it in the same format as above. Be careful of this since if you watch the wrong method, you can cause something to happen a lot very quickly.

If the method has parameters, then until you open the Evaluator box in the inspector for that method, it will fail to be added to the watch list. Once you open it, every parameter is given a default value, and it can then be watched. However, if it errors, for example with a NullReferenceException, it will be removed from the watch list and the error printed. The watch shown will always run with the parameters provided in the Evaluator box at the time you click the watch button.

Expression watches

Expression watches are a way to run custom code inside your watches. This can be useful if you want to show information from a struct or class reference that changes every frame. You provide an expression watch with a function to evaluate, and it shows the string your function returns every frame under Expression Watches in the window.

You can add an expression watch in a couple different ways and formats. First, you can reference UnityExplorerAddons.API.WatchAPI in a plugin and call the Watch() method(s) from there, or you can call Watch() directly from the Unity Explorer C# console.

The different signatures for Watch() are as follows:

Watch(Func) - This is for a "static" watch. It will run the provided function and output the string it returns.

For example:

Watch(() => Time.time)

Watch(Type, Func) - Here, you define the type of the passed object, the object instance you want to be input into your function, and the function itself. It will run the function with the provided as the input.

For example (using a GTFO object):

foreach (var player in Player.PlayerManager.PlayerAgentsInLevel)

{

Watch(player, obj =>

$"{obj.Owner.NickName} - {obj.Position} - {obj.Inventory.WieldedItem?.PublicName?? "EmptyHands"}"

);

}

Watch(object, Func) - More or less just an easier way to access to similar signature above. This just allows you to pass a generic object, so you don't need to manually cast it yourself while creating the function. This helps a lot when using CurrentTarget or Paste()

For example, if the inspector window is currently focused on a PlayerAgent:

Watch(CurrentTarget, obj => $"Currently watching {obj.Owner.NickName}")

Technically the funcs are predefined delegates, but those are the func signatures you would be matching with them

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
  3. 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
  4. 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。

不同模組的安裝位置差異較大,包內說明是最可靠的依據。

前置依賴

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

GTFOModding-UnityExplorer_IL2CPPBepInEx-BepInExPack_GTFO

檔案與校驗

檔案名稱
UnityExplorerAddons-0.1.0.zip
檔案大小
57.0 KiB