Пример #1
0
    public static bool Prefix(ref UnityEngine.Object __result, string path)
    {
        CustomResource h = null;

        for (int i = 0; i < CustomResourceManager.customResources.Count; i++)
        {
            if (path.ToLowerInvariant() == CustomResourceManager.customResources[i].Path.ToLowerInvariant())
            {
                h = CustomResourceManager.customResources[i];
                break;
            }
        }
        if (h != null)
        {
            Debug.Log("Loading Custom Resource " + path);
            __result = h.LoadResource();
            return(false);
        }
        return(true);
    }
Пример #2
0
    public static bool PrefixNonGeneric(ref UnityEngine.Object __result, ResourceRequest __instance)
    {
        String         path = (string)typeof(ResourceRequest).GetField("m_Path", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(__instance);
        CustomResource h    = null;

        for (int i = 0; i < CustomResourceManager.customResources.Count; i++)
        {
            if (path.ToLowerInvariant() == CustomResourceManager.customResources[i].Path.ToLowerInvariant())
            {
                h = CustomResourceManager.customResources[i];
                break;
            }
        }
        if (h != null)
        {
            Debug.Log("Loading Custom Resource " + path);
            __result = h.LoadResource();
            return(false);
        }
        return(true);
    }