misc stuff from other avatars
This commit is contained in:
parent
99420739e0
commit
e2b229edfc
13 changed files with 273 additions and 0 deletions
31
VRCFAllowRootFeatures/VRCFAllowRootFeatures.cs
Normal file
31
VRCFAllowRootFeatures/VRCFAllowRootFeatures.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
[InitializeOnLoad]
|
||||
public static class VRCFAllowRootFeatures {
|
||||
static VRCFAllowRootFeatures() {
|
||||
var harmony = new Harmony("gay.lilyy.VRCFAllowRootFeatures");
|
||||
var featureFinderType = AccessTools.TypeByName("VF.Feature.Base.FeatureFinder");
|
||||
|
||||
if (featureFinderType == null) {
|
||||
Debug.LogError("FeatureFinder type not found");
|
||||
return;
|
||||
}
|
||||
|
||||
var method = AccessTools.Method(featureFinderType, "AllowRootFeatures");
|
||||
if (method == null) {
|
||||
Debug.LogError("AllowRootFeatures method not found");
|
||||
return;
|
||||
}
|
||||
|
||||
var prefix = typeof(VRCFAllowRootFeatures).GetMethod(nameof(Prefix), BindingFlags.Static | BindingFlags.NonPublic);
|
||||
harmony.Patch(method, prefix: new HarmonyMethod(prefix));
|
||||
}
|
||||
|
||||
private static bool Prefix(object gameObject, object avatarObject, ref bool __result) {
|
||||
__result = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue