net.dreditor.audio 0.0.0-stage → 0.1.6

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.
Files changed (116) hide show
  1. package/ClearAudioSourceOnTitleScreen.cs +51 -0
  2. package/ClearAudioSourceOnTitleScreen.cs.meta +11 -0
  3. package/CreditsMusic.cs +64 -0
  4. package/CreditsMusic.cs.meta +11 -0
  5. package/CreditsMusicUnity.cs +22 -0
  6. package/CreditsMusicUnity.cs.meta +11 -0
  7. package/DREditor.Audio.asmdef +19 -0
  8. package/DREditor.Audio.asmdef.meta +7 -0
  9. package/EnvironmentSFXMananger.cs +160 -0
  10. package/EnvironmentSFXMananger.cs.meta +11 -0
  11. package/EnvironmentSFXManangerBase.cs +24 -0
  12. package/EnvironmentSFXManangerBase.cs.meta +11 -0
  13. package/Music.cs +27 -0
  14. package/Music.cs.meta +11 -0
  15. package/MusicFMOD.cs +32 -0
  16. package/MusicFMOD.cs.meta +11 -0
  17. package/MusicManager.cs +436 -0
  18. package/MusicManager.cs.meta +11 -0
  19. package/MusicManagerBase.cs +115 -0
  20. package/MusicManagerBase.cs.meta +11 -0
  21. package/MusicSaver.cs +127 -0
  22. package/MusicSaver.cs.meta +11 -0
  23. package/MusicTextHandler.cs +119 -0
  24. package/MusicTextHandler.cs.meta +11 -0
  25. package/OnVoiceLineSettingChanged.cs +69 -0
  26. package/OnVoiceLineSettingChanged.cs.meta +11 -0
  27. package/OptionVolume.cs +76 -0
  28. package/OptionVolume.cs.meta +11 -0
  29. package/PlaySelectAudioOnUIChange.cs +42 -0
  30. package/PlaySelectAudioOnUIChange.cs.meta +11 -0
  31. package/PlaySubmitSFXOnClick.cs +23 -0
  32. package/PlaySubmitSFXOnClick.cs.meta +11 -0
  33. package/Playlist.cs +81 -0
  34. package/Playlist.cs.meta +11 -0
  35. package/PlaylistEditor.cs +358 -0
  36. package/PlaylistEditor.cs.meta +11 -0
  37. package/PlaylistFMOD.cs +39 -0
  38. package/PlaylistFMOD.cs.meta +11 -0
  39. package/SFXManager.cs +348 -0
  40. package/SFXManager.cs.meta +11 -0
  41. package/SFXManagerBase.cs +38 -0
  42. package/SFXManagerBase.cs.meta +11 -0
  43. package/Samples/Audio_Event_Save_Handler.prefab +57 -0
  44. package/Samples/Audio_Event_Save_Handler.prefab.meta +7 -0
  45. package/Samples/Credits_Music_Unity.prefab +66 -0
  46. package/Samples/Credits_Music_Unity.prefab.meta +7 -0
  47. package/Samples/Dialogue_Click_Sound_Player_DRE.prefab +76 -0
  48. package/Samples/Dialogue_Click_Sound_Player_DRE.prefab.meta +7 -0
  49. package/Samples/Environment_SFX_Manager.prefab +146 -0
  50. package/Samples/Environment_SFX_Manager.prefab.meta +7 -0
  51. package/Samples/Environment_SFX_Manager_Shell.prefab +96 -0
  52. package/Samples/Environment_SFX_Manager_Shell.prefab.meta +7 -0
  53. package/Samples/Environment_Source.prefab +130 -0
  54. package/Samples/Environment_Source.prefab.meta +7 -0
  55. package/Samples/Music_Manager.prefab +146 -0
  56. package/Samples/Music_Manager.prefab.meta +7 -0
  57. package/Samples/Music_Manager_Shell.prefab +75 -0
  58. package/Samples/Music_Manager_Shell.prefab.meta +7 -0
  59. package/Samples/Music_Source.prefab +144 -0
  60. package/Samples/Music_Source.prefab.meta +7 -0
  61. package/Samples/On_Voice_Line_Setting_Changed.prefab +53 -0
  62. package/Samples/On_Voice_Line_Setting_Changed.prefab.meta +7 -0
  63. package/Samples/Play_Select_Audio_On_UI_Change.prefab +46 -0
  64. package/Samples/Play_Select_Audio_On_UI_Change.prefab.meta +7 -0
  65. package/Samples/SFX_Manager.prefab +397 -0
  66. package/Samples/SFX_Manager.prefab.meta +7 -0
  67. package/Samples/SFX_Manager_Shell.prefab +53 -0
  68. package/Samples/SFX_Manager_Shell.prefab.meta +7 -0
  69. package/Samples/SFX_Source.prefab +130 -0
  70. package/Samples/SFX_Source.prefab.meta +7 -0
  71. package/Samples/Select_SFX_On_Setting_Changed.prefab +51 -0
  72. package/Samples/Select_SFX_On_Setting_Changed.prefab.meta +7 -0
  73. package/Samples/Sound_Manager.prefab +473 -0
  74. package/Samples/Sound_Manager.prefab.meta +7 -0
  75. package/Samples/Sound_Manager_Events.prefab +261 -0
  76. package/Samples/Sound_Manager_Events.prefab.meta +7 -0
  77. package/Samples/Sound_Manager_Shell.prefab +370 -0
  78. package/Samples/Sound_Manager_Shell.prefab.meta +7 -0
  79. package/Samples/Sound_Player_DRE.prefab +47 -0
  80. package/Samples/Sound_Player_DRE.prefab.meta +7 -0
  81. package/Samples/StopAllAudio.asset +14 -0
  82. package/Samples/StopAllAudio.asset.meta +8 -0
  83. package/Samples/UI_Cancel_Source.prefab +130 -0
  84. package/Samples/UI_Cancel_Source.prefab.meta +7 -0
  85. package/Samples/UI_Select_Source.prefab +130 -0
  86. package/Samples/UI_Select_Source.prefab.meta +7 -0
  87. package/Samples/UI_Submit_Source.prefab +130 -0
  88. package/Samples/UI_Submit_Source.prefab.meta +7 -0
  89. package/Samples/Voice_SFX_Manager.prefab +146 -0
  90. package/Samples/Voice_SFX_Manager.prefab.meta +7 -0
  91. package/Samples/Voice_SFX_Manager_Shell.prefab +49 -0
  92. package/Samples/Voice_SFX_Manager_Shell.prefab.meta +7 -0
  93. package/Samples/Voice_Source.prefab +130 -0
  94. package/Samples/Voice_Source.prefab.meta +7 -0
  95. package/Samples.meta +8 -0
  96. package/SelectSFXOnSceneEvent.cs +22 -0
  97. package/SelectSFXOnSceneEvent.cs.meta +11 -0
  98. package/SoundManager.cs +191 -0
  99. package/SoundManager.cs.meta +11 -0
  100. package/SoundManagerBase.cs +73 -0
  101. package/SoundManagerBase.cs.meta +11 -0
  102. package/SoundPlayerDRE.cs +27 -0
  103. package/SoundPlayerDRE.cs.meta +11 -0
  104. package/SoundPlayerDREUnity.cs +29 -0
  105. package/SoundPlayerDREUnity.cs.meta +11 -0
  106. package/SoundService.cs +11 -0
  107. package/SoundService.cs.meta +11 -0
  108. package/StopEnvAudioToTitle.cs +17 -0
  109. package/StopEnvAudioToTitle.cs.meta +11 -0
  110. package/VOManagerBase.cs +29 -0
  111. package/VOManagerBase.cs.meta +11 -0
  112. package/VoiceSFXManager.cs +105 -0
  113. package/VoiceSFXManager.cs.meta +11 -0
  114. package/package.json +36 -6
  115. package/package.json.meta +7 -0
  116. package/README.md +0 -3
@@ -0,0 +1,358 @@
1
+ //Music Playlist script originally Author: SeleniumSoul for DREditor
2
+ // Reworked by Sweden.
3
+
4
+ #if UNITY_EDITOR
5
+
6
+ using UnityEditor;
7
+ using UnityEngine;
8
+
9
+ namespace DREditor.Audio
10
+ {
11
+ /// <summary>
12
+ ///
13
+ /// </summary>
14
+ [CustomEditor(typeof(Playlist))]
15
+ public class PlaylistEditor : UnityEditor.Editor
16
+ {
17
+ /// <summary>
18
+ ///
19
+ /// </summary>
20
+ protected Playlist playlist;
21
+
22
+ /// <summary>
23
+ ///
24
+ /// </summary>
25
+ protected SerializedProperty musicLines;
26
+
27
+
28
+ /// <summary>
29
+ ///
30
+ /// </summary>
31
+ public virtual void OnEnable()
32
+ {
33
+ playlist = (Playlist)target;
34
+
35
+ musicLines = serializedObject.FindProperty("Musics");
36
+ }
37
+
38
+ /// <inheritdoc/>
39
+ public override void OnInspectorGUI()
40
+ {
41
+ CreateForm();
42
+
43
+ SetDataDirty();
44
+ }
45
+
46
+ /// <summary>
47
+ ///
48
+ /// </summary>
49
+ protected virtual void CreateForm()
50
+ {
51
+ if (playlist.Musics.Count != 0)
52
+ CreateMusicForm();
53
+ else if (AddMusicButton())
54
+ return;
55
+ }
56
+
57
+ /// <summary>
58
+ ///
59
+ /// </summary>
60
+ protected virtual void CreateMusicForm()
61
+ {
62
+ EditorGUILayout.BeginVertical("Box");
63
+
64
+ CreateFormTitle();
65
+
66
+ DisplayAllMusicUI();
67
+
68
+ EditorGUILayout.EndVertical();
69
+ }
70
+
71
+ /// <summary>
72
+ ///
73
+ /// </summary>
74
+ protected virtual void CreateFormTitle()
75
+ {
76
+ EditorGUILayout.BeginHorizontal();
77
+
78
+ EditorGUILayout.LabelField("Soundtrack Jukebox", GetFormTitleGUIStyle());
79
+
80
+ EditorGUILayout.EndHorizontal();
81
+
82
+
83
+ EditorStyles.textArea.wordWrap = true;
84
+
85
+ EditorStyles.textField.wordWrap = true;
86
+ }
87
+
88
+ /// <summary>
89
+ ///
90
+ /// </summary>
91
+ /// <returns></returns>
92
+ protected virtual GUIStyle GetFormTitleGUIStyle()
93
+ {
94
+ return new()
95
+ {
96
+ fontSize = 25,
97
+ fontStyle = FontStyle.Bold,
98
+ alignment = TextAnchor.MiddleCenter,
99
+ wordWrap = true
100
+ };
101
+ }
102
+
103
+ /// <summary>
104
+ ///
105
+ /// </summary>
106
+ protected virtual void DisplayAllMusicUI()
107
+ {
108
+ for (int i = 0; i < musicLines.arraySize; i++)
109
+ CreateMusicInstanceGUI(i);
110
+ }
111
+
112
+ /// <summary>
113
+ ///
114
+ /// </summary>
115
+ /// <param name="i"></param>
116
+ protected virtual void CreateMusicInstanceGUI(int i)
117
+ {
118
+ EditorGUILayout.BeginVertical("Box");
119
+
120
+ EditorGUILayout.BeginHorizontal();
121
+
122
+ DisplayTrackNumberTitle(i);
123
+
124
+
125
+ EditorGUILayout.BeginVertical();
126
+
127
+ DisplayPlaylistData(i);
128
+
129
+ if (DisplayInstanceUtilityButtons(i))
130
+ return;
131
+
132
+ EditorGUILayout.EndVertical();
133
+
134
+
135
+ EditorGUILayout.EndHorizontal();
136
+
137
+ EditorGUILayout.EndVertical();
138
+ }
139
+
140
+ /// <summary>
141
+ ///
142
+ /// </summary>
143
+ /// <param name="i"></param>
144
+ protected virtual void DisplayTrackNumberTitle(int i)
145
+ {
146
+ EditorGUILayout.BeginVertical();
147
+
148
+ GUILayout.FlexibleSpace();
149
+
150
+ EditorGUILayout.LabelField(i.ToString(), GetTrackNumberGUIStyle(), GUILayout.Width(50));
151
+
152
+ GUILayout.FlexibleSpace();
153
+
154
+ EditorGUILayout.EndVertical();
155
+ }
156
+
157
+ /// <summary>
158
+ ///
159
+ /// </summary>
160
+ /// <param name="i"></param>
161
+ protected virtual void DisplayPlaylistData(int i)
162
+ {
163
+ // Display Track UI Title
164
+ playlist.Musics[i].Title = EditorGUILayout.TextField("Title", playlist.Musics[i].Title);
165
+
166
+ EvaluateAudioField(i);
167
+ }
168
+
169
+ /// <summary>
170
+ ///
171
+ /// </summary>
172
+ /// <param name="i"></param>
173
+ protected virtual void EvaluateAudioField(int i)
174
+ {
175
+ if (i < playlist.Musics.Count)
176
+ if (musicLines.arraySize > i && musicLines.GetArrayElementAtIndex(i) != null)
177
+ DisplayAudioField(i);
178
+ }
179
+
180
+ /// <summary>
181
+ ///
182
+ /// </summary>
183
+ /// <param name="i"></param>
184
+ protected virtual void DisplayAudioField(int i)
185
+ {
186
+ var sfxListProperty = musicLines.GetArrayElementAtIndex(i).FindPropertyRelative("BGM");
187
+
188
+ EditorGUIUtility.labelWidth = 1;
189
+
190
+ EditorGUILayout.PropertyField(sfxListProperty, new GUIContent(""), GUILayout.MinWidth(270));
191
+ }
192
+
193
+ /// <summary>
194
+ ///
195
+ /// </summary>
196
+ /// <param name="i"></param>
197
+ /// <returns></returns>
198
+ protected virtual bool DisplayInstanceUtilityButtons(int i)
199
+ {
200
+ EditorGUILayout.BeginHorizontal();
201
+
202
+ bool utilityButtonClicked =
203
+ RemoveMusicInstanceButton(i) ||
204
+ MoveUpButton(i) ||
205
+ MoveDownButton(i) ||
206
+ InsertMusicInstanceButton(i);
207
+
208
+ EditorGUILayout.EndHorizontal();
209
+
210
+ return utilityButtonClicked;
211
+ }
212
+
213
+ /// <summary>
214
+ ///
215
+ /// </summary>
216
+ /// <param name="i"></param>
217
+ /// <returns></returns>
218
+ protected virtual bool RemoveMusicInstanceButton(int i)
219
+ {
220
+ if (GUILayout.Button("-"))
221
+ {
222
+ playlist.Musics.Remove(playlist.Musics[i]);
223
+
224
+ musicLines.serializedObject.Update();
225
+
226
+ return true;
227
+ }
228
+ else
229
+ return false;
230
+ }
231
+
232
+ /// <summary>
233
+ ///
234
+ /// </summary>
235
+ /// <param name="i"></param>
236
+ /// <returns></returns>
237
+ protected virtual bool MoveUpButton(int i)
238
+ {
239
+ if (i > 0)
240
+ {
241
+ GUI.enabled = true;
242
+
243
+ if (GUILayout.Button("ʌ") && i > 0)
244
+ {
245
+ (playlist.Musics[i], playlist.Musics[i - 1]) = (playlist.Musics[i - 1], playlist.Musics[i]);
246
+
247
+ musicLines.serializedObject.Update();
248
+
249
+ return true;
250
+ }
251
+ }
252
+ else
253
+ {
254
+ GUI.enabled = false;
255
+
256
+ GUILayout.Button("ʌ");
257
+ }
258
+
259
+ GUI.enabled = true;
260
+
261
+ return false;
262
+ }
263
+
264
+ /// <summary>
265
+ ///
266
+ /// </summary>
267
+ /// <param name="i"></param>
268
+ /// <returns></returns>
269
+ protected virtual bool MoveDownButton(int i)
270
+ {
271
+ if (i < playlist.Musics.Count - 1)
272
+ {
273
+ GUI.enabled = true;
274
+
275
+ if (GUILayout.Button("v"))
276
+ {
277
+ (playlist.Musics[i], playlist.Musics[i + 1]) = (playlist.Musics[i + 1], playlist.Musics[i]);
278
+
279
+ musicLines.serializedObject.Update();
280
+
281
+ return true;
282
+ }
283
+ }
284
+ else
285
+ {
286
+ GUI.enabled = false;
287
+
288
+ GUILayout.Button("v");
289
+ }
290
+
291
+ GUI.enabled = true;
292
+
293
+ return false;
294
+ }
295
+
296
+ /// <summary>
297
+ ///
298
+ /// </summary>
299
+ /// <returns></returns>
300
+ protected virtual GUIStyle GetTrackNumberGUIStyle()
301
+ {
302
+ return new()
303
+ {
304
+ fontSize = 25,
305
+ fontStyle = FontStyle.Bold,
306
+ alignment = TextAnchor.MiddleCenter
307
+ };
308
+ }
309
+
310
+ /// <summary>
311
+ ///
312
+ /// </summary>
313
+ /// <param name="i"></param>
314
+ /// <returns></returns>
315
+ protected virtual bool InsertMusicInstanceButton(int i)
316
+ {
317
+ if (GUILayout.Button("+"))
318
+ {
319
+ playlist.Musics.Insert(i + 1, new Music());
320
+
321
+ musicLines.serializedObject.Update();
322
+
323
+ return true;
324
+ }
325
+ else
326
+ return false;
327
+ }
328
+
329
+ /// <summary>
330
+ ///
331
+ /// </summary>
332
+ /// <returns></returns>
333
+ protected virtual bool AddMusicButton()
334
+ {
335
+ if (GUILayout.Button("Add Music"))
336
+ {
337
+ playlist.Musics.Add(new Music());
338
+
339
+ musicLines.serializedObject.Update();
340
+
341
+ return true;
342
+ }
343
+ else
344
+ return false;
345
+ }
346
+
347
+ /// <summary>
348
+ ///
349
+ /// </summary>
350
+ protected virtual void SetDataDirty()
351
+ {
352
+ EditorUtility.SetDirty(playlist);
353
+
354
+ musicLines.serializedObject.ApplyModifiedProperties();
355
+ }
356
+ }
357
+ }
358
+ #endif
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: bc084a9d56856f3419d11026d5f8cccd
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,39 @@
1
+ //DRPlaylist script originally Author: SeleniumSoul for DREditor
2
+ // Edited by Sweden for FMOD Usage.
3
+ #if FMOD_UNITY
4
+ using System.Collections.Generic;
5
+ using UnityEngine;
6
+
7
+ namespace DREditor.Audio
8
+ {
9
+ /// <summary>
10
+ ///
11
+ /// </summary>
12
+ [System.Serializable]
13
+ [CreateAssetMenu(menuName = "DREditor/Audio/Music Playlist FMOD", fileName = "New Music Playlist")]
14
+ public class PlaylistFMOD : ScriptableObject
15
+ {
16
+ /// <summary>
17
+ ///
18
+ /// </summary>
19
+ public List<MusicFMOD> Musics = new();
20
+
21
+
22
+ /// <summary>
23
+ ///
24
+ /// </summary>
25
+ /// <param name="clip"></param>
26
+ /// <returns></returns>
27
+ public virtual string GetTitleFromClip(string clip)
28
+ {
29
+ foreach (MusicFMOD music in Musics)
30
+ if (music.BGM == clip)
31
+ return music.Title;
32
+
33
+ UnityEngine.Debug.Log("REPORT: Couldn't find Title: " + clip);
34
+
35
+ return null;
36
+ }
37
+ }
38
+ }
39
+ #endif
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 4b1f80ae0c459644abf2f681cb3288a3
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: