Background music

This commit is contained in:
2024-04-21 18:56:14 +02:00
parent 1ab00c2b39
commit 2844bb2718
12 changed files with 157 additions and 7 deletions

View File

@@ -434,6 +434,8 @@ MonoBehaviour:
m_EditorClassIdentifier:
car: {fileID: 0}
rotateSpeed: 1.5
startPosition: {x: 0, y: 0, z: 0}
startRotation: {x: 0, y: 0, z: 0, w: 0}
--- !u!20 &271763179
Camera:
m_ObjectHideFlags: 0
@@ -532,6 +534,8 @@ MonoBehaviour:
m_EditorClassIdentifier:
car: {fileID: 2094643342}
rotateSpeed: 1.5
startPosition: {x: 0, y: 1.000505, z: -1.9979231}
startRotation: {x: 0.17364816, y: 0, z: 0, w: 0.9848078}
--- !u!20 &310777429
Camera:
m_ObjectHideFlags: 0
@@ -632,6 +636,8 @@ GameObject:
m_Component:
- component: {fileID: 481224846}
- component: {fileID: 481224847}
- component: {fileID: 481224849}
- component: {fileID: 481224848}
m_Layer: 0
m_Name: Main garage
m_TagString: Untagged
@@ -675,6 +681,110 @@ MonoBehaviour:
RacecarGarage: {fileID: 582842961}
FordButton: {fileID: 177734533}
FordGarage: {fileID: 452640125}
--- !u!81 &481224848
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 481224845}
m_Enabled: 1
--- !u!82 &481224849
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 481224845}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: 632dbffd8a80b8245a8f464d1fa8f7cd, type: 3}
m_PlayOnAwake: 1
m_Volume: 0.05
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 &562151032
GameObject:
m_ObjectHideFlags: 0
@@ -1307,6 +1417,10 @@ PrefabInstance:
propertyPath: m_Constraints
value: 126
objectReference: {fileID: 0}
- target: {fileID: 3239213433477781764, guid: 5851f609a58dc884a99030da0105c6db, type: 3}
propertyPath: m_IsKinematic
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5420764024659664985, guid: 5851f609a58dc884a99030da0105c6db, type: 3}
propertyPath: m_LocalPosition.x
value: 0
@@ -1353,7 +1467,8 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents:
- {fileID: 5418785709807611868, guid: 5851f609a58dc884a99030da0105c6db, type: 3}
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 5980600979410270282, guid: 5851f609a58dc884a99030da0105c6db, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 5851f609a58dc884a99030da0105c6db, type: 3}
@@ -1404,6 +1519,8 @@ MonoBehaviour:
m_EditorClassIdentifier:
car: {fileID: 1866546543}
rotateSpeed: 1.5
startPosition: {x: 0, y: 1.000505, z: -1.9979231}
startRotation: {x: 0.17364816, y: 0, z: 0, w: 0.9848078}
--- !u!20 &1216957399
Camera:
m_ObjectHideFlags: 0
@@ -1625,6 +1742,8 @@ MonoBehaviour:
m_EditorClassIdentifier:
car: {fileID: 364177505}
rotateSpeed: 1.5
startPosition: {x: 0, y: 1.000505, z: -1.9979231}
startRotation: {x: 0.17364818, y: 0, z: 0, w: 0.9848077}
--- !u!20 &1398918407
Camera:
m_ObjectHideFlags: 0

View File

@@ -7,25 +7,22 @@ public class CarCustomizationCamera : MonoBehaviour
new Transform transform;
public Transform car;
public float rotateSpeed;
Vector3 startPosition;
Quaternion startRotation;
public Vector3 startPosition;
public Quaternion startRotation;
// Start is called before the first frame update
void Start()
{
transform = GetComponent<Transform>();
startPosition = transform.position;
startRotation = transform.rotation;
}
// Update is called once per frame
void Update()
{
transform.LookAt(car);
// transform.Translate(Vector3.right * Time.deltaTime);
transform.position += transform.right * Time.deltaTime * rotateSpeed;
}
private void OnEnable() {
transform = GetComponent<Transform>();
transform.position = startPosition;
transform.rotation = startRotation;
}

View File

@@ -14,6 +14,9 @@ public class Garage : MonoBehaviour
// Start is called before the first frame update
void Start()
{
AudioSource audioSource = GetComponent<AudioSource>();
audioSource.Play();
HotrodButton.onClick.AddListener(SelectHotrod);
RacecarButton.onClick.AddListener(SelectRacecar);
FordButton.onClick.AddListener(SelectFord);

View File

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

Binary file not shown.

View File

@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 632dbffd8a80b8245a8f464d1fa8f7cd
AudioImporter:
externalObjects: {}
serializedVersion: 7
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: