forked from nikita/muzika-gromche
Replace hotfix in code with a properly rebuilt asset bundle
This commit is contained in:
parent
4e9ba0928f
commit
b0d5922c3c
|
|
@ -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
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue