Merge branch 'feature/audio-integration' into 'main'

Feature/audio integration

Closes #56

See merge request kernel-panic/revival!32
This commit is contained in:
Cinder Foster-Smith 2021-03-05 15:48:36 +00:00
commit 154d809540
216 changed files with 5204 additions and 14652 deletions

8
game/Assets/Audio.meta Normal file
View File

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

View File

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

BIN
game/Assets/Audio/VO/PA_BOOST.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,36 @@
fileFormatVersion: 2
guid: c1690bc635976f14a80c9116e50283d3
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 0
quality: 1
conversionMode: 0
platformSettingOverrides:
4:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 3
quality: 1
conversionMode: 0
7:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

BIN
game/Assets/Audio/VO/PA_DASH.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,36 @@
fileFormatVersion: 2
guid: 898202449aaa9df418384303a39eb756
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 0
quality: 1
conversionMode: 0
platformSettingOverrides:
4:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 3
quality: 1
conversionMode: 0
7:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

BIN
game/Assets/Audio/VO/SD_ALPHA_COMPLETE.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,36 @@
fileFormatVersion: 2
guid: 5b670453e5d24a74fa2a7629c605eb4a
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 0
quality: 1
conversionMode: 0
platformSettingOverrides:
4:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 3
quality: 1
conversionMode: 0
7:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

BIN
game/Assets/Audio/VO/SD_BOOST_0.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,36 @@
fileFormatVersion: 2
guid: 97f8971bce7d3db4a8feb27ac3acbd16
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 0
quality: 1
conversionMode: 0
platformSettingOverrides:
4:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 3
quality: 1
conversionMode: 0
7:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

BIN
game/Assets/Audio/VO/SD_DASH_0.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,36 @@
fileFormatVersion: 2
guid: c4eaf5514fb966a4da64f3b185c48290
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 0
quality: 1
conversionMode: 0
platformSettingOverrides:
4:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 3
quality: 1
conversionMode: 0
7:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

BIN
game/Assets/Audio/VO/SD_DASH_1.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,36 @@
fileFormatVersion: 2
guid: ce62d7fa6c5c95344985c97227673466
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 0
quality: 1
conversionMode: 0
platformSettingOverrides:
4:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 3
quality: 1
conversionMode: 0
7:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

BIN
game/Assets/Audio/VO/SD_DASH_2.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,36 @@
fileFormatVersion: 2
guid: c8b2973b16f038b44b3e76a6b24d4c15
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 0
quality: 1
conversionMode: 0
platformSettingOverrides:
4:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 3
quality: 1
conversionMode: 0
7:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

BIN
game/Assets/Audio/VO/SD_DASH_3.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,36 @@
fileFormatVersion: 2
guid: 3d9cd987c0f205b469190d703335074b
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 0
quality: 1
conversionMode: 0
platformSettingOverrides:
4:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 3
quality: 1
conversionMode: 0
7:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

BIN
game/Assets/Audio/VO/SD_FIND_WA_0.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,36 @@
fileFormatVersion: 2
guid: 8f0e6b879fc37e44ea95b69cffff2273
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 0
quality: 1
conversionMode: 0
platformSettingOverrides:
4:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 3
quality: 1
conversionMode: 0
7:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

BIN
game/Assets/Audio/VO/SD_LANDED.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,36 @@
fileFormatVersion: 2
guid: 8d98cd34796bee348859b1ef6e6201d1
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 0
quality: 1
conversionMode: 0
platformSettingOverrides:
4:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 3
quality: 1
conversionMode: 0
7:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

BIN
game/Assets/Audio/VO/WA_0.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,36 @@
fileFormatVersion: 2
guid: 946d08c7b7bf78b4ba7ca01fac1b5970
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 0
quality: 1
conversionMode: 0
platformSettingOverrides:
4:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 3
quality: 1
conversionMode: 0
7:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@ -13,4 +13,16 @@ MonoBehaviour:
m_Name: Dialogue Settings
m_EditorClassIdentifier:
_hideAfter: 5
_fmodKeyPrefix: event:/Character/
_radioDialogueKey: event:/VO/Radio Dialogue Line
_dialogueClips:
- {fileID: 8300000, guid: c1690bc635976f14a80c9116e50283d3, type: 3}
- {fileID: 8300000, guid: 898202449aaa9df418384303a39eb756, type: 3}
- {fileID: 8300000, guid: 5b670453e5d24a74fa2a7629c605eb4a, type: 3}
- {fileID: 8300000, guid: 97f8971bce7d3db4a8feb27ac3acbd16, type: 3}
- {fileID: 8300000, guid: c4eaf5514fb966a4da64f3b185c48290, type: 3}
- {fileID: 8300000, guid: ce62d7fa6c5c95344985c97227673466, type: 3}
- {fileID: 8300000, guid: c8b2973b16f038b44b3e76a6b24d4c15, type: 3}
- {fileID: 8300000, guid: 3d9cd987c0f205b469190d703335074b, type: 3}
- {fileID: 8300000, guid: 8f0e6b879fc37e44ea95b69cffff2273, type: 3}
- {fileID: 8300000, guid: 8d98cd34796bee348859b1ef6e6201d1, type: 3}
- {fileID: 8300000, guid: 946d08c7b7bf78b4ba7ca01fac1b5970, type: 3}

View File

@ -542,12 +542,8 @@ MonoBehaviour:
MasterBanks:
- Master
Banks:
- Dialogue_CN
- Dialogue_EN
- Dialogue_JP
- Music
- SFX
- Vehicles
- VO
BanksToLoad: []
LiveUpdatePort: 9264

View File

@ -1,76 +1,109 @@
fileFormatVersion: 2
guid: 8514ea8d6deab804895ec1cab6902681
timeCreated: 1429083373
licenseType: Store
PluginImporter:
serializedVersion: 1
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
Android:
enabled: 0
settings:
CPU: AnyCPU
Any:
enabled: 0
settings: {}
Editor:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
Linux:
- first:
: Linux
second:
enabled: 1
settings:
CPU: None
Linux64:
enabled: 1
settings:
CPU: x86_64
LinuxUniversal:
- first:
: LinuxUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
OSXIntel:
- first:
: OSXIntel
second:
enabled: 1
settings:
CPU: None
OSXIntel64:
- first:
: OSXIntel64
second:
enabled: 1
settings:
CPU: AnyCPU
OSXUniversal:
enabled: 1
settings:
CPU: AnyCPU
SamsungTV:
- first:
: SamsungTV
second:
enabled: 0
settings:
STV_MODEL: STANDARD_13
WP8:
- first:
: WP8
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
Win:
- first:
Android: Android
second:
enabled: 0
settings:
CPU: None
Win64:
CPU: AnyCPU
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: AnyCPU
WindowsStoreApps:
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
SDK: AnySDK
iOS:
- first:
iPhone: iOS
second:
enabled: 0
settings:
CompileFlags:

View File

@ -2472,19 +2472,19 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4676633831318799747, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.w
value: 0.9898497
value: 0.9898496
objectReference: {fileID: 0}
- target: {fileID: 4676633831318799747, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.x
value: 0.14211854
value: 0.1421185
objectReference: {fileID: 0}
- target: {fileID: 4676633831318799747, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.y
value: 1.1133053e-25
value: 0.000000014749911
objectReference: {fileID: 0}
- target: {fileID: 4676633831318799747, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.z
value: -4.9127595e-24
value: -0.0000000021177309
objectReference: {fileID: 0}
- target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.x
@ -2504,15 +2504,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.x
value: 0.14197029
value: 0.1419703
objectReference: {fileID: 0}
- target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.y
value: 0.045199864
value: 0.045199875
objectReference: {fileID: 0}
- target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.z
value: -0.0064896103
value: -0.0064896126
objectReference: {fileID: 0}
- target: {fileID: 4676633831414007564, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_Name
@ -2588,27 +2588,27 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.y
value: 0
value: 0.107479095
objectReference: {fileID: 0}
- target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.z
value: 0
value: -0.014587402
objectReference: {fileID: 0}
- target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.w
value: 0.9898497
value: 0.9874955
objectReference: {fileID: 0}
- target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.x
value: 0.14211854
value: 0.15764758
objectReference: {fileID: 0}
- target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.y
value: -0.0000000034819871
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.z
value: 4.999292e-10
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4676633832858914730, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_XAxis.m_InvertInput
@ -2632,15 +2632,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.x
value: 0.14197028
value: 0.14197029
objectReference: {fileID: 0}
- target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.y
value: 0.045199856
value: 0.045199867
objectReference: {fileID: 0}
- target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.z
value: -0.006489607
value: -0.0064896094
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
@ -5375,6 +5375,7 @@ GameObject:
m_Component:
- component: {fileID: 1557424586}
- component: {fileID: 1557424585}
- component: {fileID: 1557424587}
m_Layer: 0
m_Name: Loader
m_TagString: Untagged
@ -5409,6 +5410,24 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1557424587
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1557424584}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b9468c5f457ace64f8d4df6d642b107f, type: 3}
m_Name:
m_EditorClassIdentifier:
LoadEvent: 1
UnloadEvent: 2
Banks:
- VO
CollisionTag:
PreloadSamples: 0
--- !u!1 &1557689664 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: fc2b5b7551ec86542b748c3a88b39485, type: 3}

View File

@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@ -8,6 +9,28 @@ public class DialogueSettings : ScriptableObject
public float HideAfter => _hideAfter;
[SerializeField] private float _hideAfter;
public string FMODPrefix => _fmodKeyPrefix;
[SerializeField] private string _fmodKeyPrefix;
public string RadioDialogueKey => _radioDialogueKey;
[SerializeField] private string _radioDialogueKey;
[SerializeField] private AudioClip[] _dialogueClips;
private readonly Dictionary<string, AudioClip> _keyClips = new Dictionary<string, AudioClip>();
public AudioClip GetDialogueClip(string key)
{
if (!_keyClips.ContainsKey(key))
{
Debug.LogError($"no clip for key {key}");
return null;
}
return _keyClips[key];
}
private void OnEnable()
{
foreach (var dialogueClip in _dialogueClips)
{
_keyClips[dialogueClip.name] = dialogueClip;
}
}
}

