Files

20 lines
586 B
C#
Raw Permalink Normal View History

2024-01-20 20:00:35 +11:00
using System.Collections.Generic;
using HarmonyLib;
using Kitchen;
using UnityEngine;
namespace Pets.Patches
{
[HarmonyPatch(typeof(LocalViewRouter), "GetPrefab")]
public class LocalViewRouter_Patch
{
public static Dictionary<ViewType, GameObject> registeredPetViews = new();
static bool Prefix(LocalViewRouter __instance, ViewType view_type, ref GameObject __result)
{
if (!registeredPetViews.TryGetValue(view_type, out GameObject petPrefab)) return true;
__result = petPrefab;
return false;
}
}
}