diff --git a/Assets/Prefabs/Enemies/Basic Enemy.prefab b/Assets/Prefabs/Enemies/Basic Enemy.prefab index 964b694..7ec52e9 100644 --- a/Assets/Prefabs/Enemies/Basic Enemy.prefab +++ b/Assets/Prefabs/Enemies/Basic Enemy.prefab @@ -353,7 +353,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: flashDuration: 0.1 - flashColor: {r: 1.6817929, g: 1.6817929, b: 1.6817929, a: 1} + flashColor: {r: 1.8443027, g: 1.8443027, b: 1.8443027, a: 1} health: {fileID: 9093693903318130491} spriteRenderer: {fileID: 987872320002065258} --- !u!1 &3667932760953165253 diff --git a/Assets/Scenes/SampleScene.unity.meta b/Assets/SFX.meta similarity index 67% rename from Assets/Scenes/SampleScene.unity.meta rename to Assets/SFX.meta index 963ff8e..2891c14 100644 --- a/Assets/Scenes/SampleScene.unity.meta +++ b/Assets/SFX.meta @@ -1,5 +1,6 @@ fileFormatVersion: 2 -guid: 8c9cfa26abfee488c85f1582747f6a02 +guid: 71c2ffa8ab3889b35a32f703aa84e579 +folderAsset: yes DefaultImporter: externalObjects: {} userData: diff --git a/Assets/SFX/GS2_Item_Acquire_1.ogg b/Assets/SFX/GS2_Item_Acquire_1.ogg new file mode 100644 index 0000000..35ca4b6 Binary files /dev/null and b/Assets/SFX/GS2_Item_Acquire_1.ogg differ diff --git a/Assets/SFX/GS2_Item_Acquire_1.ogg.meta b/Assets/SFX/GS2_Item_Acquire_1.ogg.meta new file mode 100644 index 0000000..d68990f --- /dev/null +++ b/Assets/SFX/GS2_Item_Acquire_1.ogg.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 444cc6b67923f34b8958ef9106af4c1c +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/SampleScene.unity b/Assets/Scenes/SampleScene.unity deleted file mode 100644 index 7b420f6..0000000 --- a/Assets/Scenes/SampleScene.unity +++ /dev/null @@ -1,352 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -OcclusionCullingSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 - m_SceneGUID: 00000000000000000000000000000000 - m_OcclusionCullingData: {fileID: 0} ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 9 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - m_FogMode: 3 - m_FogDensity: 0.01 - m_LinearFogStart: 0 - m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} - m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} - m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} - m_AmbientIntensity: 1 - m_AmbientMode: 3 - m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} - m_SkyboxMaterial: {fileID: 0} - m_HaloStrength: 0.5 - m_FlareStrength: 1 - m_FlareFadeSpeed: 3 - m_HaloTexture: {fileID: 0} - m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} - m_DefaultReflectionMode: 0 - m_DefaultReflectionResolution: 128 - m_ReflectionBounces: 1 - m_ReflectionIntensity: 1 - m_CustomReflection: {fileID: 0} - m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} - m_UseRadianceAmbientProbe: 0 ---- !u!157 &3 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 12 - m_GIWorkflowMode: 1 - m_GISettings: - serializedVersion: 2 - m_BounceScale: 1 - m_IndirectOutputScale: 1 - m_AlbedoBoost: 1 - m_EnvironmentLightingMode: 0 - m_EnableBakedLightmaps: 0 - m_EnableRealtimeLightmaps: 0 - m_LightmapEditorSettings: - serializedVersion: 12 - m_Resolution: 2 - m_BakeResolution: 40 - m_AtlasSize: 1024 - m_AO: 0 - m_AOMaxDistance: 1 - m_CompAOExponent: 1 - m_CompAOExponentDirect: 0 - m_ExtractAmbientOcclusion: 0 - m_Padding: 2 - m_LightmapParameters: {fileID: 0} - m_LightmapsBakeMode: 1 - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 256 - m_ReflectionCompression: 2 - m_MixedBakeMode: 2 - m_BakeBackend: 1 - m_PVRSampling: 1 - m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 512 - m_PVRBounces: 2 - m_PVREnvironmentSampleCount: 256 - m_PVREnvironmentReferencePointCount: 2048 - m_PVRFilteringMode: 1 - m_PVRDenoiserTypeDirect: 1 - m_PVRDenoiserTypeIndirect: 1 - m_PVRDenoiserTypeAO: 1 - m_PVRFilterTypeDirect: 0 - m_PVRFilterTypeIndirect: 0 - m_PVRFilterTypeAO: 0 - m_PVREnvironmentMIS: 1 - m_PVRCulling: 1 - m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 5 - m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousPositionSigmaDirect: 0.5 - m_PVRFilteringAtrousPositionSigmaIndirect: 2 - m_PVRFilteringAtrousPositionSigmaAO: 1 - m_ExportTrainingData: 0 - m_TrainingDataDestination: TrainingData - m_LightProbeSampleCountMultiplier: 4 - m_LightingDataAsset: {fileID: 0} - m_LightingSettings: {fileID: 0} ---- !u!196 &4 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentTypeID: 0 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - minRegionArea: 2 - manualCellSize: 0 - cellSize: 0.16666667 - manualTileSize: 0 - tileSize: 256 - accuratePlacement: 0 - maxJobWorkers: 0 - preserveTilesOutsideBounds: 0 - debug: - m_Flags: 0 - m_NavMeshData: {fileID: 0} ---- !u!1 &519420028 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 519420032} - - component: {fileID: 519420031} - - component: {fileID: 519420029} - - component: {fileID: 519420030} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &519420029 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 519420028} - m_Enabled: 1 ---- !u!114 &519420030 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 519420028} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_RenderShadows: 1 - m_RequiresDepthTextureOption: 2 - m_RequiresOpaqueTextureOption: 2 - m_CameraType: 0 - m_Cameras: [] - m_RendererIndex: -1 - m_VolumeLayerMask: - serializedVersion: 2 - m_Bits: 1 - m_VolumeTrigger: {fileID: 0} - m_RenderPostProcessing: 0 - m_Antialiasing: 0 - m_AntialiasingQuality: 2 - m_StopNaN: 0 - m_Dithering: 0 - m_ClearDepth: 1 - m_AllowXRRendering: 1 - m_RequiresDepthTexture: 0 - m_RequiresColorTexture: 0 - m_Version: 2 ---- !u!20 &519420031 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 519420028} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 2 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 34 - orthographic: 1 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 0 - m_HDR: 1 - m_AllowMSAA: 0 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 0 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &519420032 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 519420028} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &619394800 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 619394802} - - component: {fileID: 619394801} - m_Layer: 0 - m_Name: Global Light 2D - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &619394801 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 619394800} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 073797afb82c5a1438f328866b10b3f0, type: 3} - m_Name: - m_EditorClassIdentifier: - m_ComponentVersion: 1 - m_LightType: 4 - m_BlendStyleIndex: 0 - m_FalloffIntensity: 0.5 - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Intensity: 1 - m_LightVolumeIntensity: 1 - m_LightVolumeIntensityEnabled: 0 - m_ApplyToSortingLayers: 00000000 - m_LightCookieSprite: {fileID: 0} - m_DeprecatedPointLightCookieSprite: {fileID: 0} - m_LightOrder: 0 - m_OverlapOperation: 0 - m_NormalMapDistance: 3 - m_NormalMapQuality: 2 - m_UseNormalMap: 0 - m_ShadowIntensityEnabled: 0 - m_ShadowIntensity: 0.75 - m_ShadowVolumeIntensityEnabled: 0 - m_ShadowVolumeIntensity: 0.75 - m_Vertices: - - position: {x: 0.9985302, y: 0.9985302, z: 0} - color: {r: 0.70710677, g: 0.70710677, b: 0, a: 0} - uv: {x: 0, y: 0} - - position: {x: 0.9985302, y: 0.9985302, z: 0} - color: {r: 0, g: 0, b: 0, a: 1} - uv: {x: 0, y: 0} - - position: {x: -0.9985302, y: 0.9985302, z: 0} - color: {r: -0.70710677, g: 0.70710677, b: 0, a: 0} - uv: {x: 0, y: 0} - - position: {x: -0.9985302, y: 0.9985302, z: 0} - color: {r: 0, g: 0, b: 0, a: 1} - uv: {x: 0, y: 0} - - position: {x: -0.99853003, y: -0.9985304, z: 0} - color: {r: -0.70710665, g: -0.7071069, b: 0, a: 0} - uv: {x: 0, y: 0} - - position: {x: -0.99853003, y: -0.9985304, z: 0} - color: {r: 0, g: 0, b: 0, a: 1} - uv: {x: 0, y: 0} - - position: {x: 0.99853003, y: -0.9985304, z: 0} - color: {r: 0.70710665, g: -0.7071069, b: 0, a: 0} - uv: {x: 0, y: 0} - - position: {x: 0.99853003, y: -0.9985304, z: 0} - color: {r: 0, g: 0, b: 0, a: 1} - uv: {x: 0, y: 0} - - position: {x: 0, y: 0, z: 0} - color: {r: 0, g: 0, b: 0, a: 1} - uv: {x: 0, y: 0} - m_Triangles: 030001000800020000000100030002000100050003000800040002000300050004000300070005000800060004000500070006000500010007000800000006000700010000000700 - m_LocalBounds: - m_Center: {x: 0, y: -0.00000011920929, z: 0} - m_Extent: {x: 0.9985302, y: 0.99853027, z: 0} - m_PointLightInnerAngle: 360 - m_PointLightOuterAngle: 360 - m_PointLightInnerRadius: 0 - m_PointLightOuterRadius: 1 - m_ShapeLightParametricSides: 5 - m_ShapeLightParametricAngleOffset: 0 - m_ShapeLightParametricRadius: 1 - m_ShapeLightFalloffSize: 0.5 - m_ShapeLightFalloffOffset: {x: 0, y: 0} - m_ShapePath: - - {x: -0.5, y: -0.5, z: 0} - - {x: 0.5, y: -0.5, z: 0} - - {x: 0.5, y: 0.5, z: 0} - - {x: -0.5, y: 0.5, z: 0} ---- !u!4 &619394802 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 619394800} - 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: 0} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scenes/main.unity b/Assets/Scenes/main.unity index 71969ec..6fcbd6d 100644 --- a/Assets/Scenes/main.unity +++ b/Assets/Scenes/main.unity @@ -6947,6 +6947,7 @@ GameObject: - component: {fileID: 1261447609} - component: {fileID: 1261447613} - component: {fileID: 1261447614} + - component: {fileID: 1261447615} m_Layer: 6 m_Name: Player m_TagString: Player @@ -7213,9 +7214,25 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: flashDuration: 0.1 - flashColor: {r: 1.6934906, g: 1.6934906, b: 1.6934906, a: 1} + flashColor: {r: 1.7207953, g: 1.7207953, b: 1.7207953, a: 1} health: {fileID: 1261447608} spriteRenderer: {fileID: 628985992} +--- !u!114 &1261447615 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1261447599} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6dd1de1bc65a4912a543ebc7230f4ae6, type: 3} + m_Name: + m_EditorClassIdentifier: + globalVolume: {fileID: 1265960067} + health: {fileID: 1261447608} + postProcessDuration: 0.5 + vignetteHitIntensity: 0.3 --- !u!1 &1265960066 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/main/Global Volume Profile.asset b/Assets/Scenes/main/Global Volume Profile.asset index 2964914..c99566e 100644 --- a/Assets/Scenes/main/Global Volume Profile.asset +++ b/Assets/Scenes/main/Global Volume Profile.asset @@ -84,7 +84,7 @@ MonoBehaviour: m_Value: {x: 0.5, y: 0.5} intensity: m_OverrideState: 1 - m_Value: 0.543 + m_Value: 0.2 smoothness: m_OverrideState: 1 m_Value: 0.18 diff --git a/Assets/Scripts/Systems/DamageFlash.cs b/Assets/Scripts/Systems/DamageFlash.cs index dd9ee9f..3a92709 100644 --- a/Assets/Scripts/Systems/DamageFlash.cs +++ b/Assets/Scripts/Systems/DamageFlash.cs @@ -10,7 +10,6 @@ namespace Systems private static readonly int MarkerFlashColor = Shader.PropertyToID("_FlashColor"); private static readonly int MarkerFlashAmount = Shader.PropertyToID("_FlashAmount"); private Material material; - private Coroutine damageFlashCoroutine; [SerializeField] private float flashDuration; [ColorUsage(true, true)][SerializeField] private Color flashColor = Color.white; @@ -38,7 +37,7 @@ namespace Systems private void OnHit() { - damageFlashCoroutine = StartCoroutine(Flash()); + StartCoroutine(Flash()); } private IEnumerator Flash() diff --git a/Assets/Scripts/Systems/DamagePostProcess.cs b/Assets/Scripts/Systems/DamagePostProcess.cs new file mode 100644 index 0000000..bb99b30 --- /dev/null +++ b/Assets/Scripts/Systems/DamagePostProcess.cs @@ -0,0 +1,66 @@ +using System.Collections; +using KBCore.Refs; +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Rendering.Universal; + +namespace Systems +{ + public class DamagePostProcess : MonoBehaviour + { + private float ogVignetteIntensity; + private Coroutine runningEffect; + + [SerializeField, Scene] private Volume globalVolume; + [SerializeField, Self] private Health health; + [SerializeField] private float postProcessDuration = 0.5f; + + [SerializeField] private float vignetteHitIntensity = 0.5f; + + private void OnEnable() + { + health.OnTakeDamage += OnHit; + } + + private void OnDisable() + { + health.OnTakeDamage -= OnHit; + } + + private void OnHit() + { + if (runningEffect != null) StopCoroutine(runningEffect); + + runningEffect = StartCoroutine(ApplyPostProcessEffect()); + } + + private IEnumerator ApplyPostProcessEffect() + { + if (!globalVolume) yield break; + + if (!globalVolume.profile.TryGet(out var vignette)) + yield break; + + ogVignetteIntensity = vignette.intensity.value; + globalVolume.profile.TryGet(out var chromaticAberration); + + vignette.intensity.value = vignetteHitIntensity; + if (chromaticAberration) chromaticAberration.active = true; + + yield return new WaitForSeconds(postProcessDuration); + + float fade = 0f, fadeDuration = 0.25f; + while (fade < fadeDuration) + { + fade += Time.deltaTime; + vignette.intensity.value = Mathf.Lerp(vignetteHitIntensity, ogVignetteIntensity, fade / fadeDuration); + yield return null; + } + + vignette.intensity.value = ogVignetteIntensity; + if (chromaticAberration) chromaticAberration.active = false; + + runningEffect = null; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Systems/DamagePostProcess.cs.meta b/Assets/Scripts/Systems/DamagePostProcess.cs.meta new file mode 100644 index 0000000..f87513f --- /dev/null +++ b/Assets/Scripts/Systems/DamagePostProcess.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6dd1de1bc65a4912a543ebc7230f4ae6 +timeCreated: 1752337882 \ No newline at end of file diff --git a/Assets/Shaders/HitFlashMat.mat b/Assets/Shaders/HitFlashMat.mat index 349ff55..44574bc 100644 --- a/Assets/Shaders/HitFlashMat.mat +++ b/Assets/Shaders/HitFlashMat.mat @@ -43,7 +43,7 @@ Material: m_Floats: - _FlashAmount: 0 m_Colors: - - _FlashColor: {r: 2, g: 2, b: 2, a: 1} + - _FlashColor: {r: 1.7207953, g: 1.7207953, b: 1.7207953, a: 1} m_BuildTextureStacks: [] m_AllowLocking: 1 --- !u!114 &8597859836182365986