Fix tutorial sounds + fix monument previvew

This commit is contained in:
r.nikolin 2023-10-30 13:54:38 +03:00
parent ba086b8922
commit 82b87fcb0c
6 changed files with 305 additions and 462 deletions

View File

@ -11,8 +11,15 @@ public class MonumentPreview : MonoBehaviour
[SerializeField] private UIFader _UIFader;
[SerializeField] private TMPro.TextMeshProUGUI _nameText;
private static UIFader lastPreview;
public void ShowInfo(string name, Sprite image, string text, float time)
{
if (lastPreview != null)
lastPreview.HidePanel();
lastPreview = _UIFader;
_nameText.SetText(name);
_image.sprite = image;
_UITextShow.SetText(text, time, _UIFader.ShowPanel, _UIFader.HidePanel);

View File

@ -4,16 +4,16 @@ using UnityEngine;
public class MonumentPreviewSound : MonoBehaviour
{
private AudioSource _source;
private SoundEmitter _emitter;
private void Awake()
{
_source = GetComponent<AudioSource>();
_emitter = GetComponent<SoundEmitter>();
}
public void PlaySound(AudioClip clip)
public void PlaySound(AudioClip sound)
{
_source.clip = clip;
_source.Play();
_emitter.Sound.Clip = sound;
_emitter.Play();
}
}

View File

@ -91,147 +91,6 @@ 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
@ -268,7 +127,6 @@ Transform:
- {fileID: 7764968721981305003}
- {fileID: 2692296770531394948}
- {fileID: 2027141745847319292}
- {fileID: 6266832224393682084}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

File diff suppressed because one or more lines are too long

View File

@ -22,7 +22,7 @@ public class MonumentController : MonoBehaviour
private void Awake()
{
_monumentPreview = FindObjectOfType<MonumentPreview>();
_previewSound = FindObjectOfType<MonumentPreviewSound>();
_previewSound = GetComponent<MonumentPreviewSound>();
_scoreController = FindObjectOfType<ScoreController>();
_cockpitUI = FindObjectOfType<CockpitUIModule>();
_energyController = FindObjectOfType<EnergyController>();

View File

@ -87,6 +87,8 @@ GameObject:
- component: {fileID: 2718859616202618344}
- component: {fileID: 2718859616202618346}
- component: {fileID: -559007667975206430}
- component: {fileID: 2187166513988109285}
- component: {fileID: 2459677160022486685}
m_Layer: 0
m_Name: Monument_Origin
m_TagString: Untagged
@ -176,6 +178,42 @@ MonoBehaviour:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!114 &2187166513988109285
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2718859616202618345}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 810e8e6311b2314479b9530dc7338bed, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &2459677160022486685
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2718859616202618345}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a2dc6f3489b430644a64e340f565bc29, type: 3}
m_Name:
m_EditorClassIdentifier:
Sound:
Clip: {fileID: 0}
Volume: 1
Priority: 128
Pitch: 1
Zone: 0
PlayOnAwake: 0
Loop: 0
SoundPlayer: {fileID: 8851741688417011874, guid: d8aaa15f51dd55a4fb0b37cecdd79846,
type: 3}
PlayOnlyOnce: 0
MuteOtherSound: 1
--- !u!1 &9014324613662600091
GameObject:
m_ObjectHideFlags: 0
@ -266,6 +304,21 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 2718859616202618344}
m_Modifications:
- target: {fileID: -7511558181221131132, guid: b05aeaed0e2590f4d9aa946531bb6552,
type: 3}
propertyPath: m_LightProbeUsage
value: 2
objectReference: {fileID: 0}
- target: {fileID: -7511558181221131132, guid: b05aeaed0e2590f4d9aa946531bb6552,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 0b746badcf58ef24692612bf34f836c8, type: 2}
- target: {fileID: 919132149155446097, guid: b05aeaed0e2590f4d9aa946531bb6552,
type: 3}
propertyPath: m_StaticEditorFlags
value: 2147483647
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 5ef4186f269b2c04c865e865716c1da0,
type: 3}
propertyPath: m_RootOrder
@ -341,26 +394,11 @@ PrefabInstance:
propertyPath: m_ReceiveGI
value: 2
objectReference: {fileID: 0}
- target: {fileID: -7511558181221131132, guid: b05aeaed0e2590f4d9aa946531bb6552,
type: 3}
propertyPath: m_LightProbeUsage
value: 2
objectReference: {fileID: 0}
- target: {fileID: -7511558181221131132, guid: b05aeaed0e2590f4d9aa946531bb6552,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 0b746badcf58ef24692612bf34f836c8, type: 2}
- target: {fileID: 919132149155446097, guid: 5ef4186f269b2c04c865e865716c1da0,
type: 3}
propertyPath: m_Name
value: under_of_monument 2
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: b05aeaed0e2590f4d9aa946531bb6552,
type: 3}
propertyPath: m_StaticEditorFlags
value: 2147483647
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 5ef4186f269b2c04c865e865716c1da0, type: 3}
--- !u!4 &4421202291124940304 stripped