diff --git a/Assets/Scenes/MainScene.meta b/Assets/Audio.meta similarity index 77% rename from Assets/Scenes/MainScene.meta rename to Assets/Audio.meta index fad139c12cfcbabc8dcc5959d24c3f7fab5f775b..035661a405a337e3a5bd367f0518c2ec0419d7f4 100644 --- a/Assets/Scenes/MainScene.meta +++ b/Assets/Audio.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 829c46be4b50d504a8fd053e72cf24e3 +guid: 563dd080f8963b94691458d725c2c55f folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Audio/kivikausi.bak b/Assets/Audio/kivikausi.bak new file mode 100644 index 0000000000000000000000000000000000000000..3b3d970599286a19ab2ea3a9bc798f11a0e1d775 Binary files /dev/null and b/Assets/Audio/kivikausi.bak differ diff --git a/Assets/Audio/kivikausi.bak.meta b/Assets/Audio/kivikausi.bak.meta new file mode 100644 index 0000000000000000000000000000000000000000..9df8b50eb96bf1809e646b1c11919866062d7aeb --- /dev/null +++ b/Assets/Audio/kivikausi.bak.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4b04fbdc1f3c8524291d53c73f8a7ca1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/kivikausi.it b/Assets/Audio/kivikausi.it new file mode 100644 index 0000000000000000000000000000000000000000..46daa21809dd01c9acf5bb83dc86d1b497beb50b Binary files /dev/null and b/Assets/Audio/kivikausi.it differ diff --git a/Assets/Audio/kivikausi.it.meta b/Assets/Audio/kivikausi.it.meta new file mode 100644 index 0000000000000000000000000000000000000000..bd3882d8ce1f3acebc200c440baa698e450cb853 --- /dev/null +++ b/Assets/Audio/kivikausi.it.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 21ee1dc9c869cb744bb9d04b77b8eb37 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 1 + 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: diff --git a/Assets/Audio/kivikausi_1.bak b/Assets/Audio/kivikausi_1.bak new file mode 100644 index 0000000000000000000000000000000000000000..86eefc263f48af5c1652b6573775a4d42b70da6d Binary files /dev/null and b/Assets/Audio/kivikausi_1.bak differ diff --git a/Assets/Audio/kivikausi_1.bak.meta b/Assets/Audio/kivikausi_1.bak.meta new file mode 100644 index 0000000000000000000000000000000000000000..29c4b3c4a67b14b79ba5b15f31159c9178a61140 --- /dev/null +++ b/Assets/Audio/kivikausi_1.bak.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b3fc5a2829ee9c34d9184cee2b3d9088 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/kivikausi_1.it b/Assets/Audio/kivikausi_1.it new file mode 100644 index 0000000000000000000000000000000000000000..13c4166e7f920f62d2899c12ca9dd69a0f0739e1 Binary files /dev/null and b/Assets/Audio/kivikausi_1.it differ diff --git a/Assets/Audio/kivikausi_1.it.meta b/Assets/Audio/kivikausi_1.it.meta new file mode 100644 index 0000000000000000000000000000000000000000..fc1730e3a0d870b24bda5777f25ad2bbe3d6e690 --- /dev/null +++ b/Assets/Audio/kivikausi_1.it.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: fe65696a605ecef46a6e17d968389a60 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 1 + 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: diff --git a/Assets/Audio/kivikausi_2.it b/Assets/Audio/kivikausi_2.it new file mode 100644 index 0000000000000000000000000000000000000000..f29fbd5d719531f1394260f43b3baa315306bcf1 Binary files /dev/null and b/Assets/Audio/kivikausi_2.it differ diff --git a/Assets/Audio/kivikausi_2.it.meta b/Assets/Audio/kivikausi_2.it.meta new file mode 100644 index 0000000000000000000000000000000000000000..6f178cefb3e2e7bff01bf8013dd5af6dda70597b --- /dev/null +++ b/Assets/Audio/kivikausi_2.it.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: bcf2099bf34b1034093d61bb2f365a40 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 1 + 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: diff --git a/Assets/Audio/kivikausi_4.it b/Assets/Audio/kivikausi_4.it new file mode 100644 index 0000000000000000000000000000000000000000..79ebbc3bdd409f3b537f93ab5c6251b16f2470bd Binary files /dev/null and b/Assets/Audio/kivikausi_4.it differ diff --git a/Assets/Audio/kivikausi_4.it.meta b/Assets/Audio/kivikausi_4.it.meta new file mode 100644 index 0000000000000000000000000000000000000000..49653c1e0d3da62e41bf7f74200556ce02322bfa --- /dev/null +++ b/Assets/Audio/kivikausi_4.it.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 2eb734563c655d4459eeee5eb5023b47 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 1 + 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: diff --git a/Assets/Audio/kivikausi_5.it b/Assets/Audio/kivikausi_5.it new file mode 100644 index 0000000000000000000000000000000000000000..9a5e4931233a65bffdd51ed4113ab6fd9a37bc6c Binary files /dev/null and b/Assets/Audio/kivikausi_5.it differ diff --git a/Assets/Audio/kivikausi_5.it.meta b/Assets/Audio/kivikausi_5.it.meta new file mode 100644 index 0000000000000000000000000000000000000000..169cbeef4cdfe73a5783461bfe53b6b988df31bc --- /dev/null +++ b/Assets/Audio/kivikausi_5.it.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: d9b37223090a0a94bad400813c2f713d +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 1 + 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: diff --git a/Assets/Audio/kivikausi_6.it b/Assets/Audio/kivikausi_6.it new file mode 100644 index 0000000000000000000000000000000000000000..4bac405b1b394bb3f230487d67121da18aab02f0 Binary files /dev/null and b/Assets/Audio/kivikausi_6.it differ diff --git a/Assets/Audio/kivikausi_6.it.meta b/Assets/Audio/kivikausi_6.it.meta new file mode 100644 index 0000000000000000000000000000000000000000..7261968fa7fa75116562b0b6b129488814fc86f6 --- /dev/null +++ b/Assets/Audio/kivikausi_6.it.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 92c3c637aed077f43ab264957eba75d5 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 1 + 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: diff --git a/Assets/Prefab.meta b/Assets/Prefab.meta new file mode 100644 index 0000000000000000000000000000000000000000..c3c61ae80c8a7417d27da2e632b2b42f84e2bc16 --- /dev/null +++ b/Assets/Prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ca030c1f3728df74e958482d0f7c54b2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefab/AudioSystem.prefab b/Assets/Prefab/AudioSystem.prefab new file mode 100644 index 0000000000000000000000000000000000000000..213ccc6daef6e20748b7794394ecf9a4a0701b65 --- /dev/null +++ b/Assets/Prefab/AudioSystem.prefab @@ -0,0 +1,150 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &203678261489018088 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 203678261489018135} + - component: {fileID: 203678261489018134} + - component: {fileID: 203678261489018089} + m_Layer: 0 + m_Name: AudioSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &203678261489018135 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 203678261489018088} + 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_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!82 &203678261489018134 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 203678261489018088} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 1 + m_Volume: 1 + m_Pitch: 1 + Loop: 1 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 1 + 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!114 &203678261489018089 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 203678261489018088} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4d6e79ed41c24344082a70bfaffa1f02, type: 3} + m_Name: + m_EditorClassIdentifier: + musics: + - {fileID: 8300000, guid: 21ee1dc9c869cb744bb9d04b77b8eb37, type: 3} + - {fileID: 8300000, guid: fe65696a605ecef46a6e17d968389a60, type: 3} + - {fileID: 8300000, guid: bcf2099bf34b1034093d61bb2f365a40, type: 3} + - {fileID: 8300000, guid: 2eb734563c655d4459eeee5eb5023b47, type: 3} + - {fileID: 8300000, guid: d9b37223090a0a94bad400813c2f713d, type: 3} + - {fileID: 8300000, guid: 92c3c637aed077f43ab264957eba75d5, type: 3} + ac: {fileID: 203678261489018134} diff --git a/Assets/Prefab/AudioSystem.prefab.meta b/Assets/Prefab/AudioSystem.prefab.meta new file mode 100644 index 0000000000000000000000000000000000000000..e5a82cbce2fea33bc8addf20562f89cdd7b472fa --- /dev/null +++ b/Assets/Prefab/AudioSystem.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 530bea3a047bd31458b647c456257c63 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity index ff8f3a96dcecd92004ea422bf33be39f2e43a253..37686225d045d759689768977b2abff4dfd32678 100644 --- a/Assets/Scenes/MainScene.unity +++ b/Assets/Scenes/MainScene.unity @@ -189,7 +189,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 7 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &22867175 GameObject: @@ -268,7 +268,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 16 + m_RootOrder: 17 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &30912929 GameObject: @@ -347,7 +347,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &113771966 GameObject: @@ -508,7 +508,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &277634720 GameObject: @@ -587,7 +587,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 14 + m_RootOrder: 15 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &280967564 GameObject: @@ -666,7 +666,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &398418972 GameObject: @@ -745,7 +745,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 13 + m_RootOrder: 14 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &458151430 GameObject: @@ -824,7 +824,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 15 + m_RootOrder: 16 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &471348698 GameObject: @@ -904,7 +904,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 17 + m_RootOrder: 18 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!61 &471348701 BoxCollider2D: @@ -1009,7 +1009,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &509902886 GameObject: @@ -1088,7 +1088,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 12 + m_RootOrder: 13 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &786897571 GameObject: @@ -1167,7 +1167,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &873516387 GameObject: @@ -1246,7 +1246,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 9 + m_RootOrder: 10 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &932290489 GameObject: @@ -1328,7 +1328,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 18 + m_RootOrder: 19 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &932290492 MonoBehaviour: @@ -1473,8 +1473,77 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 10 + m_RootOrder: 11 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1357879259 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 203678261489018088, guid: 530bea3a047bd31458b647c456257c63, + type: 3} + propertyPath: m_Name + value: AudioSystem + objectReference: {fileID: 0} + - target: {fileID: 203678261489018135, guid: 530bea3a047bd31458b647c456257c63, + type: 3} + propertyPath: m_LocalPosition.x + value: -16.633623 + objectReference: {fileID: 0} + - target: {fileID: 203678261489018135, guid: 530bea3a047bd31458b647c456257c63, + type: 3} + propertyPath: m_LocalPosition.y + value: -3.3208985 + objectReference: {fileID: 0} + - target: {fileID: 203678261489018135, guid: 530bea3a047bd31458b647c456257c63, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 203678261489018135, guid: 530bea3a047bd31458b647c456257c63, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 203678261489018135, guid: 530bea3a047bd31458b647c456257c63, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 203678261489018135, guid: 530bea3a047bd31458b647c456257c63, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 203678261489018135, guid: 530bea3a047bd31458b647c456257c63, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 203678261489018135, guid: 530bea3a047bd31458b647c456257c63, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 203678261489018135, guid: 530bea3a047bd31458b647c456257c63, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 203678261489018135, guid: 530bea3a047bd31458b647c456257c63, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 203678261489018135, guid: 530bea3a047bd31458b647c456257c63, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 530bea3a047bd31458b647c456257c63, type: 3} --- !u!1 &1667231311 GameObject: m_ObjectHideFlags: 0 @@ -1552,7 +1621,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 6 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1699889074 GameObject: @@ -1645,7 +1714,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 19 + m_RootOrder: 20 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!61 &1699889078 BoxCollider2D: @@ -1750,7 +1819,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 11 + m_RootOrder: 12 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1893573155 GameObject: @@ -1829,5 +1898,5 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 8 + m_RootOrder: 9 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scripts/AudioSystem.cs b/Assets/Scripts/AudioSystem.cs new file mode 100644 index 0000000000000000000000000000000000000000..a611bb0a463d80e00d727470fd5aa8e37f0717fc --- /dev/null +++ b/Assets/Scripts/AudioSystem.cs @@ -0,0 +1,141 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + + +public class AudioSystem : MonoBehaviour, IAction +{ + + [SerializeField] + private List<AudioClip> musics = new List<AudioClip>(); + + [SerializeField] + private AudioSource ac; + // Start is called before the first frame update + void Start() + { + + foreach (EventType x in System.Enum.GetValues(typeof(EventType))) + { + EventSystem.AddEvent(x, this); + } + React(EventType.GameStarts); + } + + // Update is called once per frame + void Update() + { + + } + + public void React(EventType type) { + if (type == EventType.GameStarts) + { + GameStartsClip(); + } + if (type == EventType.CitySmall) + { + CitySmallClip(); + } + if (type == EventType.CityBig) + { + CityBigClip(); + } + if (type == EventType.HuntingSmall) + { + HuntingSmallClip(); + } + if (type == EventType.HuntingBig) + { + HuntingBigClip(); + } + if (type == EventType.WoodChopped) + { + + } + if (type == EventType.StoneCut) + { + + } + } + + + public void GameStartsClip() + { + StartCoroutine("FadeOutIn", new Timing(0,0)); + } + public void CitySmallClip() + { + StartCoroutine("FadeOutIn", new Timing(3, 1)); + } + public void CityBigClip() + { + StartCoroutine("FadeOutIn", new Timing(3, 2)); + } + public void HuntingSmallClip() + { + StartCoroutine("FadeOutIn", new Timing(2, 4)); + } + public void HuntingBigClip() + { + StartCoroutine("FadeOutIn", new Timing(2, 6)); + } + + IEnumerator FadeOutIn(Timing t) { + //yield return FadeOut(t.duration); + yield return StartCoroutine("FadeOut", t.duration); + ac.clip = musics[t.clip]; + yield return StartCoroutine("FadeIn", t.duration); + } + + public IEnumerator FadeOut(int duration) + { + float start = Time.time; + float end = start + duration; + if (ac.isPlaying) + { + while (Time.time < end) + { + float current = Time.time - start; + //(duration-(current-min)/(max-min) + float volume = (duration - (Time.time - start)) / (end - start); + yield return null; + ac.volume = volume; + } + ac.Stop(); + } + } + public IEnumerator FadeIn(int duration) + { + float start = Time.time; + float end = start + duration; + ac.volume = 0; + ac.Play(); + while(Time.time < end) + { + float current = Time.time - start; + //(max-current)/(max-min) + float volume = (end - Time.time) / (end - start); + yield return null; + ac.volume = volume; + } + ac.volume = 1; + } + + + + + private class Timing { + public int clip; + public int duration; + + public Timing(int duration, int clip) { + this.clip = clip; + this.duration = duration; + } + } + + + + +} diff --git a/Assets/Scripts/AudioSystem.cs.meta b/Assets/Scripts/AudioSystem.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..612a8121d1b376027673a24773909527778476fc --- /dev/null +++ b/Assets/Scripts/AudioSystem.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4d6e79ed41c24344082a70bfaffa1f02 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/EventSystem.cs b/Assets/Scripts/EventSystem.cs index aeb877eef995e50e844a1e6b3e6b9cc23e2e36f1..0762879b792341ea32064fd4bc3e843a116b543d 100644 --- a/Assets/Scripts/EventSystem.cs +++ b/Assets/Scripts/EventSystem.cs @@ -18,7 +18,7 @@ public static class EventSystem if (events.ContainsKey(name)) { foreach (IAction e in events.Values){ - e.React(); + e.React(name); } } } diff --git a/Assets/Scripts/EventType.cs b/Assets/Scripts/EventType.cs index 97a4e415c85f0dcddcfed26af0cf28022ffa2dc6..1b3013264a49a984465560353127b9961279d50a 100644 --- a/Assets/Scripts/EventType.cs +++ b/Assets/Scripts/EventType.cs @@ -4,5 +4,14 @@ using UnityEngine; public enum EventType { - TimePeriodChanged + GameStarts, //music + TimePeriodChanged, // music + CitySmall, //music + CityBig, //music + WoodChopped, //effect + StoneCut, //effect + HuntingSmall, //music + HuntingBig, //music + UpgradeBuilt //effect + } diff --git a/Assets/Scripts/IAction.cs b/Assets/Scripts/IAction.cs index 51d28e5826b152bd8c975595f26db6a644d36655..fcf7a687c6efe002c0d06c036f00796706cbf776 100644 --- a/Assets/Scripts/IAction.cs +++ b/Assets/Scripts/IAction.cs @@ -4,5 +4,5 @@ using UnityEngine; public interface IAction { - void React(); + void React(EventType eventType); }