|
@@ -3,9 +3,7 @@ using Harmony;
|
|
using System;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.IO;
|
|
-using System.Linq;
|
|
|
|
using System.Reflection;
|
|
using System.Reflection;
|
|
-using System.Text;
|
|
|
|
using UnityEngine;
|
|
using UnityEngine;
|
|
|
|
|
|
namespace ResourceRedirector
|
|
namespace ResourceRedirector
|
|
@@ -45,32 +43,30 @@ namespace ResourceRedirector
|
|
postfix = new HarmonyMethod(typeof(Hooks).GetMethod("LoadAllAssetPostHook"));
|
|
postfix = new HarmonyMethod(typeof(Hooks).GetMethod("LoadAllAssetPostHook"));
|
|
|
|
|
|
harmony.Patch(original, null, postfix);
|
|
harmony.Patch(original, null, postfix);
|
|
-
|
|
|
|
- //Singleton<Manager.Character>.Instance.chaListCtrl.LoadListInfoAll();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public static void LoadAssetPostHook(ref AssetBundleLoadAssetOperation __result, string assetBundleName, string assetName, Type type, string manifestAssetBundleName)
|
|
public static void LoadAssetPostHook(ref AssetBundleLoadAssetOperation __result, string assetBundleName, string assetName, Type type, string manifestAssetBundleName)
|
|
{
|
|
{
|
|
- //Console.WriteLine($"{assetBundleName} : {assetName} : {type.FullName} : {manifestAssetBundleName ?? ""}");
|
|
|
|
|
|
+ //BepInLogger.Log($"{assetBundleName} : {assetName} : {type.FullName} : {manifestAssetBundleName ?? ""}");
|
|
|
|
|
|
__result = ResourceRedirector.HandleAsset(assetBundleName, assetName, type, manifestAssetBundleName, ref __result);
|
|
__result = ResourceRedirector.HandleAsset(assetBundleName, assetName, type, manifestAssetBundleName, ref __result);
|
|
}
|
|
}
|
|
|
|
|
|
public static void LoadAssetBundlePostHook(string assetBundleName, bool isAsync, string manifestAssetBundleName)
|
|
public static void LoadAssetBundlePostHook(string assetBundleName, bool isAsync, string manifestAssetBundleName)
|
|
{
|
|
{
|
|
- //Console.WriteLine($"{assetBundleName} : {manifestAssetBundleName} : {isAsync}");
|
|
|
|
|
|
+ //BepInLogger.Log($"{assetBundleName} : {manifestAssetBundleName} : {isAsync}");
|
|
}
|
|
}
|
|
|
|
|
|
public static void LoadAssetAsyncPostHook(ref AssetBundleLoadAssetOperation __result, string assetBundleName, string assetName, Type type, string manifestAssetBundleName)
|
|
public static void LoadAssetAsyncPostHook(ref AssetBundleLoadAssetOperation __result, string assetBundleName, string assetName, Type type, string manifestAssetBundleName)
|
|
{
|
|
{
|
|
- //Chainloader.Log($"{assetBundleName} : {assetName} : {type.FullName} : {manifestAssetBundleName ?? ""}", true);
|
|
|
|
|
|
+ //BepInLogger.Log($"{assetBundleName} : {assetName} : {type.FullName} : {manifestAssetBundleName ?? ""}", true);
|
|
|
|
|
|
__result = ResourceRedirector.HandleAsset(assetBundleName, assetName, type, manifestAssetBundleName, ref __result);
|
|
__result = ResourceRedirector.HandleAsset(assetBundleName, assetName, type, manifestAssetBundleName, ref __result);
|
|
}
|
|
}
|
|
|
|
|
|
public static void LoadAllAssetPostHook(ref AssetBundleLoadAssetOperation __result, string assetBundleName, Type type, string manifestAssetBundleName = null)
|
|
public static void LoadAllAssetPostHook(ref AssetBundleLoadAssetOperation __result, string assetBundleName, Type type, string manifestAssetBundleName = null)
|
|
{
|
|
{
|
|
- Chainloader.Log($"{assetBundleName} : {type.FullName} : {manifestAssetBundleName ?? ""}");
|
|
|
|
|
|
+ //BepInLogger.Log($"{assetBundleName} : {type.FullName} : {manifestAssetBundleName ?? ""}");
|
|
|
|
|
|
if (assetBundleName == "sound/data/systemse/brandcall/00.unity3d" ||
|
|
if (assetBundleName == "sound/data/systemse/brandcall/00.unity3d" ||
|
|
assetBundleName == "sound/data/systemse/titlecall/00.unity3d")
|
|
assetBundleName == "sound/data/systemse/titlecall/00.unity3d")
|
|
@@ -92,32 +88,6 @@ namespace ResourceRedirector
|
|
|
|
|
|
__result = new AssetBundleLoadAssetOperationSimulation(loadedClips.ToArray());
|
|
__result = new AssetBundleLoadAssetOperationSimulation(loadedClips.ToArray());
|
|
}
|
|
}
|
|
-
|
|
|
|
- if (type == typeof(TextAsset))
|
|
|
|
- {
|
|
|
|
- string dir = Path.Combine(ResourceRedirector.EmulatedDir, assetBundleName.Replace('/', '\\').Replace(".unity3d", ""));
|
|
|
|
-
|
|
|
|
- List<UnityEngine.Object> go = new List<UnityEngine.Object>();
|
|
|
|
-
|
|
|
|
- foreach (TextAsset t in __result.GetAllAssets<TextAsset>())
|
|
|
|
- {
|
|
|
|
- string path = Path.Combine(dir, $"{t.name}.txt");
|
|
|
|
-
|
|
|
|
- //Chainloader.Log(path);
|
|
|
|
-
|
|
|
|
- if (File.Exists(path))
|
|
|
|
- {
|
|
|
|
- Chainloader.Log($"Loading emulated asset {path}");
|
|
|
|
- go.Add(AssetLoader.LoadTextAsset(path));
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- go.Add(t);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- __result = new AssetBundleLoadAssetOperationSimulation(go.ToArray());
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|