Skip to content

Commit dc85ff4

Browse files
authored
feat: settings (#22)
1 parent 9dc82bd commit dc85ff4

File tree

91 files changed

+12821
-543
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+12821
-543
lines changed

Assets/Audio/AudioManager.cs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
using FMOD.Studio;
22
using FMODUnity;
3+
using System;
34
using UnityEngine;
45
using UnityEngine.SceneManagement;
56

67
namespace Audio {
78
public class AudioManager : ScriptableObject {
8-
99
[SerializeField] private EventReference _ambienceEvent;
1010
private EventInstance _ambienceAudio;
1111
private PARAMETER_ID _ambienceSceneParameter;
12-
private bool _ambienceInitialized = false;
12+
private bool _ambienceInitialized;
13+
14+
private void OnEnable() {
15+
_ambienceInitialized = false;
16+
#if UNITY_EDITOR
17+
if (!Application.isPlaying) {
18+
return;
19+
}
20+
#endif
1321

14-
private void Awake() {
1522
if (!_ambienceEvent.IsNull) {
1623
_ambienceAudio = RuntimeManager.CreateInstance(_ambienceEvent);
1724
_ambienceAudio.getDescription(out var description);
@@ -21,18 +28,23 @@ private void Awake() {
2128
}
2229
}
2330

31+
private void OnDisable() {
32+
if (_ambienceInitialized) {
33+
_ambienceAudio.release();
34+
}
35+
}
36+
2437
public void PlayAmbience() {
2538
if (_ambienceInitialized) {
26-
_ambienceAudio.setParameterByID (
39+
_ambienceAudio.setParameterByID(
2740
_ambienceSceneParameter,
2841
SceneManager.GetActiveScene().buildIndex
2942
);
30-
_ambienceAudio.getPlaybackState (out var state);
43+
_ambienceAudio.getPlaybackState(out var state);
3144
if (state == PLAYBACK_STATE.STOPPED) {
3245
_ambienceAudio.start();
3346
}
3447
}
3548
}
36-
3749
}
3850
}

Assets/Environment/Materials/BoxSDF.mat

Lines changed: 87 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Scenes/Menu/Office/LightingData.asset.meta renamed to Assets/Environment/Materials/BoxSDF.mat.meta

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Environment/Materials/OfficePalette.mat

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Environment/Materials/OfficePaletteUV.mat

Lines changed: 184 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Environment/Materials/OfficePaletteUV.mat.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Environment/Materials/Palette.mat

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:d9c66561af03445f8272958624bca84798c364b23acc87e3b3a311b4b6e9fe7b
3-
size 25100
2+
oid sha256:81d635dd10a1c224256fffd57318f6fa23c74c1252df7737522016eee7c9d160
3+
size 114460

0 commit comments

Comments
 (0)