fix vrcfallowrootfeatures
This commit is contained in:
parent
f514f8f9c3
commit
391a0b307a
2 changed files with 13 additions and 8 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 9e181fe0cfb2c3640b792ebaad469625
|
guid: 007a619efa189a0439e5dbed9693f9e1
|
||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
|
|
|
||||||
|
|
@ -4,18 +4,22 @@ using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
[InitializeOnLoad]
|
[InitializeOnLoad]
|
||||||
public static class VRCFAllowRootFeatures {
|
public static class VRCFAllowRootFeatures
|
||||||
static VRCFAllowRootFeatures() {
|
{
|
||||||
|
static VRCFAllowRootFeatures()
|
||||||
|
{
|
||||||
var harmony = new Harmony("gay.lilyy.VRCFAllowRootFeatures");
|
var harmony = new Harmony("gay.lilyy.VRCFAllowRootFeatures");
|
||||||
var featureFinderType = AccessTools.TypeByName("VF.Feature.Base.FeatureFinder");
|
var avatarHookType = AccessTools.TypeByName("VF.Hooks.VRCFuryAvatarHook");
|
||||||
|
|
||||||
if (featureFinderType == null) {
|
if (avatarHookType == null)
|
||||||
|
{
|
||||||
Debug.LogError("FeatureFinder type not found");
|
Debug.LogError("FeatureFinder type not found");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var method = AccessTools.Method(featureFinderType, "AllowRootFeatures");
|
var method = AccessTools.Method(avatarHookType, "AllowRootFeatures");
|
||||||
if (method == null) {
|
if (method == null)
|
||||||
|
{
|
||||||
Debug.LogError("AllowRootFeatures method not found");
|
Debug.LogError("AllowRootFeatures method not found");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -24,7 +28,8 @@ public static class VRCFAllowRootFeatures {
|
||||||
harmony.Patch(method, prefix: new HarmonyMethod(prefix));
|
harmony.Patch(method, prefix: new HarmonyMethod(prefix));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool Prefix(object gameObject, object avatarObject, ref bool __result) {
|
private static bool Prefix(object gameObject, ref bool __result)
|
||||||
|
{
|
||||||
__result = true;
|
__result = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue