net.dreditor.audio 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.attestation.p7m +0 -0
- package/ClearAudioSourceOnTitleScreen.cs +50 -50
- package/ClearAudioSourceOnTitleScreen.cs.meta +11 -11
- package/CreditsMusic.cs +63 -63
- package/CreditsMusic.cs.meta +11 -11
- package/CreditsMusicUnity.cs +21 -21
- package/CreditsMusicUnity.cs.meta +11 -11
- package/DREditor.Audio.asmdef +18 -18
- package/DREditor.Audio.asmdef.meta +7 -7
- package/EnvironmentSFXMananger.cs +159 -159
- package/EnvironmentSFXMananger.cs.meta +11 -11
- package/EnvironmentSFXManangerBase.cs +23 -23
- package/EnvironmentSFXManangerBase.cs.meta +11 -11
- package/Music.cs +26 -26
- package/Music.cs.meta +11 -11
- package/MusicFMOD.cs +31 -31
- package/MusicFMOD.cs.meta +11 -11
- package/MusicManager.cs +435 -435
- package/MusicManager.cs.meta +11 -11
- package/MusicManagerBase.cs +114 -114
- package/MusicManagerBase.cs.meta +11 -11
- package/MusicSaver.cs +126 -126
- package/MusicSaver.cs.meta +11 -11
- package/MusicTextHandler.cs +118 -118
- package/MusicTextHandler.cs.meta +11 -11
- package/OnVoiceLineSettingChanged.cs +68 -68
- package/OnVoiceLineSettingChanged.cs.meta +11 -11
- package/OptionVolume.cs +75 -75
- package/OptionVolume.cs.meta +11 -11
- package/PlaySelectAudioOnUIChange.cs +41 -41
- package/PlaySelectAudioOnUIChange.cs.meta +11 -11
- package/PlaySubmitSFXOnClick.cs +22 -22
- package/PlaySubmitSFXOnClick.cs.meta +11 -11
- package/Playlist.cs +80 -80
- package/Playlist.cs.meta +11 -11
- package/PlaylistEditor.cs +357 -357
- package/PlaylistEditor.cs.meta +11 -11
- package/PlaylistFMOD.cs +38 -38
- package/PlaylistFMOD.cs.meta +11 -11
- package/SFXManager.cs +347 -347
- package/SFXManager.cs.meta +11 -11
- package/SFXManagerBase.cs +37 -37
- package/SFXManagerBase.cs.meta +11 -11
- package/{Samples → Samples~}/Audio_Event_Save_Handler.prefab +57 -57
- package/{Samples → Samples~}/Audio_Event_Save_Handler.prefab.meta +7 -7
- package/{Samples → Samples~}/Credits_Music_Unity.prefab +66 -66
- package/{Samples → Samples~}/Credits_Music_Unity.prefab.meta +7 -7
- package/{Samples → Samples~}/Dialogue_Click_Sound_Player_DRE.prefab +76 -76
- package/{Samples → Samples~}/Dialogue_Click_Sound_Player_DRE.prefab.meta +7 -7
- package/{Samples → Samples~}/Environment_SFX_Manager.prefab +146 -146
- package/{Samples → Samples~}/Environment_SFX_Manager.prefab.meta +7 -7
- package/{Samples → Samples~}/Environment_SFX_Manager_Shell.prefab +96 -96
- package/{Samples → Samples~}/Environment_SFX_Manager_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Environment_Source.prefab +130 -130
- package/{Samples → Samples~}/Environment_Source.prefab.meta +7 -7
- package/{Samples → Samples~}/Music_Manager.prefab +146 -146
- package/{Samples → Samples~}/Music_Manager.prefab.meta +7 -7
- package/{Samples → Samples~}/Music_Manager_Shell.prefab +75 -75
- package/{Samples → Samples~}/Music_Manager_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Music_Source.prefab +144 -144
- package/{Samples → Samples~}/Music_Source.prefab.meta +7 -7
- package/{Samples → Samples~}/On_Voice_Line_Setting_Changed.prefab +53 -53
- package/{Samples → Samples~}/On_Voice_Line_Setting_Changed.prefab.meta +7 -7
- package/{Samples → Samples~}/Play_Select_Audio_On_UI_Change.prefab +46 -46
- package/{Samples → Samples~}/Play_Select_Audio_On_UI_Change.prefab.meta +7 -7
- package/{Samples → Samples~}/SFX_Manager.prefab +397 -397
- package/{Samples → Samples~}/SFX_Manager.prefab.meta +7 -7
- package/{Samples → Samples~}/SFX_Manager_Shell.prefab +53 -53
- package/{Samples → Samples~}/SFX_Manager_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/SFX_Source.prefab +130 -130
- package/{Samples → Samples~}/SFX_Source.prefab.meta +7 -7
- package/{Samples → Samples~}/Select_SFX_On_Setting_Changed.prefab +51 -51
- package/{Samples → Samples~}/Select_SFX_On_Setting_Changed.prefab.meta +7 -7
- package/{Samples → Samples~}/Sound_Manager.prefab +473 -473
- package/{Samples → Samples~}/Sound_Manager.prefab.meta +7 -7
- package/{Samples → Samples~}/Sound_Manager_Events.prefab +261 -261
- package/{Samples → Samples~}/Sound_Manager_Events.prefab.meta +7 -7
- package/{Samples → Samples~}/Sound_Manager_Shell.prefab +370 -370
- package/{Samples → Samples~}/Sound_Manager_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Sound_Player_DRE.prefab +47 -47
- package/{Samples → Samples~}/Sound_Player_DRE.prefab.meta +7 -7
- package/{Samples → Samples~}/StopAllAudio.asset +14 -14
- package/{Samples → Samples~}/StopAllAudio.asset.meta +8 -8
- package/{Samples → Samples~}/UI_Cancel_Source.prefab +130 -130
- package/{Samples → Samples~}/UI_Cancel_Source.prefab.meta +7 -7
- package/{Samples → Samples~}/UI_Select_Source.prefab +130 -130
- package/{Samples → Samples~}/UI_Select_Source.prefab.meta +7 -7
- package/{Samples → Samples~}/UI_Submit_Source.prefab +130 -130
- package/{Samples → Samples~}/UI_Submit_Source.prefab.meta +7 -7
- package/{Samples → Samples~}/Voice_SFX_Manager.prefab +146 -146
- package/{Samples → Samples~}/Voice_SFX_Manager.prefab.meta +7 -7
- package/{Samples → Samples~}/Voice_SFX_Manager_Shell.prefab +49 -49
- package/{Samples → Samples~}/Voice_SFX_Manager_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Voice_Source.prefab +130 -130
- package/{Samples → Samples~}/Voice_Source.prefab.meta +7 -7
- package/SelectSFXOnSceneEvent.cs +21 -21
- package/SelectSFXOnSceneEvent.cs.meta +11 -11
- package/SoundManager.cs +190 -190
- package/SoundManager.cs.meta +11 -11
- package/SoundManagerBase.cs +72 -72
- package/SoundManagerBase.cs.meta +11 -11
- package/SoundPlayerDRE.cs +26 -26
- package/SoundPlayerDRE.cs.meta +11 -11
- package/SoundPlayerDREUnity.cs +28 -28
- package/SoundPlayerDREUnity.cs.meta +11 -11
- package/SoundService.cs +10 -10
- package/SoundService.cs.meta +11 -11
- package/StopEnvAudioToTitle.cs +16 -16
- package/StopEnvAudioToTitle.cs.meta +11 -11
- package/VOManagerBase.cs +28 -28
- package/VOManagerBase.cs.meta +11 -11
- package/VoiceSFXManager.cs +104 -104
- package/VoiceSFXManager.cs.meta +11 -11
- package/package.json +41 -36
- package/package.json.meta +7 -7
- package/Samples.meta +0 -8
package/MusicTextHandler.cs
CHANGED
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.EventObjects;
|
|
3
|
-
using TMPro;
|
|
4
|
-
using UnityEngine;
|
|
5
|
-
|
|
6
|
-
namespace DREditor.Audio
|
|
7
|
-
{
|
|
8
|
-
/// <summary>
|
|
9
|
-
///
|
|
10
|
-
/// </summary>
|
|
11
|
-
[ClassHeader("")]
|
|
12
|
-
public class MusicTextHandler : MonoBehaviour
|
|
13
|
-
{
|
|
14
|
-
/// <summary>
|
|
15
|
-
///
|
|
16
|
-
/// </summary>
|
|
17
|
-
[Tooltip("")]
|
|
18
|
-
[SerializeField] protected StringWithEvent setMusicText = null;
|
|
19
|
-
|
|
20
|
-
/// <summary>
|
|
21
|
-
///
|
|
22
|
-
/// </summary>
|
|
23
|
-
[Tooltip("")]
|
|
24
|
-
[SerializeField] protected SceneEventListener ClearMusicText = null;
|
|
25
|
-
|
|
26
|
-
/// <summary>
|
|
27
|
-
///
|
|
28
|
-
/// </summary>
|
|
29
|
-
[Tooltip("")]
|
|
30
|
-
[SerializeField] protected SceneEventListener ResetMusicText = null;
|
|
31
|
-
|
|
32
|
-
/// <summary>
|
|
33
|
-
///
|
|
34
|
-
/// </summary>
|
|
35
|
-
[Tooltip("")]
|
|
36
|
-
[SerializeField] protected TMP_Text boxText = null;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/// <summary>
|
|
40
|
-
///
|
|
41
|
-
/// </summary>
|
|
42
|
-
protected virtual void Start() => AttemptSubscribeToEvents();
|
|
43
|
-
|
|
44
|
-
/// <summary>
|
|
45
|
-
///
|
|
46
|
-
/// </summary>
|
|
47
|
-
protected virtual void AttemptSubscribeToEvents()
|
|
48
|
-
{
|
|
49
|
-
if (boxText == null)
|
|
50
|
-
UnityEngine.Debug.LogWarning($"ALERT: {nameof(boxText)} has not been filled out on the MusicTextHandler, " +
|
|
51
|
-
"so it's functionality will not be used.");
|
|
52
|
-
else
|
|
53
|
-
SubscribeToEvents();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/// <summary>
|
|
57
|
-
///
|
|
58
|
-
/// </summary>
|
|
59
|
-
protected virtual void SubscribeToEvents()
|
|
60
|
-
{
|
|
61
|
-
setMusicText.AddListener(SetText);
|
|
62
|
-
|
|
63
|
-
ClearMusicText.Response.AddListener(ClearText);
|
|
64
|
-
|
|
65
|
-
ResetMusicText.Response.AddListener(ResetText);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/// <summary>
|
|
69
|
-
///
|
|
70
|
-
/// </summary>
|
|
71
|
-
protected virtual void UnsubscribeToEvents()
|
|
72
|
-
{
|
|
73
|
-
setMusicText.RemoveListener(SetText);
|
|
74
|
-
|
|
75
|
-
ClearMusicText.Response.RemoveListener(ClearText);
|
|
76
|
-
|
|
77
|
-
ResetMusicText.Response.RemoveListener(ResetText);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/// <summary>
|
|
81
|
-
///
|
|
82
|
-
/// </summary>
|
|
83
|
-
/// <param name="text"></param>
|
|
84
|
-
protected virtual void SetText(string text)
|
|
85
|
-
{
|
|
86
|
-
boxText.autoSizeTextContainer = false;
|
|
87
|
-
|
|
88
|
-
boxText.text = text;
|
|
89
|
-
|
|
90
|
-
boxText.autoSizeTextContainer = true;
|
|
91
|
-
|
|
92
|
-
boxText.ForceMeshUpdate();
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/// <summary>
|
|
96
|
-
///
|
|
97
|
-
/// </summary>
|
|
98
|
-
protected virtual void ClearText() => boxText.text = "";
|
|
99
|
-
|
|
100
|
-
/// <summary>
|
|
101
|
-
///
|
|
102
|
-
/// </summary>
|
|
103
|
-
protected virtual void ResetText()
|
|
104
|
-
{
|
|
105
|
-
boxText.autoSizeTextContainer = false;
|
|
106
|
-
|
|
107
|
-
ClearText();
|
|
108
|
-
|
|
109
|
-
boxText.autoSizeTextContainer = true;
|
|
110
|
-
|
|
111
|
-
boxText.ForceMeshUpdate();
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/// <summary>
|
|
115
|
-
///
|
|
116
|
-
/// </summary>
|
|
117
|
-
protected virtual void OnDestroy() => UnsubscribeToEvents();
|
|
118
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.EventObjects;
|
|
3
|
+
using TMPro;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
namespace DREditor.Audio
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
///
|
|
10
|
+
/// </summary>
|
|
11
|
+
[ClassHeader("")]
|
|
12
|
+
public class MusicTextHandler : MonoBehaviour
|
|
13
|
+
{
|
|
14
|
+
/// <summary>
|
|
15
|
+
///
|
|
16
|
+
/// </summary>
|
|
17
|
+
[Tooltip("")]
|
|
18
|
+
[SerializeField] protected StringWithEvent setMusicText = null;
|
|
19
|
+
|
|
20
|
+
/// <summary>
|
|
21
|
+
///
|
|
22
|
+
/// </summary>
|
|
23
|
+
[Tooltip("")]
|
|
24
|
+
[SerializeField] protected SceneEventListener ClearMusicText = null;
|
|
25
|
+
|
|
26
|
+
/// <summary>
|
|
27
|
+
///
|
|
28
|
+
/// </summary>
|
|
29
|
+
[Tooltip("")]
|
|
30
|
+
[SerializeField] protected SceneEventListener ResetMusicText = null;
|
|
31
|
+
|
|
32
|
+
/// <summary>
|
|
33
|
+
///
|
|
34
|
+
/// </summary>
|
|
35
|
+
[Tooltip("")]
|
|
36
|
+
[SerializeField] protected TMP_Text boxText = null;
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
/// <summary>
|
|
40
|
+
///
|
|
41
|
+
/// </summary>
|
|
42
|
+
protected virtual void Start() => AttemptSubscribeToEvents();
|
|
43
|
+
|
|
44
|
+
/// <summary>
|
|
45
|
+
///
|
|
46
|
+
/// </summary>
|
|
47
|
+
protected virtual void AttemptSubscribeToEvents()
|
|
48
|
+
{
|
|
49
|
+
if (boxText == null)
|
|
50
|
+
UnityEngine.Debug.LogWarning($"ALERT: {nameof(boxText)} has not been filled out on the MusicTextHandler, " +
|
|
51
|
+
"so it's functionality will not be used.");
|
|
52
|
+
else
|
|
53
|
+
SubscribeToEvents();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/// <summary>
|
|
57
|
+
///
|
|
58
|
+
/// </summary>
|
|
59
|
+
protected virtual void SubscribeToEvents()
|
|
60
|
+
{
|
|
61
|
+
setMusicText.AddListener(SetText);
|
|
62
|
+
|
|
63
|
+
ClearMusicText.Response.AddListener(ClearText);
|
|
64
|
+
|
|
65
|
+
ResetMusicText.Response.AddListener(ResetText);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/// <summary>
|
|
69
|
+
///
|
|
70
|
+
/// </summary>
|
|
71
|
+
protected virtual void UnsubscribeToEvents()
|
|
72
|
+
{
|
|
73
|
+
setMusicText.RemoveListener(SetText);
|
|
74
|
+
|
|
75
|
+
ClearMusicText.Response.RemoveListener(ClearText);
|
|
76
|
+
|
|
77
|
+
ResetMusicText.Response.RemoveListener(ResetText);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/// <summary>
|
|
81
|
+
///
|
|
82
|
+
/// </summary>
|
|
83
|
+
/// <param name="text"></param>
|
|
84
|
+
protected virtual void SetText(string text)
|
|
85
|
+
{
|
|
86
|
+
boxText.autoSizeTextContainer = false;
|
|
87
|
+
|
|
88
|
+
boxText.text = text;
|
|
89
|
+
|
|
90
|
+
boxText.autoSizeTextContainer = true;
|
|
91
|
+
|
|
92
|
+
boxText.ForceMeshUpdate();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/// <summary>
|
|
96
|
+
///
|
|
97
|
+
/// </summary>
|
|
98
|
+
protected virtual void ClearText() => boxText.text = "";
|
|
99
|
+
|
|
100
|
+
/// <summary>
|
|
101
|
+
///
|
|
102
|
+
/// </summary>
|
|
103
|
+
protected virtual void ResetText()
|
|
104
|
+
{
|
|
105
|
+
boxText.autoSizeTextContainer = false;
|
|
106
|
+
|
|
107
|
+
ClearText();
|
|
108
|
+
|
|
109
|
+
boxText.autoSizeTextContainer = true;
|
|
110
|
+
|
|
111
|
+
boxText.ForceMeshUpdate();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/// <summary>
|
|
115
|
+
///
|
|
116
|
+
/// </summary>
|
|
117
|
+
protected virtual void OnDestroy() => UnsubscribeToEvents();
|
|
118
|
+
}
|
|
119
119
|
}
|
package/MusicTextHandler.cs.meta
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: e94ebf2f965205d4b96ab1ff505ab3fd
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: e94ebf2f965205d4b96ab1ff505ab3fd
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.Services;
|
|
3
|
-
using System.Collections.Generic;
|
|
4
|
-
using UnityEngine;
|
|
5
|
-
using DREditor.EventObjects;
|
|
6
|
-
|
|
7
|
-
#if FMOD_UNITY
|
|
8
|
-
using FMODUnity;
|
|
9
|
-
#endif
|
|
10
|
-
|
|
11
|
-
namespace DREditor.Audio
|
|
12
|
-
{
|
|
13
|
-
/// <summary>
|
|
14
|
-
///
|
|
15
|
-
/// </summary>
|
|
16
|
-
[ClassHeader(nameof(SceneEventListener) +
|
|
17
|
-
"\n\n")]
|
|
18
|
-
public class OnVoiceLineSettingChanged : SceneEventListener
|
|
19
|
-
{
|
|
20
|
-
[Header("")]
|
|
21
|
-
[Divider]
|
|
22
|
-
#if FMOD_UNITY
|
|
23
|
-
/// <summary>
|
|
24
|
-
///
|
|
25
|
-
/// </summary>
|
|
26
|
-
[Tooltip("")]
|
|
27
|
-
[EventRef]
|
|
28
|
-
[SerializeField] protected string dialogueTestLine = "event:/SFX/UI/Menus/Dialogue Test";
|
|
29
|
-
|
|
30
|
-
/// <summary>
|
|
31
|
-
///
|
|
32
|
-
/// </summary>
|
|
33
|
-
[Tooltip("")]
|
|
34
|
-
[EventRef]
|
|
35
|
-
[SerializeField] protected List<string> lines = new();
|
|
36
|
-
#else
|
|
37
|
-
/// <summary>
|
|
38
|
-
///
|
|
39
|
-
/// </summary>
|
|
40
|
-
[Tooltip("")]
|
|
41
|
-
[SerializeField] protected AudioClip dialogueTestLine = null;
|
|
42
|
-
|
|
43
|
-
/// <summary>
|
|
44
|
-
///
|
|
45
|
-
/// </summary>
|
|
46
|
-
[Tooltip("")]
|
|
47
|
-
[SerializeField] protected List<AudioClip> lines = new();
|
|
48
|
-
#endif
|
|
49
|
-
|
|
50
|
-
/// <inheritdoc/>
|
|
51
|
-
public override void OnEventRaised()
|
|
52
|
-
{
|
|
53
|
-
base.OnEventRaised();
|
|
54
|
-
|
|
55
|
-
PlayVoice();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/// <summary>
|
|
59
|
-
///
|
|
60
|
-
/// </summary>
|
|
61
|
-
protected virtual void PlayVoice()
|
|
62
|
-
{
|
|
63
|
-
if (lines.Count != 0)
|
|
64
|
-
ServiceLocator.GetService<VOManagerBase>().PlayVoiceLine(lines[Random.Range(0, lines.Count - 1)]);
|
|
65
|
-
else
|
|
66
|
-
ServiceLocator.GetService<VOManagerBase>().PlayVoiceLine(dialogueTestLine);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Services;
|
|
3
|
+
using System.Collections.Generic;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
using DREditor.EventObjects;
|
|
6
|
+
|
|
7
|
+
#if FMOD_UNITY
|
|
8
|
+
using FMODUnity;
|
|
9
|
+
#endif
|
|
10
|
+
|
|
11
|
+
namespace DREditor.Audio
|
|
12
|
+
{
|
|
13
|
+
/// <summary>
|
|
14
|
+
///
|
|
15
|
+
/// </summary>
|
|
16
|
+
[ClassHeader(nameof(SceneEventListener) +
|
|
17
|
+
"\n\n")]
|
|
18
|
+
public class OnVoiceLineSettingChanged : SceneEventListener
|
|
19
|
+
{
|
|
20
|
+
[Header("")]
|
|
21
|
+
[Divider]
|
|
22
|
+
#if FMOD_UNITY
|
|
23
|
+
/// <summary>
|
|
24
|
+
///
|
|
25
|
+
/// </summary>
|
|
26
|
+
[Tooltip("")]
|
|
27
|
+
[EventRef]
|
|
28
|
+
[SerializeField] protected string dialogueTestLine = "event:/SFX/UI/Menus/Dialogue Test";
|
|
29
|
+
|
|
30
|
+
/// <summary>
|
|
31
|
+
///
|
|
32
|
+
/// </summary>
|
|
33
|
+
[Tooltip("")]
|
|
34
|
+
[EventRef]
|
|
35
|
+
[SerializeField] protected List<string> lines = new();
|
|
36
|
+
#else
|
|
37
|
+
/// <summary>
|
|
38
|
+
///
|
|
39
|
+
/// </summary>
|
|
40
|
+
[Tooltip("")]
|
|
41
|
+
[SerializeField] protected AudioClip dialogueTestLine = null;
|
|
42
|
+
|
|
43
|
+
/// <summary>
|
|
44
|
+
///
|
|
45
|
+
/// </summary>
|
|
46
|
+
[Tooltip("")]
|
|
47
|
+
[SerializeField] protected List<AudioClip> lines = new();
|
|
48
|
+
#endif
|
|
49
|
+
|
|
50
|
+
/// <inheritdoc/>
|
|
51
|
+
public override void OnEventRaised()
|
|
52
|
+
{
|
|
53
|
+
base.OnEventRaised();
|
|
54
|
+
|
|
55
|
+
PlayVoice();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/// <summary>
|
|
59
|
+
///
|
|
60
|
+
/// </summary>
|
|
61
|
+
protected virtual void PlayVoice()
|
|
62
|
+
{
|
|
63
|
+
if (lines.Count != 0)
|
|
64
|
+
ServiceLocator.GetService<VOManagerBase>().PlayVoiceLine(lines[Random.Range(0, lines.Count - 1)]);
|
|
65
|
+
else
|
|
66
|
+
ServiceLocator.GetService<VOManagerBase>().PlayVoiceLine(dialogueTestLine);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
69
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: e1e7381ce6a45b545a575bc6b47555a3
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: e1e7381ce6a45b545a575bc6b47555a3
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
package/OptionVolume.cs
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.EventObjects;
|
|
3
|
-
using DREditor.EventObjectServices;
|
|
4
|
-
#if FMOD_UNITY
|
|
5
|
-
using FMOD.Studio;
|
|
6
|
-
using FMODUnity;
|
|
7
|
-
#endif
|
|
8
|
-
using UnityEngine;
|
|
9
|
-
#if !FMOD_UNITY
|
|
10
|
-
using UnityEngine.Audio;
|
|
11
|
-
#endif
|
|
12
|
-
namespace DREditor.Audio
|
|
13
|
-
{
|
|
14
|
-
/// <summary>
|
|
15
|
-
///
|
|
16
|
-
/// </summary>
|
|
17
|
-
[ClassHeader(nameof(ValueWithEventListener<ValueWithEvent<float, FloatEvent>, float, FloatEvent>) +
|
|
18
|
-
"\n\n")]
|
|
19
|
-
public class OptionVolume : ValueWithEventListener<ValueWithEvent<float, FloatEvent>, float, FloatEvent>
|
|
20
|
-
{
|
|
21
|
-
#if FMOD_UNITY
|
|
22
|
-
/// <summary>
|
|
23
|
-
///
|
|
24
|
-
/// </summary>
|
|
25
|
-
[Tooltip("")]
|
|
26
|
-
[SerializeField] protected string masterBusString = "Bus:/Master/";
|
|
27
|
-
|
|
28
|
-
/// <summary>
|
|
29
|
-
///
|
|
30
|
-
/// </summary>
|
|
31
|
-
[Tooltip("")]
|
|
32
|
-
[SerializeField] protected string busName = "Music"; // SFX // Dialogue
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/// <summary>
|
|
36
|
-
///
|
|
37
|
-
/// </summary>
|
|
38
|
-
protected Bus fmodBus;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/// <summary>
|
|
42
|
-
///
|
|
43
|
-
/// </summary>
|
|
44
|
-
protected virtual void Start() => fmodBus = RuntimeManager.GetBus(masterBusString + busName);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
/// <inheritdoc/>
|
|
48
|
-
protected override void OnValueChanged(float updatedValue)
|
|
49
|
-
{
|
|
50
|
-
base.OnValueChanged(updatedValue);
|
|
51
|
-
|
|
52
|
-
fmodBus.setVolume(updatedValue);
|
|
53
|
-
}
|
|
54
|
-
#else
|
|
55
|
-
/// <summary>
|
|
56
|
-
///
|
|
57
|
-
/// </summary>
|
|
58
|
-
[Tooltip("")]
|
|
59
|
-
[SerializeField] protected AudioMixer mixer = null;
|
|
60
|
-
|
|
61
|
-
/// <summary>
|
|
62
|
-
///
|
|
63
|
-
/// </summary>
|
|
64
|
-
[Tooltip("")]
|
|
65
|
-
[SerializeField] protected string mixerName = "Music";
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
protected override void OnValueChanged(float updatedValue)
|
|
69
|
-
{
|
|
70
|
-
base.OnValueChanged(updatedValue);
|
|
71
|
-
|
|
72
|
-
mixer.SetFloat(mixerName, updatedValue);
|
|
73
|
-
}
|
|
74
|
-
#endif
|
|
75
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.EventObjects;
|
|
3
|
+
using DREditor.EventObjectServices;
|
|
4
|
+
#if FMOD_UNITY
|
|
5
|
+
using FMOD.Studio;
|
|
6
|
+
using FMODUnity;
|
|
7
|
+
#endif
|
|
8
|
+
using UnityEngine;
|
|
9
|
+
#if !FMOD_UNITY
|
|
10
|
+
using UnityEngine.Audio;
|
|
11
|
+
#endif
|
|
12
|
+
namespace DREditor.Audio
|
|
13
|
+
{
|
|
14
|
+
/// <summary>
|
|
15
|
+
///
|
|
16
|
+
/// </summary>
|
|
17
|
+
[ClassHeader(nameof(ValueWithEventListener<ValueWithEvent<float, FloatEvent>, float, FloatEvent>) +
|
|
18
|
+
"\n\n")]
|
|
19
|
+
public class OptionVolume : ValueWithEventListener<ValueWithEvent<float, FloatEvent>, float, FloatEvent>
|
|
20
|
+
{
|
|
21
|
+
#if FMOD_UNITY
|
|
22
|
+
/// <summary>
|
|
23
|
+
///
|
|
24
|
+
/// </summary>
|
|
25
|
+
[Tooltip("")]
|
|
26
|
+
[SerializeField] protected string masterBusString = "Bus:/Master/";
|
|
27
|
+
|
|
28
|
+
/// <summary>
|
|
29
|
+
///
|
|
30
|
+
/// </summary>
|
|
31
|
+
[Tooltip("")]
|
|
32
|
+
[SerializeField] protected string busName = "Music"; // SFX // Dialogue
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
/// <summary>
|
|
36
|
+
///
|
|
37
|
+
/// </summary>
|
|
38
|
+
protected Bus fmodBus;
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
/// <summary>
|
|
42
|
+
///
|
|
43
|
+
/// </summary>
|
|
44
|
+
protected virtual void Start() => fmodBus = RuntimeManager.GetBus(masterBusString + busName);
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
/// <inheritdoc/>
|
|
48
|
+
protected override void OnValueChanged(float updatedValue)
|
|
49
|
+
{
|
|
50
|
+
base.OnValueChanged(updatedValue);
|
|
51
|
+
|
|
52
|
+
fmodBus.setVolume(updatedValue);
|
|
53
|
+
}
|
|
54
|
+
#else
|
|
55
|
+
/// <summary>
|
|
56
|
+
///
|
|
57
|
+
/// </summary>
|
|
58
|
+
[Tooltip("")]
|
|
59
|
+
[SerializeField] protected AudioMixer mixer = null;
|
|
60
|
+
|
|
61
|
+
/// <summary>
|
|
62
|
+
///
|
|
63
|
+
/// </summary>
|
|
64
|
+
[Tooltip("")]
|
|
65
|
+
[SerializeField] protected string mixerName = "Music";
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
protected override void OnValueChanged(float updatedValue)
|
|
69
|
+
{
|
|
70
|
+
base.OnValueChanged(updatedValue);
|
|
71
|
+
|
|
72
|
+
mixer.SetFloat(mixerName, updatedValue);
|
|
73
|
+
}
|
|
74
|
+
#endif
|
|
75
|
+
}
|
|
76
76
|
}
|
package/OptionVolume.cs.meta
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 5103df9b4750ea64d846fced185ca139
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 5103df9b4750ea64d846fced185ca139
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|