Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions HenryMod/Modules/Materials.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ internal static class Materials
public static Material LoadMaterial(this AssetBundle assetBundle, string materialName) => CreateHopooMaterialFromBundle(assetBundle, materialName);
public static Material CreateHopooMaterialFromBundle(this AssetBundle assetBundle, string materialName)
{
materialName = materialName.Replace(" (Instance)", "");
Material tempMat = cachedMaterials.Find(mat =>
{
materialName.Replace(" (Instance)", "");
return mat.name.Contains(materialName);
string cachedName = mat.name.Replace(" (Instance)", "");
return cachedName == materialName;
});
if (tempMat) {
Log.Debug($"{tempMat.name} has already been loaded. returning cached");
Expand Down