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
|
||||
guid: 9e181fe0cfb2c3640b792ebaad469625
|
||||
guid: 007a619efa189a0439e5dbed9693f9e1
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
|
|
|
|||
|
|
@ -4,18 +4,22 @@ using UnityEditor;
|
|||
using UnityEngine;
|
||||
|
||||
[InitializeOnLoad]
|
||||
public static class VRCFAllowRootFeatures {
|
||||
static VRCFAllowRootFeatures() {
|
||||
public static class VRCFAllowRootFeatures
|
||||
{
|
||||
static 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");
|
||||
return;
|
||||
}
|
||||
|
||||
var method = AccessTools.Method(featureFinderType, "AllowRootFeatures");
|
||||
if (method == null) {
|
||||
var method = AccessTools.Method(avatarHookType, "AllowRootFeatures");
|
||||
if (method == null)
|
||||
{
|
||||
Debug.LogError("AllowRootFeatures method not found");
|
||||
return;
|
||||
}
|
||||
|
|
@ -24,7 +28,8 @@ public static class VRCFAllowRootFeatures {
|
|||
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;
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue