1
0
Fork 0

Replace hotfix in code with a properly rebuilt asset bundle

This commit is contained in:
ivan tkachenko 2026-01-22 19:26:49 +02:00
parent 4e9ba0928f
commit b0d5922c3c
2 changed files with 1 additions and 28 deletions

View File

@ -50,37 +50,10 @@ namespace MuzikaGromche
]; ];
Patches = [.. patchDescriptors.Select(d => Patches = [.. patchDescriptors.Select(d =>
new TilePatch(d.TileName, HotFixPrefab(d.PrefabPath, assetBundle.LoadAsset<GameObject>(d.PrefabPath))) new TilePatch(d.TileName, assetBundle.LoadAsset<GameObject>(d.PrefabPath))
)]; )];
} }
static GameObject HotFixPrefab(string PrefabPath, GameObject gameObject)
{
// beacause I can't be bothered to reassemble the asset bundle
if (PrefabPath == "Assets/LethalCompany/Mods/MuzikaGromche/DiscoBallContainerFactory.prefab")
{
void RemoveGameObject(string gameObjectPath)
{
var transform = gameObject.transform.Find(gameObjectPath);
if (transform != null)
{
UnityEngine.Object.Destroy(transform.gameObject);
}
}
RemoveGameObject("DiscoBallProp1");
RemoveGameObject("DiscoBallProp2");
var discoBall = gameObject.transform.Find("DiscoBallProp3");
if (discoBall != null)
{
var position = discoBall.position;
position.y -= 5f;
discoBall.position = position;
}
}
return gameObject;
}
internal static void Patch(Tile tile) internal static void Patch(Tile tile)
{ {
var query = from patch in Patches var query = from patch in Patches