Added Monument preview sounds

This commit is contained in:
r.nikolin 2023-10-23 11:19:20 +03:00
parent 92ab2f2f66
commit 9ca5cfff9c
32 changed files with 765 additions and 199 deletions

View File

@ -10,11 +10,14 @@ public class MonumentPreviewController : MonoBehaviour
private MonumentMini _monumentMini;
private MonumentPreview _monumentPreview;
private MonumentPreviewSound _previewSound;
private void Awake()
{
_previewSound = FindObjectOfType<MonumentPreviewSound>();
_grabbable = GetComponent<Grabbable>();
_monumentMini = GetComponent<MonumentMini>();
_monumentPreview = GetComponent<MonumentPreview>();
}
@ -31,6 +34,7 @@ public class MonumentPreviewController : MonoBehaviour
private void OnGrab(Grabber arg)
{
_monumentPreview.ShowInfo(_monumentMini.Info);
_previewSound.PlaySound(_monumentMini.Info.ShortClip);
}
#if UNITY_EDITOR

View File

@ -0,0 +1,19 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MonumentPreviewSound : MonoBehaviour
{
private AudioSource _source;
private void Awake()
{
_source = GetComponent<AudioSource>();
}
public void PlaySound(AudioClip clip)
{
_source.clip = clip;
_source.Play();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 810e8e6311b2314479b9530dc7338bed
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -91,6 +91,147 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
_wheel: {fileID: 0}
--- !u!1 &3572942993597733401
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6266832224393682084}
- component: {fileID: 7338623594274817078}
- component: {fileID: 7598721293507818679}
m_Layer: 0
m_Name: MonumentPreviewSound
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6266832224393682084
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3572942993597733401}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1160822104568116160}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7338623594274817078
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3572942993597733401}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 810e8e6311b2314479b9530dc7338bed, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!82 &7598721293507818679
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3572942993597733401}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 0
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 &4633053335750713967
GameObject:
m_ObjectHideFlags: 0
@ -127,6 +268,7 @@ Transform:
- {fileID: 7764968721981305003}
- {fileID: 2692296770531394948}
- {fileID: 2027141745847319292}
- {fileID: 6266832224393682084}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -28,3 +28,5 @@ MonoBehaviour:
MiniModel: {fileID: 7721131150223155987, guid: 639d55772ac07cc4db41aff9b5fbb867,
type: 3}
Score: 50
ShortClip: {fileID: 8300000, guid: efd8170b63e191e4b97d8d17d91d5e85, type: 3}
LongClip: {fileID: 8300000, guid: fc673c753e2e2d64694ec1b0e9d14fad, type: 3}

View File

@ -23,7 +23,7 @@ MonoBehaviour:
\u0432 \u043A\u0440\u0430\u0442\u0447\u0430\u0439\u0448\u0438\u0435 \u0441\u0440\u043E\u043A\u0438
\u043F\u043E\u0441\u043B\u0435 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u044F
\u043F\u0435\u043D\u0437\u0435\u043D\u0441\u043A\u043E\u0433\u043E \u0448\u043A\u043E\u043B\u044C\u043D\u0438\u043A\u0430
\u0418\u0432\u0430\u043D\u0430 \u0423\u0434\u0410\u043B\u043E\u0432\u0430 \r\n\u043A
\u0418\u0432\u0430\u043D\u0430 \u0423\u0434\u0430\u043B\u043E\u0432\u0430 \r\n\u043A
\u043F\u0440\u0435\u0437\u0438\u0434\u0435\u043D\u0442\u0443 \u0420\u043E\u0441\u0441\u0438\u0438
\u043D\u0430 \xAB\u041F\u0440\u044F\u043C\u043E\u0439 \u043B\u0438\u043D\u0438\u0438\xBB
\u0441 \u043F\u0440\u043E\u0441\u044C\u0431\u043E\u0439 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C
@ -31,3 +31,5 @@ MonoBehaviour:
MiniModel: {fileID: 7721131150223155987, guid: 639d55772ac07cc4db41aff9b5fbb867,
type: 3}
Score: 50
ShortClip: {fileID: 8300000, guid: 871d038a41ae7d64abf9cf286a54b5e9, type: 3}
LongClip: {fileID: 8300000, guid: 6c95570eb84e898469f2359826125cf3, type: 3}

View File

@ -27,3 +27,5 @@ MonoBehaviour:
MiniModel: {fileID: 7721131150223155987, guid: 639d55772ac07cc4db41aff9b5fbb867,
type: 3}
Score: 50
ShortClip: {fileID: 8300000, guid: bcdfc07f46b879c41b3f470ce6a05e5e, type: 3}
LongClip: {fileID: 8300000, guid: 93dd7c18842f53a438dad3e1cbc7043d, type: 3}

File diff suppressed because one or more lines are too long

View File

@ -14,11 +14,13 @@ public class MonumentController : MonoBehaviour
private float _currentEnergy;
private ScoreController _scoreController;
private CockpitUIModule _cockpitUI;
private MonumentPreviewSound _previewSound;
public UnityEvent OnUnlock;
private void Awake()
{
_previewSound = FindObjectOfType<MonumentPreviewSound>();
_scoreController = FindObjectOfType<ScoreController>();
_cockpitUI = FindObjectOfType<CockpitUIModule>();
_energyController = FindObjectOfType<EnergyController>();
@ -38,6 +40,7 @@ public class MonumentController : MonoBehaviour
Debug.Log($"Clamped energy value: {_currentEnergy / _energyToUnlock}");
});
_previewSound.PlaySound(_info.LongClip);
_scoreController.AddScoreInTime(_info.Score, 1, false);
//TODO: ÐÀÇÁËÎÊÈÐÎÂÀÒÜ ÌÎÍÓÌÅÍÒ ÒÎËÜÊÎ ÅÑËÈ ÕÂÀÒÈËÎ ÝÍÅÐÃÈÈ
PlayerSetup.Instance.UnlockMonument(_info);

View File

@ -14,4 +14,7 @@ public class MonumentInfo : ScriptableObject
public string Description;
public GameObject MiniModel;
public float Score;
public AudioClip ShortClip;
public AudioClip LongClip;
}

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

View File

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

Binary file not shown.

View File

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

Binary file not shown.

View File

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

Binary file not shown.

View File

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

Binary file not shown.

View File

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

Binary file not shown.

View File

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

Binary file not shown.

View File

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

Binary file not shown.

View File

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