View File

@ -1,8 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using FMOD;
using FMOD.Studio;
using FMODUnity;
using UnityEngine;
using UnityEngine.Animations.Rigging;
using UnityEngine.Networking;
using Debug = UnityEngine.Debug;
#if UNITY_EDITOR
using UnityEditor;
@ -16,20 +22,91 @@ public partial class DialogueSystem : ScriptableObject
// https://stackoverflow.com/questions/2282476/actiont-vs-delegate-event
public event EventHandler<DialogueLine> onDialogueLine;
private readonly Dictionary<string, string> _fmodKeyCache = new Dictionary<string, string>();
// a list of dialogue keys that have already been spoken
private readonly List<string> _usedKeys = new List<string>();
private readonly List<string> _usedClips = new List<string>();
private EVENT_CALLBACK _dialogueCallback;
private void OnEnable()
{
_fmodKeyCache.Clear();
_usedKeys.Clear();
_usedClips.Clear();
// cache all dialogue keys for FMOD at start to avoid allocations later
foreach (var key in DialogueDatabase.Keys)
{
_fmodKeyCache[key] = $"{_settings.FMODPrefix}{key}";
_dialogueCallback = DialogueEventCallback;
}
[AOT.MonoPInvokeCallback(typeof(EVENT_CALLBACK))]
private static RESULT DialogueEventCallback(EVENT_CALLBACK_TYPE type, IntPtr instancePtr, IntPtr parameterPtr)
{
var instance = new EventInstance(instancePtr);
// retrieve user data
instance.getUserData(out IntPtr stringPtr);
// get string obejct
var stringHandle = GCHandle.FromIntPtr(stringPtr);
var key = stringHandle.Target as string;
switch (type)
{
case EVENT_CALLBACK_TYPE.CREATE_PROGRAMMER_SOUND:
{
MODE soundMode = MODE.LOOP_NORMAL | MODE.CREATECOMPRESSEDSAMPLE | MODE.NONBLOCKING;
var parameter =
(PROGRAMMER_SOUND_PROPERTIES) Marshal.PtrToStructure(parameterPtr,
typeof(PROGRAMMER_SOUND_PROPERTIES));
if (key.Contains("."))
{
Sound dialogueSound;
var soundResult = RuntimeManager.CoreSystem.createSound(Application.streamingAssetsPath + "/" + key,
soundMode, out dialogueSound);
if (soundResult == RESULT.OK)
{
parameter.sound = dialogueSound.handle;
parameter.subsoundIndex = -1;
Marshal.StructureToPtr(parameter, parameterPtr, false);
}
}
else
{
SOUND_INFO dialogueSoundInfo;
var keyResult = RuntimeManager.StudioSystem.getSoundInfo(key, out dialogueSoundInfo);
if (keyResult != RESULT.OK)
{
break;
}
Sound dialogueSound;
var soundResult = RuntimeManager.CoreSystem.createSound(dialogueSoundInfo.name_or_data,
soundMode | dialogueSoundInfo.mode, ref dialogueSoundInfo.exinfo, out dialogueSound);
if (soundResult == RESULT.OK)
{
parameter.sound = dialogueSound.handle;
parameter.subsoundIndex = dialogueSoundInfo.subsoundindex;
Marshal.StructureToPtr(parameter, parameterPtr, false);
}
}
break;
}
case EVENT_CALLBACK_TYPE.DESTROY_PROGRAMMER_SOUND:
{
var parameter =
(PROGRAMMER_SOUND_PROPERTIES) Marshal.PtrToStructure(parameterPtr,
typeof(PROGRAMMER_SOUND_PROPERTIES));
var sound = new Sound(parameter.sound);
sound.release();
break;
}
case EVENT_CALLBACK_TYPE.DESTROYED:
{
stringHandle.Free();
break;
}
}
return RESULT.OK;
}
// noRepeat locks this key off from further use. further attempts to use the key will be discarded
@ -37,50 +114,26 @@ public partial class DialogueSystem : ScriptableObject
{
if (noRepeat)
{
if (_usedKeys.Contains(key)) return;
if (_usedClips.Contains(key)) return;
_usedKeys.Add(key);
_usedClips.Add(key);
}
// retrieve cached key
if (!_fmodKeyCache.ContainsKey(key))
{
Debug.LogError($"{key} not present in dialogue database");
return;
}
var fmodKey = _fmodKeyCache[key];
var dialogueInstance = RuntimeManager.CreateInstance(_settings.RadioDialogueKey);
EventDescription? eventDescription = null;
try
{
eventDescription = FMODUnity.RuntimeManager.GetEventDescription(fmodKey);
}
catch (FMODUnity.EventNotFoundException e)
{
Debug.LogWarning($"no FMOD event {fmodKey}");
}
GCHandle stringHandle = GCHandle.Alloc(key, GCHandleType.Pinned);
dialogueInstance.setUserData(GCHandle.ToIntPtr(stringHandle));
DialogueLine dl;
dl.text = DialogueDatabase.ReadDialogue(key);
// default duration to show ui elements for
dl.duration = _settings.HideAfter;
// read audio data out of FMOD, check if event exists
if (eventDescription.HasValue)
{
// assign values and play audio
var clip = _settings.GetDialogueClip(key);
Debug.Log(clip);
dl.duration = clip.length;
// get dialogue line duration from FMOD
eventDescription.Value.getLength(out int ms);
// get length gives us a value in milliseconds so it needs to be converted to seconds
// before assignment
dl.duration = ms / 1000f;
// event is valid
FMODUnity.RuntimeManager.PlayOneShot(fmodKey);
}
dialogueInstance.setCallback(_dialogueCallback);
dialogueInstance.start();
dialogueInstance.release();
onDialogueLine?.Invoke(this, dl);
}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 2eb77a34cb5c3a2499e426bfb7aca165
guid: 68ec7a948c4bd2347aa42a978dd08b6d
folderAsset: yes
DefaultImporter:
externalObjects: {}

BIN
game/Assets/StreamingAssets/Master.bank (Stored with Git LFS)

Binary file not shown.

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7f91c2a4d80b21a43abbde2b94674471
guid: ef734c4d663529a4a9d3f68334f64573
labels:
- FMOD
DefaultImporter:

Binary file not shown.

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 6cdac34c226618e4aa6807660280989b
guid: 44433d0c998a89540ab96f6023a6fc36
labels:
- FMOD
DefaultImporter:

BIN
game/Assets/StreamingAssets/Music.bank (Stored with Git LFS)

Binary file not shown.

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 72ba6873e27408642a2a1dcb70d89708
guid: 42349855feb82b04e92fd7822b5bc32e
labels:
- FMOD
DefaultImporter:

BIN
game/Assets/StreamingAssets/SFX.bank (Stored with Git LFS)

Binary file not shown.

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 4d435d34707c1814d8c4468be808e847
guid: 73776127b41c0b44b8ddecb1ab36d76b
labels:
- FMOD
DefaultImporter:

BIN
game/Assets/StreamingAssets/VO.bank (Stored with Git LFS)

Binary file not shown.

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 701b4f629f263dd49a2c6eb4bace07bc
guid: e46905dc4b9abce4880b72e14154e3ed
labels:
- FMOD
DefaultImporter:

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
game/FMOD Project/Assets/CaiStuff/Music/CaiTrackWIP.mp3 (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
game/FMOD Project/Assets/CaiStuff/Player/Kernel_Dash.ogg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
game/FMOD Project/Assets/CaiStuff/Player/Kernel_Jump.ogg (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
game/FMOD Project/Assets/CaiStuff/UI/kernel_beep.ogg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
game/FMOD Project/Assets/CaiStuff/UI/kernel_click.ogg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
game/FMOD Project/Assets/CaiStuff/UI/kernel_select.ogg (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
game/FMOD Project/Build/Desktop/Music.bank (Stored with Git LFS)

Binary file not shown.

BIN
game/FMOD Project/Build/Desktop/SFX.bank (Stored with Git LFS)

Binary file not shown.

BIN
game/FMOD Project/Build/Desktop/VO.bank (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="EncodableAsset" id="{1cf425a4-8ef3-4da6-966c-0c32a024a567}">
<property name="assetPath">
<value>CaiStuff/Enviroment/Rock fall/</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="EncodableAsset" id="{23b22b3d-9d7f-4f01-8ab6-fd56cc38e5a8}">
<property name="assetPath">
<value>CaiStuff/</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="EncodableAsset" id="{2b596c55-cf70-4057-a53d-d02a2fcff8b2}">
<property name="assetPath">
<value>CaiStuff/Enviroment/Rock_Roll/</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="EncodableAsset" id="{2d1474aa-1571-4492-8d29-9e7e8c0b92f7}">
<property name="assetPath">
<value>VO/TEMP/</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="EncodableAsset" id="{333da2ba-765e-4d27-8f99-013db5b62bbe}">
<property name="assetPath">
<value>CaiStuff/Player/</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="EncodableAsset" id="{42305f77-0207-424b-8cfc-5e0c5911b887}">
<property name="assetPath">
<value>CaiStuff/Enviroment/Arrow Wall/</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="EncodableAsset" id="{46c1ed77-d783-4b7a-9396-89991a64867e}">
<property name="assetPath">
<value>CaiStuff/UI/</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="EncodableAsset" id="{47b84624-e567-47ff-94ac-b926b27ff291}">
<property name="assetPath">
<value>CaiStuff/Enviroment/spike trap gore/</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="EncodableAsset" id="{876ab903-0d0d-48f3-8281-47f7853a15bc}">
<property name="assetPath">
<value>CaiStuff/Enviroment/Collectable/</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="EncodableAsset" id="{8b5e32f4-ae35-466b-9496-d1064526f2f2}">
<property name="assetPath">
<value>CaiStuff/Enviroment/</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="EncodableAsset" id="{b17c57fb-0ab7-4de7-9aea-87530ac0f33c}">
<property name="assetPath">
<value>CaiStuff/Music/</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="EncodableAsset" id="{b29ac891-a91c-44ba-8b90-617759c26697}">
<property name="assetPath">
<value>CaiStuff/Enviroment/Falling Platform/</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="EncodableAsset" id="{b6c8a9aa-ebf4-4dbd-b9af-6db650d1edbf}">
<property name="assetPath">
<value>CaiStuff/Enviroment/Artifact/</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="EncodableAsset" id="{d20da866-69e5-4e0d-87ed-3e76604f7334}">
<property name="assetPath">
<value>CaiStuff/Enviroment/Ambience/</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="AudioFile" id="{0775a12b-1fdc-471b-9fa0-2ec52ce0f466}">
<property name="assetPath">
<value>CaiStuff/Enviroment/Ambience/Kernel_Drone_loop.ogg</value>
</property>
<property name="isStreaming">
<value>true</value>
</property>
<property name="frequencyInKHz">
<value>48</value>
</property>
<property name="channelCount">
<value>2</value>
</property>
<property name="length">
<value>34.666666666666664</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.01.10.00">
<objects serializationModel="Studio.02.01.00">
<object class="AudioFile" id="{08200423-a83d-43d7-8ca6-4e7bcf21464a}">
<property name="assetPath">
<value>Vehicles/Car Engine/veh_car_engine_190E_06723.ogg</value>
@ -11,7 +11,7 @@
<value>1</value>
</property>
<property name="length">
<value>0.51433300000000004</value>
<value>0.51433333333333331</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="AudioFile" id="{091b39a7-47a4-4724-9222-29cb189344d7}">
<property name="assetPath">
<value>VO/TEMP/SD_DASH_3.wav</value>
</property>
<property name="isStreaming">
<value>true</value>
</property>
<property name="frequencyInKHz">
<value>44.0999985</value>
</property>
<property name="channelCount">
<value>1</value>
</property>
<property name="length">
<value>3.3580952380952382</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.01.10.00">
<objects serializationModel="Studio.02.01.00">
<object class="AudioFile" id="{0b18b0c9-3c77-4063-b072-9d25963500c7}">
<property name="assetPath">
<value>Vehicles/Car Engine/veh_car_engine_190E_03472.ogg</value>
@ -11,7 +11,7 @@
<value>1</value>
</property>
<property name="length">
<value>1.05596</value>
<value>1.0559583333333333</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.01.10.00">
<objects serializationModel="Studio.02.01.00">
<object class="AudioFile" id="{0c8d7083-5af3-421a-a806-7ec67e53cab6}">
<property name="assetPath">
<value>Weapons/M4/weapons_m4_tail_02.ogg</value>
@ -11,7 +11,7 @@
<value>1</value>
</property>
<property name="length">
<value>0.30020799999999997</value>
<value>0.30020833333333335</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="AudioFile" id="{0db7b970-5810-4956-82cf-b0d53332f820}">
<property name="assetPath">
<value>CaiStuff/Player/Footstep1_Kernel.ogg</value>
</property>
<property name="frequencyInKHz">
<value>48</value>
</property>
<property name="channelCount">
<value>2</value>
</property>
<property name="length">
<value>1.0833333333333333</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="AudioFile" id="{0eec2247-28cf-4c2b-a1d0-fb46e4ed6f1e}">
<property name="assetPath">
<value>VO/TEMP/SD_DASH_1.wav</value>
</property>
<property name="isStreaming">
<value>true</value>
</property>
<property name="frequencyInKHz">
<value>44.0999985</value>
</property>
<property name="channelCount">
<value>1</value>
</property>
<property name="length">
<value>3.544625850340136</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.01.10.00">
<objects serializationModel="Studio.02.01.00">
<object class="AudioFile" id="{14378e12-c81b-4be1-a076-28089543a7d4}">
<property name="assetPath">
<value>Character/Footsteps/footsteps_player_carpet_02.ogg</value>
@ -11,7 +11,7 @@
<value>1</value>
</property>
<property name="length">
<value>0.50131199999999998</value>
<value>0.50131250000000005</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.01.10.00">
<objects serializationModel="Studio.02.01.00">
<object class="AudioFile" id="{1559c18e-61fd-406c-88c6-43a1c9d64784}">
<property name="assetPath">
<value>Music/music_lvl_01_bleep_c.ogg</value>
@ -11,7 +11,7 @@
<value>2</value>
</property>
<property name="length">
<value>9.0565999999999995</value>
<value>9.0566041666666663</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.01.10.00">
<objects serializationModel="Studio.02.01.00">
<object class="AudioFile" id="{174ac79a-ba45-4b2c-b177-899938586232}">
<property name="assetPath">
<value>Character/Hand Foley/Door/foley_door_open_01.ogg</value>
@ -11,7 +11,7 @@
<value>1</value>
</property>
<property name="length">
<value>1.2746900000000001</value>
<value>1.2746875</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="AudioFile" id="{1d40268c-77d3-4703-866b-36a3dfab20dd}">
<property name="assetPath">
<value>CaiStuff/Enviroment/Artifact/artifact3.ogg</value>
</property>
<property name="frequencyInKHz">
<value>48</value>
</property>
<property name="channelCount">
<value>2</value>
</property>
<property name="length">
<value>6.5</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects serializationModel="Studio.02.01.00">
<object class="AudioFile" id="{209c251d-ea30-467c-a102-39bf7b1982f4}">
<property name="assetPath">
<value>VO/TEMP/SD_DASH_2.wav</value>
</property>
<property name="isStreaming">
<value>true</value>
</property>
<property name="frequencyInKHz">
<value>44.0999985</value>
</property>
<property name="channelCount">
<value>1</value>
</property>
<property name="length">
<value>4.2597732426303851</value>
</property>
<relationship name="masterAssetFolder">
<destination>{4c43130b-9186-4fb6-9d65-a9acdac70927}</destination>
</relationship>
</object>
</objects>

Some files were not shown because too many files have changed in this diff Show More