generated from Not-Enough-Photons/bonelab_template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
AssetManager.cs
35 lines (30 loc) · 1.11 KB
/
AssetManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using AudioImportLib;
using MelonLoader.Utils;
using UnityEngine;
namespace BoneSnap
{
internal static class AssetManager
{
private static readonly string UserDataPath = MelonEnvironment.UserDataDirectory;
private static readonly string ModStoragePath = $"{UserDataPath}/BoneSnap";
private static readonly string AudioPath = $"{ModStoragePath}/Audio";
public static AudioClip? CaptureTimerAudio;
public static AudioClip? CaptureCompleteAudio;
public static AudioClip? CaptureStartAudio;
private static void LoadAudio()
{
CaptureStartAudio = API.LoadAudioClip($"{AudioPath}/capture_start.wav", true);
CaptureCompleteAudio = API.LoadAudioClip($"{AudioPath}/capture_complete.wav", true);
CaptureTimerAudio = API.LoadAudioClip($"{AudioPath}/capture_timer.wav", true);
}
private static void CreateDirectories()
{
Directory.CreateDirectory(AudioPath);
}
public static void Initialize()
{
CreateDirectories();
LoadAudio();
}
}
}