Compare commits
41 Commits
c6118862d4
...
d6a2bf21b1
Author | SHA1 | Date |
---|---|---|
|
d6a2bf21b1 | |
|
730f125d62 | |
|
8e065d3e51 | |
|
2a33457661 | |
|
0fbf0b04f4 | |
|
0c5d4f7158 | |
|
9e066372c5 | |
|
ca977625db | |
|
7d1cac6e2e | |
|
2229fa3545 | |
|
118eecbb59 | |
|
b8824dbbfb | |
|
3e751c0d8d | |
|
601ecf8887 | |
|
d13c617895 | |
|
e1f19b3919 | |
|
ba0162b3e1 | |
|
ed8804b7a7 | |
|
9be9eaaf80 | |
|
0683a18491 | |
|
6204888453 | |
|
c15637b347 | |
|
42c1f29a16 | |
|
8a193fa408 | |
|
4ee20adea7 | |
|
2df7d28d43 | |
|
43d1565dbe | |
|
f5dab20d67 | |
|
38cfb5f5e7 | |
|
b86c50a848 | |
|
694bc61dae | |
|
909efa720f | |
|
a8761bf679 | |
|
ad77530b6d | |
|
34d8da1562 | |
|
b73c7ee3cb | |
|
0d4f180a37 | |
|
829c44e347 | |
|
b15e93ac34 | |
|
f158e7728c | |
|
2b42899779 |
Binary file not shown.
Binary file not shown.
BIN
Assets/DeployDestroyLoop.mp3 (Stored with Git LFS)
BIN
Assets/DeployDestroyLoop.mp3 (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
BIN
Assets/DeployDestroyStart.mp3 (Stored with Git LFS)
BIN
Assets/DeployDestroyStart.mp3 (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
BIN
Assets/DurochkaLoop.mp3 (Stored with Git LFS)
BIN
Assets/DurochkaLoop.mp3 (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
BIN
Assets/DurochkaStart.mp3 (Stored with Git LFS)
BIN
Assets/DurochkaStart.mp3 (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Assets/GorgorodLoop.mp3 (Stored with Git LFS)
BIN
Assets/GorgorodLoop.mp3 (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
BIN
Assets/GorgorodStart.mp3 (Stored with Git LFS)
BIN
Assets/GorgorodStart.mp3 (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Assets/MoyaZhittyaLoop.mp3 (Stored with Git LFS)
BIN
Assets/MoyaZhittyaLoop.mp3 (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
BIN
Assets/MoyaZhittyaStart.mp3 (Stored with Git LFS)
BIN
Assets/MoyaZhittyaStart.mp3 (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
BIN
Assets/MuzikaGromcheLoop.mp3 (Stored with Git LFS)
BIN
Assets/MuzikaGromcheLoop.mp3 (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
BIN
Assets/MuzikaGromcheStart.mp3 (Stored with Git LFS)
BIN
Assets/MuzikaGromcheStart.mp3 (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Assets/VseVZaleLoop.mp3 (Stored with Git LFS)
BIN
Assets/VseVZaleLoop.mp3 (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
BIN
Assets/VseVZaleStart.mp3 (Stored with Git LFS)
BIN
Assets/VseVZaleStart.mp3 (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -2,9 +2,13 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<!-- Copy this file to MuzikaGromche.props.user and uncomment one of two paths below: -->
|
||||
|
||||
<!-- On Linux: -->
|
||||
<!-- <LethalCompanyDir>$(HOME)/.local/share/Steam/steamapps/common/Lethal Company/</LethalCompanyDir> -->
|
||||
<!-- <WavExportDir>\home\ratijas\Music\SFX\Export</WavExportDir> -->
|
||||
|
||||
<!-- On Windows: -->
|
||||
<!-- <LethalCompanyDir>C:/Program Files (x86)/Steam/steamapps/common/Lethal Company/</LethalCompanyDir> -->
|
||||
<!-- <WavExportDir>D:\Code\MuzikaGromcheAudio\Export</WavExportDir> -->
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
using DunGen;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MuzikaGromche
|
||||
{
|
||||
public class DiscoBallManager : MonoBehaviour
|
||||
{
|
||||
// A struct holding a disco ball container object and the name of a tile for which it was designed.
|
||||
public readonly record struct Data(string TileName, GameObject DiscoBallContainer)
|
||||
{
|
||||
// We are specifically looking for cloned tiles, not the original prototypes.
|
||||
public readonly string TileCloneName = $"{TileName}(Clone)";
|
||||
}
|
||||
|
||||
public static readonly List<Data> Containers = [];
|
||||
private static readonly List<GameObject> InstantiatedContainers = [];
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
string assetdir = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "muzikagromche");
|
||||
var bundle = AssetBundle.LoadFromFile(assetdir);
|
||||
|
||||
foreach ((string prefabPath, string tileName) in new[] {
|
||||
("Assets/LethalCompany/Mods/MuzikaGromche/DiscoBallContainerManor.prefab", "ManorStartRoomSmall"),
|
||||
("Assets/LethalCompany/Mods/MuzikaGromche/DiscoBallContainerFactory.prefab", "StartRoom"),
|
||||
("Assets/LethalCompany/Mods/MuzikaGromche/DiscoBallContainerMineShaft.prefab", "MineshaftStartTile"),
|
||||
("Assets/LethalCompany/Mods/MuzikaGromche/DiscoBallContainerLargeForkTileB.prefab", "LargeForkTileB"),
|
||||
("Assets/LethalCompany/Mods/MuzikaGromche/DiscoBallContainerBirthdayRoomTile.prefab", "BirthdayRoomTile"),
|
||||
})
|
||||
{
|
||||
var container = bundle.LoadAsset<GameObject>(prefabPath);
|
||||
Containers.Add(new(tileName, container));
|
||||
}
|
||||
}
|
||||
|
||||
public static void Enable()
|
||||
{
|
||||
// Just in case
|
||||
Disable();
|
||||
|
||||
var query = from tile in Resources.FindObjectsOfTypeAll<Tile>()
|
||||
join container in Containers
|
||||
on tile.gameObject.name equals container.TileCloneName
|
||||
select (tile, container);
|
||||
|
||||
foreach (var (tile, container) in query)
|
||||
{
|
||||
Enable(tile, container);
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly string[] animatorNames = [
|
||||
"DiscoBallProp/AnimContainer",
|
||||
"DiscoBallProp1/AnimContainer",
|
||||
"DiscoBallProp2/AnimContainer",
|
||||
"DiscoBallProp3/AnimContainer",
|
||||
"DiscoBallProp4/AnimContainer",
|
||||
"DiscoBallProp5/AnimContainer",
|
||||
];
|
||||
|
||||
private static void Enable(Tile tile, Data container)
|
||||
{
|
||||
Debug.Log($"{nameof(MuzikaGromche)} {nameof(DiscoBallManager)} Enabling at '{tile.gameObject.name}'");
|
||||
var discoBall = Instantiate(container.DiscoBallContainer, tile.transform);
|
||||
InstantiatedContainers.Add(discoBall);
|
||||
|
||||
foreach (var animatorName in animatorNames)
|
||||
{
|
||||
if (discoBall.transform.Find(animatorName)?.gameObject is GameObject animator)
|
||||
{
|
||||
animator.GetComponent<Animator>().SetBool("on", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Disable()
|
||||
{
|
||||
foreach (var discoBall in InstantiatedContainers)
|
||||
{
|
||||
Debug.Log($"{nameof(MuzikaGromche)} {nameof(DiscoBallManager)}: Disabling {discoBall.name}");
|
||||
Destroy(discoBall);
|
||||
}
|
||||
InstantiatedContainers.Clear();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<AssemblyName>MuzikaGromche</AssemblyName>
|
||||
<Description>Opa che tut u nas</Description>
|
||||
<Version>13.37.6</Version>
|
||||
<Version>13.37.420</Version>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
@ -49,6 +49,7 @@
|
|||
<PackagedResources Include="$(SolutionDir)README.md" />
|
||||
<PackagedResources Include="$(SolutionDir)icon.png" />
|
||||
<PackagedResources Include="$(SolutionDir)manifest.json" />
|
||||
<PackagedResources Include="$(ProjectDir)UnityAssets\muzikagromche" />
|
||||
<PackagedResources Include="$(TargetDir)MuzikaGromche.dll" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -73,4 +74,18 @@
|
|||
DestinationFolder="$(SolutionDir)dist\"
|
||||
/>
|
||||
</Target>
|
||||
|
||||
<!--
|
||||
Usage:
|
||||
Set WavExportDir in props.user file.
|
||||
Run
|
||||
> dotnet msbuild /t:wav2ogg /p:TrackName=GodMode
|
||||
-->
|
||||
<Target Name="wav2ogg">
|
||||
<ItemGroup>
|
||||
<TrackNames Include="$(TrackName)Start" />
|
||||
<TrackNames Include="$(TrackName)Loop" />
|
||||
</ItemGroup>
|
||||
<Exec Command="ffmpeg -bitexact -y -i $(WavExportDir)%(TrackNames.Identity).wav $(SolutionDir)Assets\%(TrackNames.Identity).ogg"/>
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -1,12 +1,13 @@
|
|||
{
|
||||
"name": "MuzikaGromche",
|
||||
"version_number": "13.37.6",
|
||||
"version_number": "13.37.420",
|
||||
"author": "Oflor",
|
||||
"description": "Glaza zakryvaj",
|
||||
"website_url": "https://git.vilunov.me/nikita/muzika-gromche",
|
||||
"dependencies": [
|
||||
"BepInEx-BepInExPack-5.4.2100",
|
||||
"Sigurd-CSync-5.0.1",
|
||||
"ainavt.lc.lethalconfig-1.4.6"
|
||||
"ainavt.lc.lethalconfig-1.4.6",
|
||||
"WaterGun-V70PoweredLights_Fix-1.0.0"
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue