Essentielle Ordner, Prefabs, Skriptgerüst für die Audio Planung erstellt, sowie in dem SFX Manager den Skript von meinem anderen Projekt Derma Dread gezogen.

This commit is contained in:
Zinziel
2025-12-15 11:22:36 +01:00
parent 98ad8ae728
commit 2fa4f961b0
11 changed files with 238 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 32c8db53a40c3014dbfdf6a31fef4716
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
using UnityEngine;
// Written by Lilia Schwab
public class MusicManager : MonoBehaviour
{
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: e55f1b009693422419012dc1002a0ddf

View File

@@ -0,0 +1,30 @@
using UnityEngine;
// Written by Lilia Schwab
public class SFXManager : MonoBehaviour
{
public static SFXManager instance;
[SerializeField] private AudioSource sFXObject;
private void Awake() {
if (instance == null) {
instance = this;
}
}
// Muss noch schauen, wie ich das f<>r das jeweilige Vieh seine seperaten Sounds einstelle und nicht universal
public void PlaySFXClip(AudioClip clip, Transform spawnTransform, float volume) {
AudioSource audioSource = Instantiate(sFXObject, spawnTransform.position, Quaternion.identity);
audioSource.clip = clip;
audioSource.volume = volume;
audioSource.Play();
float clipLength = audioSource.clip.length;
Destroy(audioSource, clipLength);
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 48370e214ee4193489b199ffc4cf0a77