Caves of Qud

Caves of Qud

Harmony Injector
 이 토론은 고정되었습니다. 중요해서 그렇겠죠?
namkazt  [개발자] 2019년 1월 15일 오전 9시 51분
Example Annotation Mod
1, create new mod folder in Mods ( %AppData%\..\LocalLow\Freehold Games\CavesOfQud\Mods )

2, create new script file (.cs)
Content:
using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Reflection; using UnityEngine; using Harmony; using GameObject = XRL.World.GameObject; using XRL.World.Parts.Mutation; namespace Namkazt.HarmonyTest { [HarmonyPatch(typeof(MultipleArms))] [HarmonyPatch("Mutate", new[] { typeof(GameObject), typeof(int) })] class Patch { // all method can use parameters: // 1, MultipleArms __instance : equal with `this` in original method // 2, (ref) ResultType __result : result if method have ( ref is optional ) // 3, other parameter of method if have but need exactly same name // 4, other param is on Harmony Patch wiki. // only void static void Postfix() { Debug.Log("[Namkazt.HarmonyTest] Yay!. We just override mutate function if you have mutation [MultipleArms]"); } } [HarmonyPatch(typeof(MultipleArms))] [HarmonyPatch("Mutate", new[] { typeof(GameObject), typeof(int) })] class SecondPath_SameFunction { // can be bool or void static bool Prefix() { Debug.Log("[Namkazt.HarmonyTest] It is second patch method. is it working ?"); // return false will BLOCK original function return true; // return true will contionue to run original function } } }
namkazt 님이 마지막으로 수정; 2019년 1월 18일 오전 2시 02분