diff --git a/Assets/Audio.meta b/Assets/Audio.meta new file mode 100644 index 0000000..24c29d1 --- /dev/null +++ b/Assets/Audio.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 45c7677c1cf47f10aa135ad774e6d392 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/Select.wav b/Assets/Audio/Select.wav new file mode 100644 index 0000000..5f1c285 Binary files /dev/null and b/Assets/Audio/Select.wav differ diff --git a/Assets/Audio/Select.wav.meta b/Assets/Audio/Select.wav.meta new file mode 100644 index 0000000..c7cfb63 --- /dev/null +++ b/Assets/Audio/Select.wav.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 8e32ddd55d6efe6e383b392b08cbe107 +AudioImporter: + externalObjects: {} + serializedVersion: 8 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/Speak.wav b/Assets/Audio/Speak.wav new file mode 100644 index 0000000..0744fc4 Binary files /dev/null and b/Assets/Audio/Speak.wav differ diff --git a/Assets/Audio/Speak.wav.meta b/Assets/Audio/Speak.wav.meta new file mode 100644 index 0000000..21346bf --- /dev/null +++ b/Assets/Audio/Speak.wav.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 8031864ce1c982d53913a027ea97577f +AudioImporter: + externalObjects: {} + serializedVersion: 8 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/Speak2.wav b/Assets/Audio/Speak2.wav new file mode 100644 index 0000000..acb34d7 Binary files /dev/null and b/Assets/Audio/Speak2.wav differ diff --git a/Assets/Audio/Speak2.wav.meta b/Assets/Audio/Speak2.wav.meta new file mode 100644 index 0000000..ac4f1a5 --- /dev/null +++ b/Assets/Audio/Speak2.wav.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 06e03c52b213e965ab19f5ee87a7c02a +AudioImporter: + externalObjects: {} + serializedVersion: 8 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/Speak3.wav b/Assets/Audio/Speak3.wav new file mode 100644 index 0000000..10e804f Binary files /dev/null and b/Assets/Audio/Speak3.wav differ diff --git a/Assets/Audio/Speak3.wav.meta b/Assets/Audio/Speak3.wav.meta new file mode 100644 index 0000000..a53be9e --- /dev/null +++ b/Assets/Audio/Speak3.wav.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 750d18f95edb138389d25fa240d4bebe +AudioImporter: + externalObjects: {} + serializedVersion: 8 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/WordAdd.wav b/Assets/Audio/WordAdd.wav new file mode 100644 index 0000000..a36e98e Binary files /dev/null and b/Assets/Audio/WordAdd.wav differ diff --git a/Assets/Audio/WordAdd.wav.meta b/Assets/Audio/WordAdd.wav.meta new file mode 100644 index 0000000..c17cd7d --- /dev/null +++ b/Assets/Audio/WordAdd.wav.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: b14c103790e60da69ae477940a6f3951 +AudioImporter: + externalObjects: {} + serializedVersion: 8 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/WordRemove.wav b/Assets/Audio/WordRemove.wav new file mode 100644 index 0000000..6cbc3db Binary files /dev/null and b/Assets/Audio/WordRemove.wav differ diff --git a/Assets/Audio/WordRemove.wav.meta b/Assets/Audio/WordRemove.wav.meta new file mode 100644 index 0000000..55ff88b --- /dev/null +++ b/Assets/Audio/WordRemove.wav.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 519cfc8632246818cb25372742c8fd8f +AudioImporter: + externalObjects: {} + serializedVersion: 8 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/Scene_Loadtest.unity b/Assets/Scenes/Scene_Loadtest.unity index b7b1dc4..4a34ef3 100644 --- a/Assets/Scenes/Scene_Loadtest.unity +++ b/Assets/Scenes/Scene_Loadtest.unity @@ -946,6 +946,8 @@ GameObject: - component: {fileID: 330585545} - component: {fileID: 330585544} - component: {fileID: 330585547} + - component: {fileID: 330585549} + - component: {fileID: 330585548} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -1071,6 +1073,126 @@ MonoBehaviour: m_VarianceClampScale: 0.9 m_ContrastAdaptiveSharpening: 0 m_Version: 2 +--- !u!114 &330585548 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 330585543} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 083c97d5b5c3da8408586386bf771491, type: 3} + m_Name: + m_EditorClassIdentifier: '::' + clips: + - key: WordAdd + value: {fileID: 8300000, guid: b14c103790e60da69ae477940a6f3951, type: 3} + - key: WordRemove + value: {fileID: 8300000, guid: 519cfc8632246818cb25372742c8fd8f, type: 3} + - key: Select + value: {fileID: 8300000, guid: 8e32ddd55d6efe6e383b392b08cbe107, type: 3} + speech: + - {fileID: 8300000, guid: 8031864ce1c982d53913a027ea97577f, type: 3} + - {fileID: 8300000, guid: 06e03c52b213e965ab19f5ee87a7c02a, type: 3} + - {fileID: 8300000, guid: 750d18f95edb138389d25fa240d4bebe, type: 3} +--- !u!82 &330585549 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 330585543} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_Resource: {fileID: 0} + m_PlayOnAwake: 1 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 --- !u!1 &400817401 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/AudioManager.cs b/Assets/Scripts/AudioManager.cs new file mode 100644 index 0000000..4f5f357 --- /dev/null +++ b/Assets/Scripts/AudioManager.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using UnityEngine; +using Utils; +using Utils.Utils; + +public class AudioManager : Singleton +{ + private AudioSource audioSource; + + [SerializeField] + private List> clips = new List>(); + + [SerializeField] + private List speech = new List(); + + private + // Start is called once before the first execution of Update after the MonoBehaviour is created + void Start() + { + audioSource = GetComponent(); + audioSource.pitch = 1; + } + + public void PlaySound(string type) + { + audioSource.pitch = 1f; + audioSource.PlayOneShot(clips.ByKey(type)); + } + + + public void PlaySpeechSound(bool pitchDown) + { + int index = Random.Range(0, speech.Count); + audioSource.pitch = pitchDown ? 0.5f:1f; + audioSource.PlayOneShot(speech[index], 1.5f); + + } +} diff --git a/Assets/Scripts/AudioManager.cs.meta b/Assets/Scripts/AudioManager.cs.meta new file mode 100644 index 0000000..3201af0 --- /dev/null +++ b/Assets/Scripts/AudioManager.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 083c97d5b5c3da8408586386bf771491 \ No newline at end of file diff --git a/Assets/Scripts/DialogManager.cs b/Assets/Scripts/DialogManager.cs index 0e0827d..6f40d64 100644 --- a/Assets/Scripts/DialogManager.cs +++ b/Assets/Scripts/DialogManager.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Text.RegularExpressions; using DefaultNamespace; using JetBrains.Annotations; @@ -133,11 +134,11 @@ public class DialogManager : Singleton option.GetComponent