diff --git a/Assets/Resources/InGame/Save.png b/Assets/Resources/InGame/Save.png new file mode 100644 index 0000000..5a5f408 Binary files /dev/null and b/Assets/Resources/InGame/Save.png differ diff --git a/Assets/Resources/InGame/Save.png.meta b/Assets/Resources/InGame/Save.png.meta new file mode 100644 index 0000000..919c2fd --- /dev/null +++ b/Assets/Resources/InGame/Save.png.meta @@ -0,0 +1,155 @@ +fileFormatVersion: 2 +guid: 58314e7be35f3201e8f3d376508d5800 +TextureImporter: + internalIDToNameTable: + - first: + 213: -522367714226421056 + second: Save_0 + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 2 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: + - serializedVersion: 2 + name: Save_0 + rect: + serializedVersion: 2 + x: 24 + y: 23 + width: 464 + height: 464 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 0c2c66fd45d20c8f0800000000000000 + internalID: -522367714226421056 + vertices: [] + indices: + edges: [] + weights: [] + outline: [] + customData: + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Sounds.meta b/Assets/Resources/Sounds.meta new file mode 100644 index 0000000..42448a2 --- /dev/null +++ b/Assets/Resources/Sounds.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1f762bc8c54d24bc38a9c08ae37e1861 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Sounds/click.mp3 b/Assets/Resources/Sounds/click.mp3 new file mode 100644 index 0000000..55953dd Binary files /dev/null and b/Assets/Resources/Sounds/click.mp3 differ diff --git a/Assets/Resources/Sounds/click.mp3.meta b/Assets/Resources/Sounds/click.mp3.meta new file mode 100644 index 0000000..43f194f --- /dev/null +++ b/Assets/Resources/Sounds/click.mp3.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 0f783190ab25e24deb41c3810d8bd910 +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/Resources/Sounds/death.mp3 b/Assets/Resources/Sounds/death.mp3 new file mode 100644 index 0000000..397056a Binary files /dev/null and b/Assets/Resources/Sounds/death.mp3 differ diff --git a/Assets/Resources/Sounds/death.mp3.meta b/Assets/Resources/Sounds/death.mp3.meta new file mode 100644 index 0000000..0d6506a --- /dev/null +++ b/Assets/Resources/Sounds/death.mp3.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: a534a6e5c2588e8468f392da95b4d051 +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/Resources/Sounds/win.mp3 b/Assets/Resources/Sounds/win.mp3 new file mode 100644 index 0000000..2abd4b2 Binary files /dev/null and b/Assets/Resources/Sounds/win.mp3 differ diff --git a/Assets/Resources/Sounds/win.mp3.meta b/Assets/Resources/Sounds/win.mp3.meta new file mode 100644 index 0000000..ca24f2c --- /dev/null +++ b/Assets/Resources/Sounds/win.mp3.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 01bc19d23f018f986bec98d64fb0c51b +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/EditorChoiceScene.unity b/Assets/Scenes/EditorChoiceScene.unity index e490538..f659b22 100644 --- a/Assets/Scenes/EditorChoiceScene.unity +++ b/Assets/Scenes/EditorChoiceScene.unity @@ -408,6 +408,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ef2acea012085a3bb9a981fc334afaec, type: 3} m_Name: m_EditorClassIdentifier: + sfxSource: {fileID: 1895261020} --- !u!114 &681324524 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1087,6 +1088,136 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: a1cd6b406f139414086355a222af717e, type: 3} m_Name: m_EditorClassIdentifier: + sfxSource: {fileID: 1895261020} +--- !u!1 &1895261019 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1895261021} + - component: {fileID: 1895261020} + m_Layer: 0 + m_Name: Sound + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!82 &1895261020 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1895261019} + 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!4 &1895261021 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1895261019} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 513.29504, y: 455.8944, z: -2.436951} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1985937862 GameObject: m_ObjectHideFlags: 0 @@ -1173,3 +1304,4 @@ SceneRoots: - {fileID: 1858033413} - {fileID: 585327055} - {fileID: 1985937865} + - {fileID: 1895261021} diff --git a/Assets/Scenes/HomeScene.unity b/Assets/Scenes/HomeScene.unity index ee1f95c..0ef81a1 100644 --- a/Assets/Scenes/HomeScene.unity +++ b/Assets/Scenes/HomeScene.unity @@ -463,6 +463,135 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 303285652} m_CullTransparentMesh: 1 +--- !u!1 &376463333 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 376463335} + - component: {fileID: 376463334} + m_Layer: 0 + m_Name: Sound + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!82 &376463334 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 376463333} + 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!4 &376463335 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 376463333} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 591.1148, y: 374.54196, z: 17.932013} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &481473973 GameObject: m_ObjectHideFlags: 0 @@ -1413,6 +1542,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: a1cd6b406f139414086355a222af717e, type: 3} m_Name: m_EditorClassIdentifier: + sfxSource: {fileID: 376463334} --- !u!1 &1899869498 GameObject: m_ObjectHideFlags: 0 @@ -1557,3 +1687,4 @@ SceneRoots: - {fileID: 481473977} - {fileID: 948896768} - {fileID: 1832520163} + - {fileID: 376463335} diff --git a/Assets/Scenes/ImportScene.unity b/Assets/Scenes/ImportScene.unity index a29eb1b..f9d81b4 100644 --- a/Assets/Scenes/ImportScene.unity +++ b/Assets/Scenes/ImportScene.unity @@ -849,6 +849,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ef2acea012085a3bb9a981fc334afaec, type: 3} m_Name: m_EditorClassIdentifier: + sfxSource: {fileID: 1646124753} --- !u!114 &955286180 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1048,6 +1049,135 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} +--- !u!1 &1646124752 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1646124754} + - component: {fileID: 1646124753} + m_Layer: 0 + m_Name: Sound + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!82 &1646124753 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1646124752} + 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!4 &1646124754 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1646124752} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 513.29504, y: 455.8944, z: -2.436951} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 @@ -1055,3 +1185,4 @@ SceneRoots: - {fileID: 837005990} - {fileID: 1442014941} - {fileID: 162069549} + - {fileID: 1646124754} diff --git a/Assets/Scenes/LevelEditorScene.unity b/Assets/Scenes/LevelEditorScene.unity index 07ebf99..4c18b9f 100644 --- a/Assets/Scenes/LevelEditorScene.unity +++ b/Assets/Scenes/LevelEditorScene.unity @@ -5128,6 +5128,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ebe0bd74200510d4aa75c327a76499c6, type: 3} m_Name: m_EditorClassIdentifier: + pauseMenu: {fileID: 0} + sfxSource: {fileID: 762457564} SpeedMultiplier: 1 --- !u!1 &333456214 GameObject: @@ -5313,6 +5315,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ef2acea012085a3bb9a981fc334afaec, type: 3} m_Name: m_EditorClassIdentifier: + sfxSource: {fileID: 762457564} --- !u!114 &590020934 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5467,7 +5470,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 2079131731516339571, guid: b83b54968fd22ff438fe127c168bebac, type: 3} + m_Sprite: {fileID: -522367714226421056, guid: 58314e7be35f3201e8f3d376508d5800, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -5929,6 +5932,135 @@ MonoBehaviour: shipMinYFollow: 6 smoothSpeed: 5 isPlaying: 0 +--- !u!1 &762457563 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 762457565} + - component: {fileID: 762457564} + m_Layer: 0 + m_Name: Sound + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!82 &762457564 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 762457563} + 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!4 &762457565 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 762457563} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 513.29504, y: 455.8944, z: -2.436951} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &782585331 GameObject: m_ObjectHideFlags: 0 @@ -6219,9 +6351,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: levelsLoader: {fileID: 0} - createMode: 0 editMode: 1 - audioSource: {fileID: 1479180208} + createMode: 0 + musicSource: {fileID: 0} progressionText: {fileID: 0} --- !u!4 &1479180210 Transform: @@ -6293,6 +6425,7 @@ MonoBehaviour: spawnPoint: {fileID: 0} editorUI: {fileID: 0} playerCamera: {fileID: 746393166} + sfxSource: {fileID: 0} --- !u!114 &1561821050 MonoBehaviour: m_ObjectHideFlags: 0 @@ -7093,3 +7226,4 @@ SceneRoots: - {fileID: 2030873961} - {fileID: 78453695} - {fileID: 1479180210} + - {fileID: 762457565} diff --git a/Assets/Scenes/LevelScene.unity b/Assets/Scenes/LevelScene.unity index e887183..29d96c0 100644 --- a/Assets/Scenes/LevelScene.unity +++ b/Assets/Scenes/LevelScene.unity @@ -6008,7 +6008,6 @@ MonoBehaviour: pauseButton: {fileID: 1038445495} levelLoader: {fileID: 1999482186} volumeSlider: {fileID: 6776934} - isPause: 0 --- !u!1 &988798827 GameObject: m_ObjectHideFlags: 0 @@ -6433,6 +6432,135 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1247869545 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1247869547} + - component: {fileID: 1247869546} + m_Layer: 0 + m_Name: Sound + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!82 &1247869546 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1247869545} + 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!4 &1247869547 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1247869545} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 8.485552, y: 2.2081068, z: -0.13737443} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1267397455 GameObject: m_ObjectHideFlags: 0 @@ -6564,6 +6692,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: pauseMenu: {fileID: 892725783} + sfxSource: {fileID: 1247869546} SpeedMultiplier: 1 --- !u!61 &1267397460 BoxCollider2D: @@ -7475,7 +7604,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: levelsLoader: {fileID: 0} - audioSource: {fileID: 1999482188} + editMode: 0 + createMode: 0 + musicSource: {fileID: 1999482188} progressionText: {fileID: 245275149} --- !u!4 &1999482187 Transform: @@ -7826,3 +7957,4 @@ SceneRoots: - {fileID: 521952202} - {fileID: 555497623} - {fileID: 496264820} + - {fileID: 1247869547} diff --git a/Assets/Scenes/SelectLevelScene.unity b/Assets/Scenes/SelectLevelScene.unity index 7b4eb5b..8a5aabe 100644 --- a/Assets/Scenes/SelectLevelScene.unity +++ b/Assets/Scenes/SelectLevelScene.unity @@ -438,6 +438,139 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &334972165 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 334972166} + - component: {fileID: 334972167} + m_Layer: 5 + m_Name: Sound + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &334972166 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 334972165} + 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: 1153106989} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!82 &334972167 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 334972165} + 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 &633505916 GameObject: m_ObjectHideFlags: 0 @@ -846,6 +979,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 2c53cba3260b30d02b79e69a3198546c, type: 3} m_Name: m_EditorClassIdentifier: + sfxSource: {fileID: 334972167} levelsLoader: {fileID: 0} --- !u!1 &1099679056 GameObject: @@ -992,6 +1126,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ef2acea012085a3bb9a981fc334afaec, type: 3} m_Name: m_EditorClassIdentifier: + sfxSource: {fileID: 334972167} --- !u!1 &1153106988 GameObject: m_ObjectHideFlags: 0 @@ -1031,6 +1166,7 @@ RectTransform: - {fileID: 760653959} - {fileID: 92159575} - {fileID: 1571276505} + - {fileID: 334972166} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -1246,6 +1382,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c34ef065650ba0802be580828cc0d474, type: 3} m_Name: m_EditorClassIdentifier: + sfxSource: {fileID: 334972167} levelsLoader: {fileID: 0} --- !u!1 &1571276504 GameObject: diff --git a/Assets/Scenes/SelectLevelToEditScene.unity b/Assets/Scenes/SelectLevelToEditScene.unity index b2dc635..c2fe750 100644 --- a/Assets/Scenes/SelectLevelToEditScene.unity +++ b/Assets/Scenes/SelectLevelToEditScene.unity @@ -419,6 +419,135 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 633505916} m_CullTransparentMesh: 1 +--- !u!1 &676309804 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 676309806} + - component: {fileID: 676309805} + m_Layer: 0 + m_Name: Sound + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!82 &676309805 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 676309804} + 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!4 &676309806 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 676309804} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 513.29504, y: 455.8944, z: -2.436951} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &954359120 GameObject: m_ObjectHideFlags: 0 @@ -658,6 +787,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 2c53cba3260b30d02b79e69a3198546c, type: 3} m_Name: m_EditorClassIdentifier: + sfxSource: {fileID: 676309805} levelsLoader: {fileID: 0} --- !u!1 &1099679056 GameObject: @@ -804,6 +934,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ef2acea012085a3bb9a981fc334afaec, type: 3} m_Name: m_EditorClassIdentifier: + sfxSource: {fileID: 676309805} --- !u!1 &1153106988 GameObject: m_ObjectHideFlags: 0 @@ -1055,6 +1186,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c34ef065650ba0802be580828cc0d474, type: 3} m_Name: m_EditorClassIdentifier: + sfxSource: {fileID: 676309805} levelsLoader: {fileID: 0} --- !u!1 &1975177171 GameObject: @@ -1087,6 +1219,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: a1cd6b406f139414086355a222af717e, type: 3} m_Name: m_EditorClassIdentifier: + sfxSource: {fileID: 0} --- !u!81 &1975177173 AudioListener: m_ObjectHideFlags: 0 @@ -1168,3 +1301,4 @@ SceneRoots: - {fileID: 1975177175} - {fileID: 1153106989} - {fileID: 276417674} + - {fileID: 676309806} diff --git a/Assets/AI.cs b/Assets/Scripts/AIToggle.cs similarity index 100% rename from Assets/AI.cs rename to Assets/Scripts/AIToggle.cs diff --git a/Assets/AI.cs.meta b/Assets/Scripts/AIToggle.cs.meta similarity index 100% rename from Assets/AI.cs.meta rename to Assets/Scripts/AIToggle.cs.meta diff --git a/Assets/Scripts/GameMode/NormalGameMode.cs b/Assets/Scripts/GameMode/NormalGameMode.cs index b6ddb06..e021367 100644 --- a/Assets/Scripts/GameMode/NormalGameMode.cs +++ b/Assets/Scripts/GameMode/NormalGameMode.cs @@ -1,10 +1,10 @@ +using System.IO; using UnityEngine; using UnityEngine.SceneManagement; public class NormalGameMode : IGameMode { - public bool editMode { get; set; } = false; private const float HorizontalSpeed = 8.6f; private const float JumpForce = 26.6581f; private const KeyCode JumpKey = KeyCode.Space; @@ -16,7 +16,6 @@ public class NormalGameMode : IGameMode { player.RigidBody.linearVelocity = new Vector2(HorizontalSpeed * player.SpeedMultiplier, player.RigidBody.linearVelocity.y); - if (player.IsColliding && Input.GetKey(JumpKey) && !isRotating) { Debug.Log("Player is Jumping"); @@ -88,27 +87,6 @@ public class NormalGameMode : IGameMode public void OnCollisionEnter(Player player, Collision2D collision) { player.IsColliding = true; - - if (collision.gameObject.CompareTag("Kill")) - { - if (editMode) - { - GameObject spawn = new GameObject("AutoSpawnPoint"); - spawn.transform.position = new Vector3(-16, -3, 0f); - player.transform.position = spawn.transform.position; - player.RigidBody.linearVelocity = Vector2.zero; - player.SpeedMultiplier = 1f; - } - else - { - SceneManager.LoadScene(SceneManager.GetActiveScene().name); - } - } - - if (collision.gameObject.CompareTag("Win")) - { - SceneManager.LoadScene("SelectLevelScene"); - } } public void OnCollisionExit(Player player, Collision2D collision) diff --git a/Assets/Scripts/GameMode/ShipGameMode.cs b/Assets/Scripts/GameMode/ShipGameMode.cs index 1cddfe0..8d3f9c0 100644 --- a/Assets/Scripts/GameMode/ShipGameMode.cs +++ b/Assets/Scripts/GameMode/ShipGameMode.cs @@ -1,3 +1,4 @@ +using System.IO; using UnityEngine; using UnityEngine.SceneManagement; @@ -67,17 +68,6 @@ public class ShipGameMode : IGameMode public void OnCollisionEnter(Player player, Collision2D collision) { - if (collision.gameObject.CompareTag("Kill")) - { - SceneManager.LoadScene(SceneManager.GetActiveScene().name); - return; - } - if (collision.gameObject.CompareTag("Win")) - { - SceneManager.LoadScene("HomeScene"); - return; - } - float currentAngle = GetCurrentZAngle(player); float shortestAngle = Mathf.DeltaAngle(currentAngle, 0); player.Transform.rotation = Quaternion.RotateTowards(player.Transform.rotation, Quaternion.Euler(0, 0, 0), Mathf.Abs(shortestAngle)); diff --git a/Assets/Scripts/LevelLoader.cs b/Assets/Scripts/LevelLoader.cs index d223b97..a48d6e5 100644 --- a/Assets/Scripts/LevelLoader.cs +++ b/Assets/Scripts/LevelLoader.cs @@ -7,7 +7,7 @@ public class LevelLoader : MonoBehaviour public LevelsLoader levelsLoader; public bool editMode; public bool createMode; - public AudioSource audioSource; + public AudioSource musicSource; public Text progressionText; private readonly float groundY = -6.034f; @@ -18,18 +18,18 @@ public class LevelLoader : MonoBehaviour private void LoadAudio() { - audioSource.clip = Resources.Load(Path.Combine("Musics", levelsLoader.levelCurrent.musicName)); + musicSource.clip = Resources.Load(Path.Combine("Musics", levelsLoader.levelCurrent.musicName)); if (PlayerPrefs.HasKey("Volume")) { - audioSource.volume = PlayerPrefs.GetFloat("Volume"); + musicSource.volume = PlayerPrefs.GetFloat("Volume"); } else { - audioSource.volume = 1f; + musicSource.volume = 1f; } - audioSource.Play(); + musicSource.Play(); } private void LoadElements() @@ -40,10 +40,10 @@ public class LevelLoader : MonoBehaviour GameObject prefab = GetPrefab(element.type); GameObject instance = Instantiate(prefab, new Vector3(element.x, element.y, 0), Quaternion.identity); - // if (prefab.CompareTag("Kill")) - // { - Instantiate(Resources.Load("AICollider"), new Vector3(element.x - 1, element.y, 0), Quaternion.identity); - // } + if (prefab.CompareTag("Kill")) + { + Instantiate(Resources.Load("AICollider"), new Vector3(element.x - 1, element.y, 0), Quaternion.identity); + } Vector3 originalScale = instance.transform.localScale; float newScaleX = element.scaleX > 0 ? element.scaleX : originalScale.x; diff --git a/Assets/Scripts/LevelsSelect/LevelHomeButton.cs b/Assets/Scripts/LevelsSelect/LevelHomeButton.cs index 8c598ad..e61ac40 100644 --- a/Assets/Scripts/LevelsSelect/LevelHomeButton.cs +++ b/Assets/Scripts/LevelsSelect/LevelHomeButton.cs @@ -1,12 +1,25 @@ +using System.Collections; +using System.IO; using UnityEngine; using UnityEngine.SceneManagement; public class LevelHomeButton : MonoBehaviour { + public AudioSource sfxSource; + + public static IEnumerator PlaySoundAndLoadScene(AudioSource sfxSource, string scene) + { + yield return new WaitWhile(() => sfxSource.isPlaying); + SceneManager.LoadScene(scene); + } + public void GoToHome() { PlayerPrefs.SetInt("CreateMode", 0); PlayerPrefs.SetInt("EditMode", 0); - SceneManager.LoadScene("HomeScene"); + + sfxSource.clip = Resources.Load(Path.Combine("Sounds", "click")); + sfxSource.Play(); + StartCoroutine(PlaySoundAndLoadScene(sfxSource, "HomeScene")); } } diff --git a/Assets/Scripts/LevelsSelect/LevelNextButton.cs b/Assets/Scripts/LevelsSelect/LevelNextButton.cs index c85343d..b170fa5 100644 --- a/Assets/Scripts/LevelsSelect/LevelNextButton.cs +++ b/Assets/Scripts/LevelsSelect/LevelNextButton.cs @@ -1,7 +1,9 @@ +using System.IO; using UnityEngine; public class LevelNextButton : MonoBehaviour { + public AudioSource sfxSource; public LevelsLoader levelsLoader; public void Start() @@ -20,5 +22,7 @@ public class LevelNextButton : MonoBehaviour public void NextLevel() { levelsLoader.NextLevel(); + sfxSource.clip = Resources.Load(Path.Combine("Sounds", "click")); + sfxSource.Play(); } } diff --git a/Assets/Scripts/LevelsSelect/LevelPreviousButton.cs b/Assets/Scripts/LevelsSelect/LevelPreviousButton.cs index dab713c..3ea3d79 100644 --- a/Assets/Scripts/LevelsSelect/LevelPreviousButton.cs +++ b/Assets/Scripts/LevelsSelect/LevelPreviousButton.cs @@ -1,7 +1,9 @@ +using System.IO; using UnityEngine; public class LevelPreviousButton : MonoBehaviour { + public AudioSource sfxSource; public LevelsLoader levelsLoader; public void Start() @@ -20,5 +22,7 @@ public class LevelPreviousButton : MonoBehaviour public void PreviousLevel() { levelsLoader.PreviousLevel(); + sfxSource.clip = Resources.Load(Path.Combine("Sounds", "click")); + sfxSource.Play(); } } diff --git a/Assets/Scripts/MainMenu.cs b/Assets/Scripts/MainMenu.cs index 56f5042..713c06f 100644 --- a/Assets/Scripts/MainMenu.cs +++ b/Assets/Scripts/MainMenu.cs @@ -1,16 +1,25 @@ +using System.IO; using UnityEngine; using UnityEngine.SceneManagement; public class MainMenu : MonoBehaviour { + public AudioSource sfxSource; + public void LaunchGame() { - SceneManager.LoadSceneAsync("SelectLevelScene"); + sfxSource.clip = Resources.Load(Path.Combine("Sounds", "click")); + sfxSource.Play(); + + StartCoroutine(LevelHomeButton.PlaySoundAndLoadScene(sfxSource, "SelectLevelScene")); } public void OpenImport() { - SceneManager.LoadSceneAsync("ImportScene"); + sfxSource.clip = Resources.Load(Path.Combine("Sounds", "click")); + sfxSource.Play(); + + StartCoroutine(LevelHomeButton.PlaySoundAndLoadScene(sfxSource, "ImportScene")); } public void QuitGame() @@ -20,22 +29,34 @@ public class MainMenu : MonoBehaviour public void LevelEditor() { - SceneManager.LoadSceneAsync("LevelEditorScene"); + sfxSource.clip = Resources.Load(Path.Combine("Sounds", "click")); + sfxSource.Play(); + + StartCoroutine(LevelHomeButton.PlaySoundAndLoadScene(sfxSource, "LevelEditorScene")); } public void CreateVoidLevel() { PlayerPrefs.SetInt("CreateMode", 1); - SceneManager.LoadScene("LevelEditorScene"); + sfxSource.clip = Resources.Load(Path.Combine("Sounds", "click")); + sfxSource.Play(); + + StartCoroutine(LevelHomeButton.PlaySoundAndLoadScene(sfxSource, "LevelEditorScene")); } public void EditorChoice() { - SceneManager.LoadSceneAsync("EditorChoiceScene"); + sfxSource.clip = Resources.Load(Path.Combine("Sounds", "click")); + sfxSource.Play(); + + StartCoroutine(LevelHomeButton.PlaySoundAndLoadScene(sfxSource, "EditorChoiceScene")); } public void EditLevel() { - SceneManager.LoadSceneAsync("SelectLevelToEditScene"); + sfxSource.clip = Resources.Load(Path.Combine("Sounds", "click")); + sfxSource.Play(); + + StartCoroutine(LevelHomeButton.PlaySoundAndLoadScene(sfxSource, "SelectLevelToEditScene")); } } diff --git a/Assets/Scripts/PauseMenu.cs b/Assets/Scripts/PauseMenu.cs index 88ef849..620363a 100644 --- a/Assets/Scripts/PauseMenu.cs +++ b/Assets/Scripts/PauseMenu.cs @@ -13,26 +13,26 @@ public class PauseMenu : MonoBehaviour { if (PlayerPrefs.HasKey("Volume")) { - levelLoader.audioSource.volume = PlayerPrefs.GetFloat("Volume"); - volumeSlider.value = levelLoader.audioSource.volume; + levelLoader.musicSource.volume = PlayerPrefs.GetFloat("Volume"); + volumeSlider.value = levelLoader.musicSource.volume; } else { - levelLoader.audioSource.volume = 1f; + levelLoader.musicSource.volume = 1f; volumeSlider.value = 1f; } } public void ChangeVolume() { - levelLoader.audioSource.volume = volumeSlider.value; - PlayerPrefs.SetFloat("Volume", levelLoader.audioSource.volume); + levelLoader.musicSource.volume = volumeSlider.value; + PlayerPrefs.SetFloat("Volume", levelLoader.musicSource.volume); } public void Pause() { Time.timeScale = 0; - levelLoader.audioSource.Pause(); + levelLoader.musicSource.Pause(); pauseMenu.SetActive(true); pauseButton.SetActive(false); @@ -47,7 +47,7 @@ public class PauseMenu : MonoBehaviour public void Resume() { Time.timeScale = 1; - levelLoader.audioSource.Play(); + levelLoader.musicSource.Play(); pauseMenu.SetActive(false); pauseButton.SetActive(true); diff --git a/Assets/Scripts/Player.cs b/Assets/Scripts/Player.cs index 5a819e5..bc88a92 100644 --- a/Assets/Scripts/Player.cs +++ b/Assets/Scripts/Player.cs @@ -1,3 +1,4 @@ +using System.IO; using UnityEngine; using UnityEngine.SceneManagement; @@ -12,6 +13,8 @@ public class Player : MonoBehaviour public bool HasStarted { get; set; } = false; public bool CanJump { get; set; } = true; public PauseMenu pauseMenu; + public AudioSource sfxSource; + public bool editMode { get; set; } = false; public IGameMode CurrentGameMode { get; set; } public float SpeedMultiplier = 1f; @@ -87,6 +90,31 @@ public class Player : MonoBehaviour public virtual void OnCollisionEnter2D(Collision2D collision) { CurrentGameMode?.OnCollisionEnter(this, collision); + + if (collision.gameObject.CompareTag("Kill")) + { + if (editMode) + { + GameObject spawn = new GameObject("AutoSpawnPoint"); + spawn.transform.position = new Vector3(-16, -3, 0f); + transform.position = spawn.transform.position; + RigidBody.linearVelocity = Vector2.zero; + SpeedMultiplier = 1f; + } + else + { + sfxSource.clip = Resources.Load(Path.Combine("Sounds", "death")); + sfxSource.Play(); + StartCoroutine(LevelHomeButton.PlaySoundAndLoadScene(sfxSource, SceneManager.GetActiveScene().name)); + } + } + + if (collision.gameObject.CompareTag("Win")) + { + sfxSource.clip = Resources.Load(Path.Combine("Sounds", "win")); + sfxSource.Play(); + StartCoroutine(LevelHomeButton.PlaySoundAndLoadScene(sfxSource, "SelectLevelScene")); + } } public void OnCollisionExit2D(Collision2D collision) diff --git a/Assets/Scripts/TestManager.cs b/Assets/Scripts/TestManager.cs index 89344e7..ccd1a94 100644 --- a/Assets/Scripts/TestManager.cs +++ b/Assets/Scripts/TestManager.cs @@ -8,6 +8,7 @@ public class TestManager : MonoBehaviour public Transform spawnPoint; public GameObject editorUI; public PlayerCamera playerCamera; + public AudioSource sfxSource; private bool isTesting = false; @@ -27,7 +28,7 @@ public class TestManager : MonoBehaviour else { gameMode = new NormalGameMode(); - ((NormalGameMode)gameMode).editMode = true; + currentPlayer.editMode = true; currentPlayer.ChangeGameMode(gameMode); currentPlayer.SpeedMultiplier = 0f;