Commit bb3fa8f0 authored by Abdulrahman Mohammed's avatar Abdulrahman Mohammed

Fix player cannot increase after increased

parent f6219ff7
...@@ -12,8 +12,8 @@ MonoBehaviour: ...@@ -12,8 +12,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3} m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3}
m_Name: URP-Balanced m_Name: URP-Balanced
m_EditorClassIdentifier: m_EditorClassIdentifier:
k_AssetVersion: 9 k_AssetVersion: 11
k_AssetPreviousVersion: 9 k_AssetPreviousVersion: 11
m_RendererType: 1 m_RendererType: 1
m_RendererData: {fileID: 0} m_RendererData: {fileID: 0}
m_RendererDataList: m_RendererDataList:
...@@ -23,10 +23,16 @@ MonoBehaviour: ...@@ -23,10 +23,16 @@ MonoBehaviour:
m_RequireOpaqueTexture: 0 m_RequireOpaqueTexture: 0
m_OpaqueDownsampling: 1 m_OpaqueDownsampling: 1
m_SupportsTerrainHoles: 1 m_SupportsTerrainHoles: 1
m_StoreActionsOptimization: 0
m_SupportsHDR: 1 m_SupportsHDR: 1
m_HDRColorBufferPrecision: 0
m_MSAA: 1 m_MSAA: 1
m_RenderScale: 1 m_RenderScale: 1
m_UpscalingFilter: 0
m_FsrOverrideSharpness: 0
m_FsrSharpness: 0.92
m_EnableLODCrossFade: 1
m_LODCrossFadeDitheringType: 1
m_ShEvalMode: 0
m_MainLightRenderingMode: 1 m_MainLightRenderingMode: 1
m_MainLightShadowsSupported: 1 m_MainLightShadowsSupported: 1
m_MainLightShadowmapResolution: 1024 m_MainLightShadowmapResolution: 1024
...@@ -47,23 +53,62 @@ MonoBehaviour: ...@@ -47,23 +53,62 @@ MonoBehaviour:
m_CascadeBorder: 0.1 m_CascadeBorder: 0.1
m_ShadowDepthBias: 1 m_ShadowDepthBias: 1
m_ShadowNormalBias: 1 m_ShadowNormalBias: 1
m_AnyShadowsSupported: 1
m_SoftShadowsSupported: 1 m_SoftShadowsSupported: 1
m_ConservativeEnclosingSphere: 0
m_NumIterationsEnclosingSphere: 64
m_SoftShadowQuality: 2
m_AdditionalLightsCookieResolution: 512 m_AdditionalLightsCookieResolution: 512
m_AdditionalLightsCookieFormat: 1 m_AdditionalLightsCookieFormat: 1
m_UseSRPBatcher: 1 m_UseSRPBatcher: 1
m_SupportsDynamicBatching: 0 m_SupportsDynamicBatching: 0
m_MixedLightingSupported: 1 m_MixedLightingSupported: 1
m_SupportsLightCookies: 1
m_SupportsLightLayers: 0 m_SupportsLightLayers: 0
m_DebugLevel: 0 m_DebugLevel: 0
m_StoreActionsOptimization: 0
m_EnableRenderGraph: 0
m_UseAdaptivePerformance: 1 m_UseAdaptivePerformance: 1
m_ColorGradingMode: 0 m_ColorGradingMode: 0
m_ColorGradingLutSize: 32 m_ColorGradingLutSize: 32
m_UseFastSRGBLinearConversion: 0 m_UseFastSRGBLinearConversion: 0
m_SupportDataDrivenLensFlare: 1
m_ShadowType: 1 m_ShadowType: 1
m_LocalShadowsSupported: 0 m_LocalShadowsSupported: 0
m_LocalShadowsAtlasResolution: 256 m_LocalShadowsAtlasResolution: 256
m_MaxPixelLights: 0 m_MaxPixelLights: 0
m_ShadowAtlasResolution: 256 m_ShadowAtlasResolution: 256
m_ShaderVariantLogLevel: 0
m_VolumeFrameworkUpdateMode: 0 m_VolumeFrameworkUpdateMode: 0
m_Textures:
blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3}
bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3}
m_PrefilteringModeMainLightShadows: 3
m_PrefilteringModeAdditionalLight: 3
m_PrefilteringModeAdditionalLightShadows: 0
m_PrefilterXRKeywords: 1
m_PrefilteringModeForwardPlus: 0
m_PrefilteringModeDeferredRendering: 0
m_PrefilteringModeScreenSpaceOcclusion: 2
m_PrefilterDebugKeywords: 1
m_PrefilterWriteRenderingLayers: 1
m_PrefilterHDROutput: 1
m_PrefilterSSAODepthNormals: 1
m_PrefilterSSAOSourceDepthLow: 0
m_PrefilterSSAOSourceDepthMedium: 1
m_PrefilterSSAOSourceDepthHigh: 1
m_PrefilterSSAOInterleaved: 0
m_PrefilterSSAOBlueNoise: 1
m_PrefilterSSAOSampleCountLow: 0
m_PrefilterSSAOSampleCountMedium: 1
m_PrefilterSSAOSampleCountHigh: 1
m_PrefilterDBufferMRT1: 1
m_PrefilterDBufferMRT2: 1
m_PrefilterDBufferMRT3: 1
m_PrefilterSoftShadowsQualityLow: 1
m_PrefilterSoftShadowsQualityMedium: 1
m_PrefilterSoftShadowsQualityHigh: 1
m_PrefilterSoftShadows: 0
m_PrefilterScreenCoord: 1
m_PrefilterNativeRenderPass: 1
m_ShaderVariantLogLevel: 0
m_ShadowCascades: 0 m_ShadowCascades: 0
...@@ -82,33 +82,33 @@ MonoBehaviour: ...@@ -82,33 +82,33 @@ MonoBehaviour:
m_Textures: m_Textures:
blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3} blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3}
bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3} bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3}
m_PrefilteringModeMainLightShadows: 1 m_PrefilteringModeMainLightShadows: 3
m_PrefilteringModeAdditionalLight: 4 m_PrefilteringModeAdditionalLight: 3
m_PrefilteringModeAdditionalLightShadows: 1 m_PrefilteringModeAdditionalLightShadows: 2
m_PrefilterXRKeywords: 0 m_PrefilterXRKeywords: 1
m_PrefilteringModeForwardPlus: 1 m_PrefilteringModeForwardPlus: 0
m_PrefilteringModeDeferredRendering: 1 m_PrefilteringModeDeferredRendering: 0
m_PrefilteringModeScreenSpaceOcclusion: 1 m_PrefilteringModeScreenSpaceOcclusion: 2
m_PrefilterDebugKeywords: 0 m_PrefilterDebugKeywords: 1
m_PrefilterWriteRenderingLayers: 0 m_PrefilterWriteRenderingLayers: 1
m_PrefilterHDROutput: 0 m_PrefilterHDROutput: 1
m_PrefilterSSAODepthNormals: 0 m_PrefilterSSAODepthNormals: 0
m_PrefilterSSAOSourceDepthLow: 0 m_PrefilterSSAOSourceDepthLow: 1
m_PrefilterSSAOSourceDepthMedium: 0 m_PrefilterSSAOSourceDepthMedium: 1
m_PrefilterSSAOSourceDepthHigh: 0 m_PrefilterSSAOSourceDepthHigh: 1
m_PrefilterSSAOInterleaved: 0 m_PrefilterSSAOInterleaved: 0
m_PrefilterSSAOBlueNoise: 0 m_PrefilterSSAOBlueNoise: 1
m_PrefilterSSAOSampleCountLow: 0 m_PrefilterSSAOSampleCountLow: 1
m_PrefilterSSAOSampleCountMedium: 0 m_PrefilterSSAOSampleCountMedium: 1
m_PrefilterSSAOSampleCountHigh: 0 m_PrefilterSSAOSampleCountHigh: 0
m_PrefilterDBufferMRT1: 0 m_PrefilterDBufferMRT1: 1
m_PrefilterDBufferMRT2: 0 m_PrefilterDBufferMRT2: 1
m_PrefilterDBufferMRT3: 0 m_PrefilterDBufferMRT3: 1
m_PrefilterSoftShadowsQualityLow: 0 m_PrefilterSoftShadowsQualityLow: 1
m_PrefilterSoftShadowsQualityMedium: 0 m_PrefilterSoftShadowsQualityMedium: 1
m_PrefilterSoftShadowsQualityHigh: 0 m_PrefilterSoftShadowsQualityHigh: 1
m_PrefilterSoftShadows: 0 m_PrefilterSoftShadows: 0
m_PrefilterScreenCoord: 0 m_PrefilterScreenCoord: 1
m_PrefilterNativeRenderPass: 0 m_PrefilterNativeRenderPass: 1
m_ShaderVariantLogLevel: 0 m_ShaderVariantLogLevel: 0
m_ShadowCascades: 1 m_ShadowCascades: 1
...@@ -12,8 +12,8 @@ MonoBehaviour: ...@@ -12,8 +12,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3} m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3}
m_Name: URP-Performant m_Name: URP-Performant
m_EditorClassIdentifier: m_EditorClassIdentifier:
k_AssetVersion: 9 k_AssetVersion: 11
k_AssetPreviousVersion: 9 k_AssetPreviousVersion: 11
m_RendererType: 1 m_RendererType: 1
m_RendererData: {fileID: 0} m_RendererData: {fileID: 0}
m_RendererDataList: m_RendererDataList:
...@@ -23,10 +23,16 @@ MonoBehaviour: ...@@ -23,10 +23,16 @@ MonoBehaviour:
m_RequireOpaqueTexture: 0 m_RequireOpaqueTexture: 0
m_OpaqueDownsampling: 1 m_OpaqueDownsampling: 1
m_SupportsTerrainHoles: 1 m_SupportsTerrainHoles: 1
m_StoreActionsOptimization: 0
m_SupportsHDR: 0 m_SupportsHDR: 0
m_HDRColorBufferPrecision: 0
m_MSAA: 1 m_MSAA: 1
m_RenderScale: 1 m_RenderScale: 1
m_UpscalingFilter: 0
m_FsrOverrideSharpness: 0
m_FsrSharpness: 0.92
m_EnableLODCrossFade: 1
m_LODCrossFadeDitheringType: 1
m_ShEvalMode: 0
m_MainLightRenderingMode: 1 m_MainLightRenderingMode: 1
m_MainLightShadowsSupported: 0 m_MainLightShadowsSupported: 0
m_MainLightShadowmapResolution: 1024 m_MainLightShadowmapResolution: 1024
...@@ -47,23 +53,62 @@ MonoBehaviour: ...@@ -47,23 +53,62 @@ MonoBehaviour:
m_CascadeBorder: 0.1 m_CascadeBorder: 0.1
m_ShadowDepthBias: 1 m_ShadowDepthBias: 1
m_ShadowNormalBias: 1 m_ShadowNormalBias: 1
m_AnyShadowsSupported: 1
m_SoftShadowsSupported: 0 m_SoftShadowsSupported: 0
m_ConservativeEnclosingSphere: 0
m_NumIterationsEnclosingSphere: 64
m_SoftShadowQuality: 2
m_AdditionalLightsCookieResolution: 2048 m_AdditionalLightsCookieResolution: 2048
m_AdditionalLightsCookieFormat: 3 m_AdditionalLightsCookieFormat: 3
m_UseSRPBatcher: 1 m_UseSRPBatcher: 1
m_SupportsDynamicBatching: 0 m_SupportsDynamicBatching: 0
m_MixedLightingSupported: 1 m_MixedLightingSupported: 1
m_SupportsLightCookies: 1
m_SupportsLightLayers: 0 m_SupportsLightLayers: 0
m_DebugLevel: 0 m_DebugLevel: 0
m_StoreActionsOptimization: 0
m_EnableRenderGraph: 0
m_UseAdaptivePerformance: 1 m_UseAdaptivePerformance: 1
m_ColorGradingMode: 0 m_ColorGradingMode: 0
m_ColorGradingLutSize: 16 m_ColorGradingLutSize: 16
m_UseFastSRGBLinearConversion: 0 m_UseFastSRGBLinearConversion: 0
m_SupportDataDrivenLensFlare: 1
m_ShadowType: 1 m_ShadowType: 1
m_LocalShadowsSupported: 0 m_LocalShadowsSupported: 0
m_LocalShadowsAtlasResolution: 256 m_LocalShadowsAtlasResolution: 256
m_MaxPixelLights: 0 m_MaxPixelLights: 0
m_ShadowAtlasResolution: 256 m_ShadowAtlasResolution: 256
m_ShaderVariantLogLevel: 0
m_VolumeFrameworkUpdateMode: 0 m_VolumeFrameworkUpdateMode: 0
m_Textures:
blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3}
bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3}
m_PrefilteringModeMainLightShadows: 0
m_PrefilteringModeAdditionalLight: 0
m_PrefilteringModeAdditionalLightShadows: 0
m_PrefilterXRKeywords: 1
m_PrefilteringModeForwardPlus: 0
m_PrefilteringModeDeferredRendering: 0
m_PrefilteringModeScreenSpaceOcclusion: 0
m_PrefilterDebugKeywords: 1
m_PrefilterWriteRenderingLayers: 1
m_PrefilterHDROutput: 1
m_PrefilterSSAODepthNormals: 1
m_PrefilterSSAOSourceDepthLow: 1
m_PrefilterSSAOSourceDepthMedium: 1
m_PrefilterSSAOSourceDepthHigh: 1
m_PrefilterSSAOInterleaved: 1
m_PrefilterSSAOBlueNoise: 1
m_PrefilterSSAOSampleCountLow: 1
m_PrefilterSSAOSampleCountMedium: 1
m_PrefilterSSAOSampleCountHigh: 1
m_PrefilterDBufferMRT1: 1
m_PrefilterDBufferMRT2: 1
m_PrefilterDBufferMRT3: 1
m_PrefilterSoftShadowsQualityLow: 1
m_PrefilterSoftShadowsQualityMedium: 1
m_PrefilterSoftShadowsQualityHigh: 1
m_PrefilterSoftShadows: 0
m_PrefilterScreenCoord: 1
m_PrefilterNativeRenderPass: 1
m_ShaderVariantLogLevel: 0
m_ShadowCascades: 0 m_ShadowCascades: 0
...@@ -695,7 +695,7 @@ AudioSource: ...@@ -695,7 +695,7 @@ AudioSource:
type: 2} type: 2}
m_audioClip: {fileID: 0} m_audioClip: {fileID: 0}
m_PlayOnAwake: 1 m_PlayOnAwake: 1
m_Volume: 1 m_Volume: 0.5
m_Pitch: 1 m_Pitch: 1
Loop: 0 Loop: 0
Mute: 0 Mute: 0
...@@ -9972,6 +9972,7 @@ GameObject: ...@@ -9972,6 +9972,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 1180898617} - component: {fileID: 1180898617}
- component: {fileID: 1180898618} - component: {fileID: 1180898618}
- component: {fileID: 1180898619}
m_Layer: 0 m_Layer: 0
m_Name: _AudioManager m_Name: _AudioManager
m_TagString: Untagged m_TagString: Untagged
...@@ -10008,6 +10009,103 @@ MonoBehaviour: ...@@ -10008,6 +10009,103 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
audioMixer: {fileID: 24100000, guid: 5a4ab7a92d37e3649b9839994fbe2bc2, type: 2} audioMixer: {fileID: 24100000, guid: 5a4ab7a92d37e3649b9839994fbe2bc2, type: 2}
audioSlider: {fileID: 257008788} audioSlider: {fileID: 257008788}
--- !u!82 &1180898619
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1180898616}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 24300002, guid: 5a4ab7a92d37e3649b9839994fbe2bc2,
type: 2}
m_audioClip: {fileID: 8300000, guid: 02e145ab306cfd8418d9bdf0318dc240, type: 3}
m_PlayOnAwake: 1
m_Volume: 0.8
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 &1187643322 --- !u!1 &1187643322
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -10410,7 +10508,6 @@ Transform: ...@@ -10410,7 +10508,6 @@ Transform:
m_Children: m_Children:
- {fileID: 1097604481} - {fileID: 1097604481}
- {fileID: 244896241} - {fileID: 244896241}
- {fileID: 1401912531}
m_Father: {fileID: 470308987} m_Father: {fileID: 470308987}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1334271830 --- !u!1001 &1334271830
...@@ -10753,7 +10850,7 @@ Transform: ...@@ -10753,7 +10850,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 1292347942} m_Father: {fileID: 1431839677}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1401912532 --- !u!114 &1401912532
MonoBehaviour: MonoBehaviour:
...@@ -10814,6 +10911,7 @@ Transform: ...@@ -10814,6 +10911,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 981698940} - {fileID: 981698940}
- {fileID: 1401912531}
m_Father: {fileID: 470308987} m_Father: {fileID: 470308987}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1433242856 --- !u!1 &1433242856
...@@ -12654,7 +12752,7 @@ AudioSource: ...@@ -12654,7 +12752,7 @@ AudioSource:
serializedVersion: 4 serializedVersion: 4
OutputAudioMixerGroup: {fileID: 24300002, guid: 5a4ab7a92d37e3649b9839994fbe2bc2, OutputAudioMixerGroup: {fileID: 24300002, guid: 5a4ab7a92d37e3649b9839994fbe2bc2,
type: 2} type: 2}
m_audioClip: {fileID: 8300000, guid: 02e145ab306cfd8418d9bdf0318dc240, type: 3} m_audioClip: {fileID: 0}
m_PlayOnAwake: 1 m_PlayOnAwake: 1
m_Volume: 1 m_Volume: 1
m_Pitch: 1 m_Pitch: 1
......
...@@ -769,7 +769,7 @@ MonoBehaviour: ...@@ -769,7 +769,7 @@ MonoBehaviour:
m_OnCullStateChanged: m_OnCullStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_text: "\u0627\uFE91\uFEAA\u0623" m_text: "\uFEA7\uFEAE\u0648\u062C"
m_isRightToLeft: 1 m_isRightToLeft: 1
m_fontAsset: {fileID: 11400000, guid: 195f51441c36d334cbdef3cedc5b756d, type: 2} m_fontAsset: {fileID: 11400000, guid: 195f51441c36d334cbdef3cedc5b756d, type: 2}
m_sharedMaterial: {fileID: 6706907063635417430, guid: 195f51441c36d334cbdef3cedc5b756d, m_sharedMaterial: {fileID: 6706907063635417430, guid: 195f51441c36d334cbdef3cedc5b756d,
...@@ -839,7 +839,7 @@ MonoBehaviour: ...@@ -839,7 +839,7 @@ MonoBehaviour:
m_hasFontAssetChanged: 0 m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0} m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
m_ArabicText: "\u0627\u0628\u062F\u0623" m_ArabicText: "\u062E\u0631\u0648\u062C"
m_ShowTashkeel: 1 m_ShowTashkeel: 1
m_PreserveNumbers: 1 m_PreserveNumbers: 1
m_FixTags: 1 m_FixTags: 1
......
...@@ -25,7 +25,10 @@ public class NPCsEffects : MonoBehaviour ...@@ -25,7 +25,10 @@ public class NPCsEffects : MonoBehaviour
OnDisableEffect.Play(); OnDisableEffect.Play();
} }
if (_cam != null && _cam.isActiveAndEnabled) if (_cam != null && _cam.isActiveAndEnabled)
{
_cam.pitch = Random.Range(0.5f, 2f);
_cam.PlayOneShot(destroyAudioClip); _cam.PlayOneShot(destroyAudioClip);
}
} }
private void OnEnable() private void OnEnable()
{ {
......
...@@ -8,7 +8,7 @@ public class Obstacles : MonoBehaviour ...@@ -8,7 +8,7 @@ public class Obstacles : MonoBehaviour
if (other.CompareTag("NPC")) if (other.CompareTag("NPC"))
{ {
other.gameObject.SetActive(false); other.gameObject.SetActive(false);
SpwanManager.Instance.ChangeCurrentNPCsInGame(-1); SpwanManager.Instance.ChangeCurrentNPCsInGame();
} }
} }
} }
...@@ -12,6 +12,7 @@ public class Answer : MonoBehaviour ...@@ -12,6 +12,7 @@ public class Answer : MonoBehaviour
if (other.CompareTag("Player")) if (other.CompareTag("Player"))
{ {
OnPlayerHit?.Invoke(index); OnPlayerHit?.Invoke(index);
GetComponent<Collider>().enabled = false;
} }
} }
public void rotateParent(int degrees) public void rotateParent(int degrees)
......
...@@ -22,10 +22,9 @@ public class SpwanManager : MonoBehaviour ...@@ -22,10 +22,9 @@ public class SpwanManager : MonoBehaviour
int _increasePerSpawn; int _increasePerSpawn;
int _decreasePerSpawn; int _decreasePerSpawn;
public static int _currentNPCsInGame { get; private set; } public static int _currentNPCsInGame { get; private set; }
private void Awake() private void Awake()
{ {
if(Instance == null) if (Instance == null)
Instance = this; Instance = this;
else else
Destroy(gameObject); Destroy(gameObject);
...@@ -38,6 +37,7 @@ public class SpwanManager : MonoBehaviour ...@@ -38,6 +37,7 @@ public class SpwanManager : MonoBehaviour
GameObject tmp = Instantiate(NPCsPrefab, NPCsSpawnParent.position, Quaternion.identity, NPCsSpawnParent); GameObject tmp = Instantiate(NPCsPrefab, NPCsSpawnParent.position, Quaternion.identity, NPCsSpawnParent);
tmp.gameObject.SetActive(false); tmp.gameObject.SetActive(false);
} }
ChangeCurrentNPCsInGame();
} }
void ChangeNumberOfSpawn() void ChangeNumberOfSpawn()
{ {
...@@ -66,14 +66,22 @@ public class SpwanManager : MonoBehaviour ...@@ -66,14 +66,22 @@ public class SpwanManager : MonoBehaviour
} }
void IncreaseNPCs(int increaseAmount) void IncreaseNPCs(int increaseAmount)
{ {
int howManyAvailableInNPCsParent = maxNPCsInGame - _currentNPCsInGame;
int spawnCount = Mathf.Min(increaseAmount, howManyAvailableInNPCsParent);
int increaseCount = 0;
for (int i = 0; i < increaseAmount; i++) for (int i = 0; i < NPCsSpawnParent.childCount && increaseCount < spawnCount; i++)
{ {
Transform npcToActivate = NPCsSpawnParent.GetChild(i); Transform npcToActivate = NPCsSpawnParent.GetChild(i);
npcToActivate.gameObject.SetActive(true); if (!npcToActivate.gameObject.activeSelf)
{
npcToActivate.gameObject.SetActive(true);
increaseCount++;
}
} }
ChangeCurrentNPCsInGame(increaseAmount); ChangeCurrentNPCsInGame();
RePositionNPCs();
//int howManyAvailableInNPCsParent = maxNPCsInGame - NPCsSpawnParent.childCount; //int howManyAvailableInNPCsParent = maxNPCsInGame - NPCsSpawnParent.childCount;
//int spawnCount = Mathf.Min(increaseAmount, howManyAvailableInNPCsParent); //int spawnCount = Mathf.Min(increaseAmount, howManyAvailableInNPCsParent);
...@@ -82,19 +90,25 @@ public class SpwanManager : MonoBehaviour ...@@ -82,19 +90,25 @@ public class SpwanManager : MonoBehaviour
//{ //{
// Instantiate(NPCsPrefab, NPCsSpawnParent.position, Quaternion.identity, NPCsSpawnParent); // Instantiate(NPCsPrefab, NPCsSpawnParent.position, Quaternion.identity, NPCsSpawnParent);
//} //}
RePositionNPCs();
} }
void DecreaseNPCs(int decreaseAmount) void DecreaseNPCs(int decreaseAmount)
{ {
for (int i = 0; i < decreaseAmount; i++) int decreasedCount = 0;
for (int i = 0; i < NPCsSpawnParent.childCount && decreasedCount < decreaseAmount; i++)
{ {
Transform npcToActivate = NPCsSpawnParent.GetChild(i); Transform npc = NPCsSpawnParent.GetChild(i);
npcToActivate.gameObject.SetActive(false);
if (npc.gameObject.activeSelf)
{
npc.gameObject.SetActive(false);
decreasedCount++;
}
} }
ChangeCurrentNPCsInGame(-decreaseAmount);
ChangeCurrentNPCsInGame();
RePositionNPCs();
//int removeCount = Mathf.Min(decreaseAmount, NPCsSpawnParent.childCount); //int removeCount = Mathf.Min(decreaseAmount, NPCsSpawnParent.childCount);
...@@ -105,9 +119,8 @@ public class SpwanManager : MonoBehaviour ...@@ -105,9 +119,8 @@ public class SpwanManager : MonoBehaviour
// npcToRemove.SetParent(null); // npcToRemove.SetParent(null);
// Destroy(npcToRemove.gameObject); // Destroy(npcToRemove.gameObject);
//} //}
RePositionNPCs();
} }
public void ChangeCurrentNPCsInGame(int newAmount) public void ChangeCurrentNPCsInGame()
{ {
//_currentNPCsInGame += newAmount; //_currentNPCsInGame += newAmount;
//_currentNPCsInGame = Mathf.Clamp(_currentNPCsInGame, 0, maxNPCsInGame); //_currentNPCsInGame = Mathf.Clamp(_currentNPCsInGame, 0, maxNPCsInGame);
......
...@@ -50,14 +50,15 @@ public class EffectsManager : MonoBehaviour ...@@ -50,14 +50,15 @@ public class EffectsManager : MonoBehaviour
if (status) if (status)
{ {
RandomAudioPitch();
correctAnswerVFX.transform.position = player.position; correctAnswerVFX.transform.position = player.position;
correctAnswerVFX.Play(); correctAnswerVFX.Play();
_audioSource.PlayOneShot(correctAnswerSFX); _audioSource.PlayOneShot(correctAnswerSFX);
fadeColor(Color.green); fadeColor(Color.green);
} }
else else
{ {
RandomAudioPitch();
incorrectAnswerVFX.transform.position = player.position; incorrectAnswerVFX.transform.position = player.position;
incorrectAnswerVFX.Play(); incorrectAnswerVFX.Play();
_audioSource.PlayOneShot(incorrectAnswerSFX); _audioSource.PlayOneShot(incorrectAnswerSFX);
...@@ -67,6 +68,8 @@ public class EffectsManager : MonoBehaviour ...@@ -67,6 +68,8 @@ public class EffectsManager : MonoBehaviour
} }
player.DOBlendableMoveBy(Vector3.forward * dashAmount, 0.2f).SetEase(Ease.OutQuad); player.DOBlendableMoveBy(Vector3.forward * dashAmount, 0.2f).SetEase(Ease.OutQuad);
} }
void RandomAudioPitch() => _audioSource.pitch = Random.Range(0.8f, 1.2f);
void fadeColor(Color color) void fadeColor(Color color)
{ {
for (int i = 0; i < _playersAndNPCsMeshRenderer.Count; i++) for (int i = 0; i < _playersAndNPCsMeshRenderer.Count; i++)
......
{ {
"MonoBehaviour": { "MonoBehaviour": {
"Version": 3, "Version": 5,
"EnableBurstCompilation": true, "EnableBurstCompilation": true,
"EnableOptimisations": true, "EnableOptimisations": true,
"EnableSafetyChecks": false, "EnableSafetyChecks": false,
"EnableDebugInAllBuilds": false, "EnableDebugInAllBuilds": false,
"UsePlatformSDKLinker": false, "DebugDataKind": 0,
"EnableArmv9SecurityFeatures": false,
"CpuMinTargetX32": 0, "CpuMinTargetX32": 0,
"CpuMaxTargetX32": 0, "CpuMaxTargetX32": 0,
"CpuMinTargetX64": 0, "CpuMinTargetX64": 0,
"CpuMaxTargetX64": 0, "CpuMaxTargetX64": 0,
"CpuTargetsX32": 6, "CpuTargetsX32": 6,
"CpuTargetsX64": 72 "CpuTargetsX64": 72,
"OptimizeFor": 0
} }
} }
{ {
"MonoBehaviour": { "MonoBehaviour": {
"Version": 3, "Version": 5,
"DisabledWarnings": "" "DisabledWarnings": ""
} }
} }
...@@ -116,6 +116,11 @@ ...@@ -116,6 +116,11 @@
"key": "editor.extrudeEdgesAsGroup", "key": "editor.extrudeEdgesAsGroup",
"value": "{\"m_Value\":true}" "value": "{\"m_Value\":true}"
}, },
{
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "editor.stripProBuilderScriptsOnBuild",
"value": "{\"m_Value\":true}"
},
{ {
"type": "UnityEngine.Rendering.ShadowCastingMode, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "type": "UnityEngine.Rendering.ShadowCastingMode, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "mesh.shadowCastingMode", "key": "mesh.shadowCastingMode",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment