From 39a69c76d5e6b13ff598c13a69260056b3f0887f Mon Sep 17 00:00:00 2001 From: melvinkj <melvinkentj@gmail.com> Date: Thu, 9 May 2024 18:34:57 +0700 Subject: [PATCH] feat: in game and persistance statistics --- Assets/Animation/GameOverClip.anim | 641 ++++++++------- Assets/Scenes/Main.unity | 252 +++++- Assets/Scenes/Menu.unity | 755 ++++++++++++++++-- .../Scripts/DataPersistance/Data/GameData.cs | 34 +- Assets/Scripts/Enemy/EnemyHealth.cs | 5 +- Assets/Scripts/Managers/GameOverManager.cs | 24 +- Assets/Scripts/Managers/ScoreManager.cs | 19 +- Assets/Scripts/Managers/TimerManager.cs | 2 + Assets/Scripts/Player/PlayerMovement.cs | 18 +- Assets/Scripts/Player/PlayerShooting.cs | 41 +- Assets/Scripts/Statistics.meta | 8 + .../Statistics/FileStatisticsHandler.cs | 78 ++ .../Statistics/FileStatisticsHandler.cs.meta | 11 + Assets/Scripts/Statistics/IStatisticsData.cs | 10 + .../Statistics/IStatisticsData.cs.meta | 11 + .../Statistics/InGameTextStatistics.cs | 80 ++ .../Statistics/InGameTextStatistics.cs.meta | 11 + .../Scripts/Statistics/Statistics Data.meta | 8 + .../Statistics Data/StatisticsData.cs | 29 + .../Statistics Data/StatisticsData.cs.meta | 11 + .../Scripts/Statistics/StatisticsManager.cs | 85 ++ .../Statistics/StatisticsManager.cs.meta | 11 + Assets/Scripts/Statistics/TextStatistics.cs | 85 ++ .../Scripts/Statistics/TextStatistics.cs.meta | 11 + Assets/Scripts/Weapons/DefaultGun.cs | 7 + Assets/Scripts/Weapons/Shotgun.cs | 7 + 26 files changed, 1874 insertions(+), 380 deletions(-) create mode 100644 Assets/Scripts/Statistics.meta create mode 100644 Assets/Scripts/Statistics/FileStatisticsHandler.cs create mode 100644 Assets/Scripts/Statistics/FileStatisticsHandler.cs.meta create mode 100644 Assets/Scripts/Statistics/IStatisticsData.cs create mode 100644 Assets/Scripts/Statistics/IStatisticsData.cs.meta create mode 100644 Assets/Scripts/Statistics/InGameTextStatistics.cs create mode 100644 Assets/Scripts/Statistics/InGameTextStatistics.cs.meta create mode 100644 Assets/Scripts/Statistics/Statistics Data.meta create mode 100644 Assets/Scripts/Statistics/Statistics Data/StatisticsData.cs create mode 100644 Assets/Scripts/Statistics/Statistics Data/StatisticsData.cs.meta create mode 100644 Assets/Scripts/Statistics/StatisticsManager.cs create mode 100644 Assets/Scripts/Statistics/StatisticsManager.cs.meta create mode 100644 Assets/Scripts/Statistics/TextStatistics.cs create mode 100644 Assets/Scripts/Statistics/TextStatistics.cs.meta diff --git a/Assets/Animation/GameOverClip.anim b/Assets/Animation/GameOverClip.anim index 2cfd717..f648b04 100644 --- a/Assets/Animation/GameOverClip.anim +++ b/Assets/Animation/GameOverClip.anim @@ -55,18 +55,27 @@ AnimationClip: m_Curve: - serializedVersion: 3 time: 0 + value: {x: 0, y: 0, z: 0} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.73333335 value: {x: 1, y: 1, z: 1} - inSlope: {x: -0.3998667, y: -0.39973345, z: -0.39973345} - outSlope: {x: -0.3998667, y: -0.39973345, z: -0.39973345} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} tangentMode: 0 weightedMode: 0 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - serializedVersion: 3 - time: 0.50016665 - value: {x: 0.8, y: 0.80006665, z: 0.80006665} - inSlope: {x: -0.3998667, y: -0.39973345, z: -0.39973345} - outSlope: {x: -0.3998667, y: -0.39973345, z: -0.39973345} + time: 15 + value: {x: 1, y: 1, z: 1} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} tangentMode: 0 weightedMode: 0 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} @@ -74,7 +83,7 @@ AnimationClip: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - path: ScoreText + path: CountdownText - curve: serializedVersion: 2 m_Curve: @@ -88,7 +97,7 @@ AnimationClip: inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - serializedVersion: 3 - time: 0.73333335 + time: 0.75 value: {x: 1, y: 1, z: 1} inSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0} @@ -108,7 +117,7 @@ AnimationClip: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - path: CountdownText + path: GameOverAsk - curve: serializedVersion: 2 m_Curve: @@ -121,6 +130,15 @@ AnimationClip: weightedMode: 0 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.5 + value: {x: 1.1, y: 1.1, z: 1.1} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - serializedVersion: 3 time: 0.75 value: {x: 1, y: 1, z: 1} @@ -142,7 +160,7 @@ AnimationClip: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - path: GameOverAsk + path: PlayButton - curve: serializedVersion: 2 m_Curve: @@ -185,7 +203,7 @@ AnimationClip: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - path: PlayButton + path: MenuButton - curve: serializedVersion: 2 m_Curve: @@ -199,16 +217,7 @@ AnimationClip: inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - serializedVersion: 3 - time: 0.5 - value: {x: 1.1, y: 1.1, z: 1.1} - inSlope: {x: 0, y: 0, z: 0} - outSlope: {x: 0, y: 0, z: 0} - tangentMode: 0 - weightedMode: 0 - inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - - serializedVersion: 3 - time: 0.75 + time: 0.51666665 value: {x: 1, y: 1, z: 1} inSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0} @@ -228,7 +237,7 @@ AnimationClip: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - path: MenuButton + path: InGameStatisticsText m_FloatCurves: - serializedVersion: 2 curve: @@ -470,66 +479,6 @@ AnimationClip: classID: 114 script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} flags: 16 - - serializedVersion: 2 - curve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 70 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 0.2 - value: 70 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 0.95 - value: 15 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - attribute: m_AnchoredPosition.y - path: CountdownText - classID: 224 - script: {fileID: 0} - flags: 0 - - serializedVersion: 2 - curve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - attribute: m_AnchoredPosition.x - path: CountdownText - classID: 224 - script: {fileID: 0} - flags: 0 - serializedVersion: 2 curve: serializedVersion: 2 @@ -980,6 +929,96 @@ AnimationClip: classID: 1 script: {fileID: 0} flags: 16 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 15 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Enabled + path: ScoreText + classID: 114 + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + flags: 16 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 15 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Enabled + path: InGameStatisticsText + classID: 114 + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + flags: 16 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 15 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Enabled + path: TextInput/Text (Legacy) + classID: 114 + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + flags: 16 m_PPtrCurves: [] m_SampleRate: 60 m_WrapMode: 0 @@ -998,7 +1037,7 @@ AnimationClip: isIntCurve: 0 isSerializeReferenceCurve: 0 - serializedVersion: 2 - path: 596210011 + path: 459710920 attribute: 3 script: {fileID: 0} typeID: 4 @@ -1007,7 +1046,7 @@ AnimationClip: isIntCurve: 0 isSerializeReferenceCurve: 0 - serializedVersion: 2 - path: 459710920 + path: 3472888982 attribute: 3 script: {fileID: 0} typeID: 4 @@ -1016,7 +1055,7 @@ AnimationClip: isIntCurve: 0 isSerializeReferenceCurve: 0 - serializedVersion: 2 - path: 3472888982 + path: 152084987 attribute: 3 script: {fileID: 0} typeID: 4 @@ -1025,7 +1064,7 @@ AnimationClip: isIntCurve: 0 isSerializeReferenceCurve: 0 - serializedVersion: 2 - path: 152084987 + path: 1768121632 attribute: 3 script: {fileID: 0} typeID: 4 @@ -1034,7 +1073,7 @@ AnimationClip: isIntCurve: 0 isSerializeReferenceCurve: 0 - serializedVersion: 2 - path: 1768121632 + path: 1461585792 attribute: 3 script: {fileID: 0} typeID: 4 @@ -1087,15 +1126,6 @@ AnimationClip: isPPtrCurve: 0 isIntCurve: 0 isSerializeReferenceCurve: 0 - - serializedVersion: 2 - path: 459710920 - attribute: 538195251 - script: {fileID: 0} - typeID: 224 - customType: 28 - isPPtrCurve: 0 - isIntCurve: 0 - isSerializeReferenceCurve: 0 - serializedVersion: 2 path: 2376362178 attribute: 3305885265 @@ -1231,6 +1261,33 @@ AnimationClip: isPPtrCurve: 0 isIntCurve: 0 isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 596210011 + attribute: 3305885265 + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + typeID: 114 + customType: 24 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1461585792 + attribute: 3305885265 + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + typeID: 114 + customType: 24 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2816301458 + attribute: 3305885265 + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + typeID: 114 + customType: 24 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 - serializedVersion: 2 path: 2185909552 attribute: 2526845255 @@ -1258,15 +1315,6 @@ AnimationClip: isPPtrCurve: 0 isIntCurve: 0 isSerializeReferenceCurve: 0 - - serializedVersion: 2 - path: 459710920 - attribute: 1460864421 - script: {fileID: 0} - typeID: 224 - customType: 28 - isPPtrCurve: 0 - isIntCurve: 0 - isSerializeReferenceCurve: 0 pptrCurveMapping: [] m_AnimationClipSettings: serializedVersion: 2 @@ -1652,172 +1700,22 @@ AnimationClip: m_Curve: - serializedVersion: 3 time: 0 - value: 1 - inSlope: -0.3998667 - outSlope: -0.3998667 - tangentMode: 34 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 + inWeight: 0 + outWeight: 0 - serializedVersion: 3 - time: 0.50016665 - value: 0.8 - inSlope: -0.3998667 - outSlope: -0.3998667 - tangentMode: 34 + time: 15 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - attribute: m_LocalScale.x - path: ScoreText - classID: 224 - script: {fileID: 0} - flags: 16 - - serializedVersion: 2 - curve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 1 - inSlope: -0.39973345 - outSlope: -0.39973345 - tangentMode: 34 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 0.50016665 - value: 0.80006665 - inSlope: -0.39973345 - outSlope: -0.39973345 - tangentMode: 34 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - attribute: m_LocalScale.y - path: ScoreText - classID: 224 - script: {fileID: 0} - flags: 16 - - serializedVersion: 2 - curve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 1 - inSlope: -0.39973345 - outSlope: -0.39973345 - tangentMode: 34 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 0.50016665 - value: 0.80006665 - inSlope: -0.39973345 - outSlope: -0.39973345 - tangentMode: 34 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - attribute: m_LocalScale.z - path: ScoreText - classID: 224 - script: {fileID: 0} - flags: 16 - - serializedVersion: 2 - curve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 70 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 0.2 - value: 70 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 0.95 - value: 15 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - attribute: m_AnchoredPosition.y - path: CountdownText - classID: 224 - script: {fileID: 0} - flags: 0 - - serializedVersion: 2 - curve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - attribute: m_AnchoredPosition.x - path: CountdownText - classID: 224 - script: {fileID: 0} - flags: 0 - - serializedVersion: 2 - curve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: Infinity - outSlope: Infinity - tangentMode: 103 - weightedMode: 0 - inWeight: 0 - outWeight: 0 - - serializedVersion: 3 - time: 15 - value: 1 - inSlope: Infinity - outSlope: Infinity - tangentMode: 103 - weightedMode: 0 - inWeight: 0 - outWeight: 0 + inWeight: 0 + outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 @@ -2768,6 +2666,213 @@ AnimationClip: classID: 1 script: {fileID: 0} flags: 16 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 15 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Enabled + path: ScoreText + classID: 114 + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + flags: 16 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 15 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Enabled + path: InGameStatisticsText + classID: 114 + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + flags: 16 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 15 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.x + path: InGameStatisticsText + classID: 224 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 15 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.y + path: InGameStatisticsText + classID: 224 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 15 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalScale.z + path: InGameStatisticsText + classID: 224 + script: {fileID: 0} + flags: 0 + - serializedVersion: 2 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 15 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_Enabled + path: TextInput/Text (Legacy) + classID: 114 + script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + flags: 16 m_EulerEditorCurves: [] m_HasGenericRootTransform: 0 m_HasMotionFloatCurves: 0 diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 30d4f6b..e147ac4 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 8900000, guid: a7bed68887a07e34394d4191b3081359, type: 3} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.10003871, g: 0.118095554, b: 0.11640027, a: 1} + m_IndirectSpecularColor: {r: 0.100039154, g: 0.11809585, b: 0.11640041, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &4 LightmapSettings: @@ -866,6 +866,51 @@ MonoBehaviour: masterMixer: {fileID: 24100000, guid: 5b84db49d40ea449aa4f3e3bd229ab5b, type: 2} sfxSlider: {fileID: 269909663} musicSlider: {fileID: 885988012} +--- !u!1 &258386102 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 258386103} + - component: {fileID: 258386104} + m_Layer: 0 + m_Name: StatisticsManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &258386103 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 258386102} + serializedVersion: 2 + 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: 1796129603} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &258386104 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 258386102} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 020faba715af37d47b8c8de88a1840ac, type: 3} + m_Name: + m_EditorClassIdentifier: + fileNameStatistics: statistics.game --- !u!1 &260284131 GameObject: m_ObjectHideFlags: 0 @@ -1749,7 +1794,7 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 16777215 + rgba: 4294967295 m_fontColor: {r: 1, g: 1, b: 1, a: 0} m_enableVertexGradient: 0 m_colorMode: 3 @@ -1986,7 +2031,7 @@ RectTransform: 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: -58} + m_AnchoredPosition: {x: 0, y: -108} m_SizeDelta: {x: 130, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &567878899 @@ -3084,6 +3129,100 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 932231928} m_CullTransparentMesh: 1 +--- !u!1 &1002374669 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1002374670} + - component: {fileID: 1002374673} + - component: {fileID: 1002374672} + - component: {fileID: 1002374671} + m_Layer: 5 + m_Name: StatisticsText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1002374670 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1002374669} + 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: 1139190134} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 400, y: -420} + m_SizeDelta: {x: 160, y: 160} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1002374671 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1002374669} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: eac6ca6c33fc23b4bacd03bb38e0618f, type: 3} + m_Name: + m_EditorClassIdentifier: + statistics: {fileID: 0} +--- !u!114 &1002374672 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1002374669} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: "Shots Fired: \nShots Hit: \nShot Accuracy: \nDistance Traveled: \nPlay + Time: \nHigh Score: \nAll Time Score: \nEnemies Killed: " +--- !u!222 &1002374673 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1002374669} + m_CullTransparentMesh: 1 --- !u!1 &1038376789 GameObject: m_ObjectHideFlags: 0 @@ -3425,7 +3564,7 @@ RectTransform: 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: 70} + m_AnchoredPosition: {x: 0, y: 200} m_SizeDelta: {x: 130, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1139190131 @@ -3517,6 +3656,8 @@ RectTransform: - {fileID: 735558820} - {fileID: 854938169} - {fileID: 1476880138} + - {fileID: 1002374670} + - {fileID: 2031497883} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -4459,7 +4600,7 @@ RectTransform: 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: 143, y: -122} + m_AnchoredPosition: {x: 143, y: -172} m_SizeDelta: {x: 218, y: 60} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1506604692 @@ -4987,7 +5128,7 @@ RectTransform: 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_AnchoredPosition: {x: 0, y: 150} m_SizeDelta: {x: 130, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1664263449 @@ -5112,7 +5253,7 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 16777215 + rgba: 4294967295 m_fontColor: {r: 1, g: 1, b: 1, a: 0} m_enableVertexGradient: 0 m_colorMode: 3 @@ -5599,6 +5740,7 @@ Transform: - {fileID: 1222083999} - {fileID: 125324177} - {fileID: 77699151} + - {fileID: 258386103} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1796129604 @@ -6046,7 +6188,7 @@ RectTransform: 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: -133, y: -122} + m_AnchoredPosition: {x: -133, y: -172} m_SizeDelta: {x: 218, y: 60} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1863767946 @@ -6564,6 +6706,100 @@ Transform: m_CorrespondingSourceObject: {fileID: 400006, guid: 4e5a0d387dc27394b81600988ad0216f, type: 3} m_PrefabInstance: {fileID: 1641232233} m_PrefabAsset: {fileID: 0} +--- !u!1 &2031497882 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2031497883} + - component: {fileID: 2031497885} + - component: {fileID: 2031497884} + - component: {fileID: 2031497886} + m_Layer: 5 + m_Name: InGameStatisticsText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2031497883 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2031497882} + 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: 1139190134} + 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: 300, y: 200} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2031497884 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2031497882} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 46238fb1ad7a7a84ba8954c1c860994c, type: 3} + m_FontSize: 22 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: "Score: \nShots Fired: \nShots Hit: \nShot Accuracy: \nDistance Traveled: + \nPlay Time: \nEnemies Killed: " +--- !u!222 &2031497885 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2031497882} + m_CullTransparentMesh: 1 +--- !u!114 &2031497886 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2031497882} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3a1b1fd2ea7f4004d96dfa72e9c63b68, type: 3} + m_Name: + m_EditorClassIdentifier: + statistics: {fileID: 0} --- !u!1 &2096198479 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Menu.unity b/Assets/Scenes/Menu.unity index 7204137..7a038d9 100644 --- a/Assets/Scenes/Menu.unity +++ b/Assets/Scenes/Menu.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.18028331, g: 0.2257133, b: 0.3069217, a: 1} + m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -911,6 +911,97 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 280752395} m_CullTransparentMesh: 1 +--- !u!1 &338094510 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 338094515} + - component: {fileID: 338094514} + - component: {fileID: 338094513} + - component: {fileID: 338094512} + m_Layer: 5 + m_Name: StatisticsCanvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!225 &338094512 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 338094510} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &338094513 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 338094510} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!223 &338094514 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 338094510} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 25 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &338094515 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 338094510} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1632219689} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} --- !u!1 &397210885 GameObject: m_ObjectHideFlags: 0 @@ -1397,7 +1488,7 @@ GameObject: - component: {fileID: 594932354} - component: {fileID: 594932353} m_Layer: 5 - m_Name: StatisticButton + m_Name: StatisticsButton m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -1466,7 +1557,19 @@ MonoBehaviour: m_TargetGraphic: {fileID: 594932354} m_OnClick: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 338094514} + m_TargetAssemblyTypeName: UnityEngine.Behaviour, UnityEngine + m_MethodName: set_enabled + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 --- !u!114 &594932354 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1695,6 +1798,102 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 670380645} m_CullTransparentMesh: 1 +--- !u!1 &684298914 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 684298918} + - component: {fileID: 684298917} + - component: {fileID: 684298916} + - component: {fileID: 684298919} + m_Layer: 5 + m_Name: Statistics + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &684298916 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 684298914} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 46238fb1ad7a7a84ba8954c1c860994c, type: 3} + m_FontSize: 15 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: "Shots Fired : \nShots Hit : + \nShot Accuracy : \nDistance Traveled : \nPlay Time + : \nHigh Score : \nAll Time Score : \nEnemies + Killed : " +--- !u!222 &684298917 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 684298914} + m_CullTransparentMesh: 1 +--- !u!224 &684298918 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 684298914} + 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: 1632219689} + 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: 250, y: 130} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &684298919 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 684298914} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: eac6ca6c33fc23b4bacd03bb38e0618f, type: 3} + m_Name: + m_EditorClassIdentifier: + statistics: {fileID: 0} --- !u!1 &695509778 GameObject: m_ObjectHideFlags: 0 @@ -2003,6 +2202,51 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 773016078} m_CullTransparentMesh: 1 +--- !u!1 &841405288 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 841405290} + - component: {fileID: 841405289} + m_Layer: 0 + m_Name: StatisticsManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &841405289 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 841405288} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 020faba715af37d47b8c8de88a1840ac, type: 3} + m_Name: + m_EditorClassIdentifier: + fileNameStatistics: statistics.game +--- !u!4 &841405290 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 841405288} + serializedVersion: 2 + 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &920814737 GameObject: m_ObjectHideFlags: 0 @@ -2620,7 +2864,7 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1211714688 +--- !u!1 &1141337883 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -2628,82 +2872,272 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1211714689} - - component: {fileID: 1211714690} + - component: {fileID: 1141337884} + - component: {fileID: 1141337887} + - component: {fileID: 1141337886} + - component: {fileID: 1141337885} m_Layer: 5 - m_Name: Medium Toggle + m_Name: Text m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &1211714689 +--- !u!224 &1141337884 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1211714688} + m_GameObject: {fileID: 1141337883} 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: - - {fileID: 1458912211} - - {fileID: 1271813181} - m_Father: {fileID: 1880951815} + m_Children: [] + m_Father: {fileID: 1784266098} 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: 164.60408, y: 0} - m_SizeDelta: {x: 82.106, y: 20} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -2.5} + m_SizeDelta: {x: 0, y: -5} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1211714690 +--- !u!114 &1141337885 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1211714688} + m_GameObject: {fileID: 1141337883} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} + m_Script: {fileID: 11500000, guid: cfabb0440166ab443bba8876756fdfa9, type: 3} m_Name: m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 1458912212} - toggleTransition: 1 - graphic: {fileID: 1756263741} - m_Group: {fileID: 1880951818} - onValueChanged: - m_PersistentCalls: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 2, y: -2} + m_UseGraphicAlpha: 1 +--- !u!114 &1141337886 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1141337883} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 46238fb1ad7a7a84ba8954c1c860994c, type: 3} + m_FontSize: 17 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 0 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: CLOSE +--- !u!222 &1141337887 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1141337883} + m_CullTransparentMesh: 1 +--- !u!1 &1186047520 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1186047521} + - component: {fileID: 1186047524} + - component: {fileID: 1186047523} + - component: {fileID: 1186047522} + m_Layer: 5 + m_Name: StatisticsTitle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1186047521 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1186047520} + 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: 1632219689} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: -11} + m_SizeDelta: {x: 130, y: 30} + m_Pivot: {x: 0.5, y: 1} +--- !u!114 &1186047522 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1186047520} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cfabb0440166ab443bba8876756fdfa9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 2, y: -2} + m_UseGraphicAlpha: 1 +--- !u!114 &1186047523 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1186047520} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 46238fb1ad7a7a84ba8954c1c860994c, type: 3} + m_FontSize: 30 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 50 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: STATISTICS +--- !u!222 &1186047524 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1186047520} + m_CullTransparentMesh: 1 +--- !u!1 &1211714688 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1211714689} + - component: {fileID: 1211714690} + m_Layer: 5 + m_Name: Medium Toggle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1211714689 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1211714688} + 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: + - {fileID: 1458912211} + - {fileID: 1271813181} + m_Father: {fileID: 1880951815} + 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: 164.60408, y: 0} + m_SizeDelta: {x: 82.106, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1211714690 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1211714688} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1458912212} + toggleTransition: 1 + graphic: {fileID: 1756263741} + m_Group: {fileID: 1880951818} + onValueChanged: + m_PersistentCalls: m_Calls: - m_Target: {fileID: 1438257279} m_TargetAssemblyTypeName: SettingsManager, Assembly-CSharp @@ -3776,6 +4210,84 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: -14, y: -4} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1632219688 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1632219689} + - component: {fileID: 1632219691} + - component: {fileID: 1632219690} + m_Layer: 5 + m_Name: PausePanel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1632219689 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1632219688} + 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: + - {fileID: 1186047521} + - {fileID: 1784266098} + - {fileID: 684298918} + m_Father: {fileID: 338094515} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: -8} + m_SizeDelta: {x: 450, y: 249.3} + m_Pivot: {x: 0.5, y: 1} +--- !u!114 &1632219690 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1632219688} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.70000005, g: 0.65625, b: 0.875, a: 0.7882353} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300002, guid: a5a780e4a881ea44f88afed421a63c3a, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1632219691 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1632219688} + m_CullTransparentMesh: 1 --- !u!1 &1654024107 GameObject: m_ObjectHideFlags: 0 @@ -4049,6 +4561,139 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} +--- !u!1 &1784266097 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1784266098} + - component: {fileID: 1784266101} + - component: {fileID: 1784266100} + - component: {fileID: 1784266099} + m_Layer: 5 + m_Name: CloseButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1784266098 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1784266097} + 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: + - {fileID: 1141337884} + m_Father: {fileID: 1632219689} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: -39, y: 15} + m_SizeDelta: {x: 79.8, y: 40} + m_Pivot: {x: 0, y: 0} +--- !u!114 &1784266099 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1784266097} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 2 + m_Colors: + m_NormalColor: {r: 0.5019608, g: 0.5019608, b: 0.5019608, a: 0.5019608} + m_HighlightedColor: {r: 0.5019608, g: 0.5019608, b: 0.5019608, a: 0.69803923} + m_PressedColor: {r: 0.34509805, g: 0.34509805, b: 0.34509805, a: 0.69803923} + m_SelectedColor: {r: 0.5019608, g: 0.5019608, b: 0.5019608, a: 0.69803923} + m_DisabledColor: {r: 0.2509804, g: 0.2509804, b: 0.2509804, a: 0.5019608} + m_ColorMultiplier: 2 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 21300002, guid: 5362fbfb8a7d67b499bebb4e286cea71, type: 3} + m_PressedSprite: {fileID: 21300002, guid: 997c5c17c1c4b8e45b6a1c47799ddeb0, type: 3} + m_SelectedSprite: {fileID: 21300002, guid: 5362fbfb8a7d67b499bebb4e286cea71, type: 3} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Highlighted + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1784266100} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 338094514} + m_TargetAssemblyTypeName: UnityEngine.Behaviour, UnityEngine + m_MethodName: set_enabled + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 +--- !u!114 &1784266100 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1784266097} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300002, guid: 691c72ed2864a3f42a2479bbe70525cc, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1784266101 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1784266097} + m_CullTransparentMesh: 1 --- !u!1 &1789674725 GameObject: m_ObjectHideFlags: 0 @@ -5474,4 +6119,6 @@ SceneRoots: - {fileID: 1781923874} - {fileID: 1105353741} - {fileID: 1438257278} + - {fileID: 338094515} - {fileID: 1356246773} + - {fileID: 841405290} diff --git a/Assets/Scripts/DataPersistance/Data/GameData.cs b/Assets/Scripts/DataPersistance/Data/GameData.cs index d08327e..fd51cc3 100644 --- a/Assets/Scripts/DataPersistance/Data/GameData.cs +++ b/Assets/Scripts/DataPersistance/Data/GameData.cs @@ -6,31 +6,39 @@ using UnityEngine; public class GameData { - public int score; // public int timer; public int playerHealth; + public float damagePercent; public Vector3 playerPosition; public Vector3 cameraPosition; - // Add enemy data - public List<EnemyData> enemyDataList = new List<EnemyData>(); + public int score; + public int shotsFired; + public int shotsHit; + public double shotAccuracy; + public double distanceTraveled; + public double playTime; + public int highScore; + public int allTimeScore; + public int enemiesKilled; public GameData() { - this.score = 0; this.playerHealth = 100; + this.damagePercent = 1; this.playerPosition = Vector3.zero; this.cameraPosition = Vector3.zero; - } -} -// Add a new class to represent enemy data -[System.Serializable] -public class EnemyData -{ - public Vector3 position; - public int health; -} + // Statistics + this.score = 0; + this.shotsFired = 0; + this.shotsHit = 0; + this.shotAccuracy = 0; + this.distanceTraveled = 0; + this.playTime = 0; + this.enemiesKilled = 0; + } +} \ No newline at end of file diff --git a/Assets/Scripts/Enemy/EnemyHealth.cs b/Assets/Scripts/Enemy/EnemyHealth.cs index 166cbda..d0d8cea 100644 --- a/Assets/Scripts/Enemy/EnemyHealth.cs +++ b/Assets/Scripts/Enemy/EnemyHealth.cs @@ -143,7 +143,8 @@ namespace Nightmare GetComponent <UnityEngine.AI.NavMeshAgent> ().enabled = false; SetKinematics(true); - ScoreManager.score += scoreValue; + InGameTextStatistics.score += scoreValue; + TextStatistics.allTimeScore += scoreValue; if (type == enemyTypes.Keroco) { QuestManager.kerocoCount++; @@ -157,6 +158,8 @@ namespace Nightmare { QuestManager.rajaCount++; } + TextStatistics.enemiesKilled++; + InGameTextStatistics.enemiesKilled++; } public int CurrentHealth() diff --git a/Assets/Scripts/Managers/GameOverManager.cs b/Assets/Scripts/Managers/GameOverManager.cs index 7eadda7..2698814 100644 --- a/Assets/Scripts/Managers/GameOverManager.cs +++ b/Assets/Scripts/Managers/GameOverManager.cs @@ -3,8 +3,10 @@ using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; -namespace Nightmare { - public class GameOverManager : MonoBehaviour { +namespace Nightmare +{ + public class GameOverManager : MonoBehaviour + { private PlayerHealth playerHealth; [SerializeField] private TimerManager timerManager; [SerializeField] private CountdownManager countdownManager; @@ -14,21 +16,29 @@ namespace Nightmare { public float restartDelay = 10f; float restartTimer; - void Awake () { + void Awake() + { playerHealth = FindObjectOfType<PlayerHealth>(); anim = GetComponent<Animator>(); lm = FindObjectOfType<LevelManager>(); } - void Update() { - if (playerHealth.currentHealth <= 0) { + void Update() + { + if (playerHealth.currentHealth <= 0) + { anim.SetTrigger("GameOver"); countdownManager.StartCountdown(); } } - private void ResetLevel() { - ScoreManager.score = 0; + private void ResetLevel() + { + // ScoreManager.score = 0; + if (InGameTextStatistics.score > TextStatistics.highScore) + { + TextStatistics.highScore = InGameTextStatistics.score; + } // lm.LoadInitialLevel(); // playerHealth.ResetPlayer(); timerManager.ResetTimer(); diff --git a/Assets/Scripts/Managers/ScoreManager.cs b/Assets/Scripts/Managers/ScoreManager.cs index 44c6075..0130198 100644 --- a/Assets/Scripts/Managers/ScoreManager.cs +++ b/Assets/Scripts/Managers/ScoreManager.cs @@ -4,7 +4,7 @@ using System.Collections; namespace Nightmare { - public class ScoreManager : MonoBehaviour, IDataPersistance + public class ScoreManager : MonoBehaviour { public static int score; private int levelThreshhold; @@ -12,27 +12,18 @@ namespace Nightmare Text sText; - void Awake () + void Awake() { - sText = GetComponent <Text> (); + sText = GetComponent<Text>(); score = 0; levelThreshhold = LEVEL_INCREASE; } - public void LoadData(GameData data) - { - ScoreManager.score = data.score; - } - public void SaveData(ref GameData data) + void Update() { - data.score = ScoreManager.score; - } + ScoreManager.score = InGameTextStatistics.score; - - - void Update () - { sText.text = "Score: " + score; //if (score >= levelThreshhold) //{ diff --git a/Assets/Scripts/Managers/TimerManager.cs b/Assets/Scripts/Managers/TimerManager.cs index 451d2bc..8c37f9a 100644 --- a/Assets/Scripts/Managers/TimerManager.cs +++ b/Assets/Scripts/Managers/TimerManager.cs @@ -18,6 +18,8 @@ public class TimerManager : MonoBehaviour { void Update() { if (isRunning) { time = time + Time.deltaTime; + TextStatistics.playTime += Time.deltaTime; + InGameTextStatistics.playTime += Time.deltaTime; } string timeText = System.TimeSpan.FromSeconds(time).ToString("mm':'ss"); Timer.text = timeText; diff --git a/Assets/Scripts/Player/PlayerMovement.cs b/Assets/Scripts/Player/PlayerMovement.cs index 3e3c95e..cbede36 100644 --- a/Assets/Scripts/Player/PlayerMovement.cs +++ b/Assets/Scripts/Player/PlayerMovement.cs @@ -19,6 +19,8 @@ namespace Nightmare float camRayLength = 100f; // The length of the ray from the camera into the scene. #endif + private Vector3 lastPosition; // Variable to store the last position + void Awake () { #if !MOBILE_INPUT @@ -65,7 +67,21 @@ namespace Nightmare { // Set the movement vector based on the axis input. movement.Set (h, 0f, v); - + + // Calculate the distance moved since the last frame + float distanceMoved = Vector3.Distance(transform.position, lastPosition); + + // Update the last position to the current position + lastPosition = transform.position; + + // If the distance moved is greater than a small threshold (to avoid counting tiny movements due to floating-point imprecision) + if (distanceMoved > 0.001f) + { + // Increment distanceTraveled by the distance moved + TextStatistics.distanceTraveled += distanceMoved; + InGameTextStatistics.distanceTraveled += distanceMoved; + } + // Normalise the movement vector and make it proportional to the speed per second. movement = movement.normalized * speed * Time.deltaTime; diff --git a/Assets/Scripts/Player/PlayerShooting.cs b/Assets/Scripts/Player/PlayerShooting.cs index c1e05cc..9a13b65 100644 --- a/Assets/Scripts/Player/PlayerShooting.cs +++ b/Assets/Scripts/Player/PlayerShooting.cs @@ -7,24 +7,24 @@ using System; namespace Nightmare { - public class PlayerShooting : PausibleObject + public class PlayerShooting : PausibleObject, IDataPersistance { public GameObject grenade; public float grenadeSpeed = 200f; public float grenadeFireDelay = 0.5f; public float damagePercent = 1; int grenadeStock = 99; - + float timer, grenadeTimer; public List<GameObject> weaponsList; private Weapons currWeapon; private int currWeaponIdx; [SerializeField] Transform weaponPos; float realWeaponDamage; - + private UnityAction listener; - void Awake () + void Awake() { timer = 0; grenadeTimer = 0; @@ -44,7 +44,7 @@ namespace Nightmare StopPausible(); } - void Update () + void Update() { if (isPaused) return; @@ -64,10 +64,12 @@ namespace Nightmare if (Input.GetKeyDown(KeyCode.Alpha1)) { ChangeWeapon(0); - } else if (Input.GetKeyDown(KeyCode.Alpha2)) + } + else if (Input.GetKeyDown(KeyCode.Alpha2)) { ChangeWeapon(1); - } else if (Input.GetKeyDown(KeyCode.Alpha3)) + } + else if (Input.GetKeyDown(KeyCode.Alpha3)) { ChangeWeapon(2); } @@ -92,7 +94,7 @@ namespace Nightmare Shoot(); } } - + #else // If there is input on the shoot direction stick and it's time to fire... if ((CrossPlatformInputManager.GetAxisRaw("Mouse X") != 0 || CrossPlatformInputManager.GetAxisRaw("Mouse Y") != 0) && timer >= timeBetweenBullets) @@ -102,15 +104,15 @@ namespace Nightmare } #endif // If the timer has exceeded the proportion of timeBetweenBullets that the effects should be displayed for... - if(timer >= currWeapon.timeBetweenBullets * currWeapon.effectsDisplayTime) + if (timer >= currWeapon.timeBetweenBullets * currWeapon.effectsDisplayTime) { // ... disable the effects. - DisableEffects (); + DisableEffects(); } } - public void DisableEffects () + public void DisableEffects() { currWeapon.DisableEffects(); } @@ -125,8 +127,9 @@ namespace Nightmare if (idx < 0) { idx = weaponsList.Count - 1; - } else if (idx >= weaponsList.Count) - { + } + else if (idx >= weaponsList.Count) + { idx = 0; } currWeaponIdx = idx; @@ -140,7 +143,7 @@ namespace Nightmare realWeaponDamage = currWeapon.damagePerShot; } - void Shoot () + void Shoot() { // Reset the timer. timer = 0f; @@ -189,5 +192,15 @@ namespace Nightmare { damagePercent = 100000; } + + public void LoadData(GameData data) + { + data.damagePercent = this.damagePercent; + } + + public void SaveData(ref GameData data) + { + this.damagePercent = data.damagePercent; + } } } \ No newline at end of file diff --git a/Assets/Scripts/Statistics.meta b/Assets/Scripts/Statistics.meta new file mode 100644 index 0000000..1d3e7a7 --- /dev/null +++ b/Assets/Scripts/Statistics.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 45f0e16daa5b6e94f89cd847d54310cf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Statistics/FileStatisticsHandler.cs b/Assets/Scripts/Statistics/FileStatisticsHandler.cs new file mode 100644 index 0000000..1053988 --- /dev/null +++ b/Assets/Scripts/Statistics/FileStatisticsHandler.cs @@ -0,0 +1,78 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using System; +using System.IO; + + +public class FileStatisticsHandler +{ + private string dataDirPath = ""; + private string dataFileName = ""; + + + public FileStatisticsHandler(string dataDirPath, string dataFileName) + { + this.dataDirPath = dataDirPath; + this.dataFileName = dataFileName; + } + + + public StatisticsData Load() + { + // use Path.Combine to account for different OS's having different path separators + string fullPath = Path.Combine(dataDirPath, dataFileName); + StatisticsData loadedData = null; + if (File.Exists(fullPath)) + { + try + { + // load the serialized data from the file + string dataToLoad = ""; + using (FileStream stream = new FileStream(fullPath, FileMode.Open)) + { + using (StreamReader reader = new StreamReader(stream)) + { + dataToLoad = reader.ReadToEnd(); + } + } + + // deserialize the data from Json back nto the C# object + loadedData = JsonUtility.FromJson<StatisticsData>(dataToLoad); + + } + catch (Exception e) + { + Debug.LogError("Error occured when trying to load data from file: " + fullPath + "\n" + e); + } + } + return loadedData; + } + + public void Save(StatisticsData data) + { + string fullPath = Path.Combine(dataDirPath, dataFileName); + + try + { + // create the directory the file will be written to if it doesn't already exist + Directory.CreateDirectory(Path.GetDirectoryName(fullPath)); + + // serialize the C# game data object into Json + string dataToStore = JsonUtility.ToJson(data, true); + + // write the serialized data to the file + using (FileStream stream = new FileStream(fullPath, FileMode.Create)) + { + using (StreamWriter writer = new StreamWriter(stream)) + { + writer.Write(dataToStore); + } + } + } + catch (Exception e) + { + Debug.LogError("Error occured when trying to save statistics data to file: " + fullPath + "\n" + e); + } + } +} diff --git a/Assets/Scripts/Statistics/FileStatisticsHandler.cs.meta b/Assets/Scripts/Statistics/FileStatisticsHandler.cs.meta new file mode 100644 index 0000000..37b5eb0 --- /dev/null +++ b/Assets/Scripts/Statistics/FileStatisticsHandler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2ff260e6b8a2b5a40af72e91f1687ba9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Statistics/IStatisticsData.cs b/Assets/Scripts/Statistics/IStatisticsData.cs new file mode 100644 index 0000000..2bb966f --- /dev/null +++ b/Assets/Scripts/Statistics/IStatisticsData.cs @@ -0,0 +1,10 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public interface IStatisticsData +{ + void LoadStatistics(StatisticsData data); + + void SaveStatistics(ref StatisticsData data); +} \ No newline at end of file diff --git a/Assets/Scripts/Statistics/IStatisticsData.cs.meta b/Assets/Scripts/Statistics/IStatisticsData.cs.meta new file mode 100644 index 0000000..71fca0e --- /dev/null +++ b/Assets/Scripts/Statistics/IStatisticsData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8e9f48bdba97d234ab61f606140897af +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Statistics/InGameTextStatistics.cs b/Assets/Scripts/Statistics/InGameTextStatistics.cs new file mode 100644 index 0000000..2f92e80 --- /dev/null +++ b/Assets/Scripts/Statistics/InGameTextStatistics.cs @@ -0,0 +1,80 @@ +using System.Collections; +using System.Collections.Generic; +using Nightmare; +using UnityEngine; +using UnityEngine.UI; + + +public class InGameTextStatistics : MonoBehaviour, IDataPersistance +{ + public static int score; + public static int shotsFired; + public static int shotsHit; + public static double shotAccuracy; + public static double distanceTraveled; + public static double playTime; + public static int enemiesKilled; + + public Text statistics; + + void Awake() + { + InGameTextStatistics.score = 0; + InGameTextStatistics.shotsFired = 0; + InGameTextStatistics.shotsHit = 0; + InGameTextStatistics.shotAccuracy = 0; + InGameTextStatistics.distanceTraveled = 0; + InGameTextStatistics.playTime = 0; + InGameTextStatistics.enemiesKilled = 0; + + this.statistics = GetComponent<Text>(); + } + + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + string timeText = System.TimeSpan.FromSeconds(InGameTextStatistics.playTime).ToString("mm':'ss"); + if (InGameTextStatistics.shotsFired != 0) + { + InGameTextStatistics.shotAccuracy = ((double)InGameTextStatistics.shotsHit / InGameTextStatistics.shotsFired) * 100; + } + + statistics.text = "Score: " + InGameTextStatistics.score + "\n" + + "Shots Fired: " + InGameTextStatistics.shotsFired + "\n" + + "Shots Hit: " + InGameTextStatistics.shotsHit + "\n" + + "Shot Accuracy: " + InGameTextStatistics.shotAccuracy.ToString("F2") + "%\n" + + "Distance Traveled: " + (InGameTextStatistics.distanceTraveled / 1000).ToString("F3") + "km \n" + + "Play Time: " + timeText + "\n" + + "Enemies Killed: " + InGameTextStatistics.enemiesKilled + "\n"; + } + + + public void LoadData(GameData data) + { + InGameTextStatistics.score = data.score; + InGameTextStatistics.shotsFired = data.shotsFired; + InGameTextStatistics.shotsHit = data.shotsHit; + InGameTextStatistics.shotAccuracy = data.shotAccuracy; + InGameTextStatistics.distanceTraveled = data.distanceTraveled; + InGameTextStatistics.playTime = data.playTime; + InGameTextStatistics.enemiesKilled = data.enemiesKilled; + } + + public void SaveData(ref GameData data) + { + data.score = InGameTextStatistics.score; + data.shotsFired = InGameTextStatistics.shotsFired; + data.shotsHit = InGameTextStatistics.shotsHit; + data.shotAccuracy = InGameTextStatistics.shotAccuracy; + data.distanceTraveled = InGameTextStatistics.distanceTraveled; + data.playTime = InGameTextStatistics.playTime; + data.enemiesKilled = InGameTextStatistics.enemiesKilled; + } + +} diff --git a/Assets/Scripts/Statistics/InGameTextStatistics.cs.meta b/Assets/Scripts/Statistics/InGameTextStatistics.cs.meta new file mode 100644 index 0000000..31c50d2 --- /dev/null +++ b/Assets/Scripts/Statistics/InGameTextStatistics.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3a1b1fd2ea7f4004d96dfa72e9c63b68 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Statistics/Statistics Data.meta b/Assets/Scripts/Statistics/Statistics Data.meta new file mode 100644 index 0000000..50e3a9f --- /dev/null +++ b/Assets/Scripts/Statistics/Statistics Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4ae84c53c4b9d51488b895a749eb0f74 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Statistics/Statistics Data/StatisticsData.cs b/Assets/Scripts/Statistics/Statistics Data/StatisticsData.cs new file mode 100644 index 0000000..42b3ed8 --- /dev/null +++ b/Assets/Scripts/Statistics/Statistics Data/StatisticsData.cs @@ -0,0 +1,29 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[System.Serializable] + +public class StatisticsData +{ + public int shotsFired; + public int shotsHit; + public double shotAccuracy; + public double distanceTraveled; + public double playTime; + public int highScore; + public int allTimeScore; + public int enemiesKilled; + + public StatisticsData() + { + this.shotsFired = 0; + this.shotsHit = 0; + this.shotAccuracy = 0; + this.distanceTraveled = 0; + this.playTime = 0; + this.highScore = 0; + this.allTimeScore = 0; + this.enemiesKilled = 0; + } +} \ No newline at end of file diff --git a/Assets/Scripts/Statistics/Statistics Data/StatisticsData.cs.meta b/Assets/Scripts/Statistics/Statistics Data/StatisticsData.cs.meta new file mode 100644 index 0000000..ec6ec16 --- /dev/null +++ b/Assets/Scripts/Statistics/Statistics Data/StatisticsData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a7ec8968b17a5eb48b18196a0bc17f79 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Statistics/StatisticsManager.cs b/Assets/Scripts/Statistics/StatisticsManager.cs new file mode 100644 index 0000000..ac668f9 --- /dev/null +++ b/Assets/Scripts/Statistics/StatisticsManager.cs @@ -0,0 +1,85 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using System.Linq; + +public class StatisticsManager : MonoBehaviour +{ + [Header("File Storage Config")] + [SerializeField] private string fileNameStatistics; + + private StatisticsData statisticsData; + + private List<IStatisticsData> statisticsDataObjects; + private FileStatisticsHandler dataHandler; + + + public static StatisticsManager instance { get; private set; } + + + public void Awake() + { + if (instance != null) + { + Debug.LogError("Found more than one Statistics Manager in the scene."); + } + instance = this; + } + + private void Start() + { + this.dataHandler = new FileStatisticsHandler(Application.persistentDataPath, fileNameStatistics); + this.statisticsDataObjects = FindAllStatisticsObjects(); + LoadStatistics(); + } + + public void NewStatistics() + { + this.statisticsData = new StatisticsData(); + } + + public void LoadStatistics() + { + // load any saved data form a file using the data handler + this.statisticsData = dataHandler.Load(); + + + // if no data can be loaded, initialize to a new game + if (this.statisticsData == null) + { + NewStatistics(); + } + + // push the loaded data to all other scipts that need it + foreach (IStatisticsData statisticsDataObj in statisticsDataObjects) + { + statisticsDataObj.LoadStatistics(statisticsData); + } + + } + public void SaveStatistics() + { + // pass the data to other scripts so they can update it + foreach (IStatisticsData statisticsDataObj in statisticsDataObjects) + { + statisticsDataObj.SaveStatistics(ref statisticsData); + } + + // save that data to a file using the data handler + dataHandler.Save(statisticsData); + } + + private void OnApplicationQuit() + { + SaveStatistics(); + } + + private List<IStatisticsData> FindAllStatisticsObjects() + { + IEnumerable<IStatisticsData> statisticsDataObjects = FindObjectsOfType<MonoBehaviour>() + .OfType<IStatisticsData>(); + + return new List<IStatisticsData>(statisticsDataObjects); + } + +} diff --git a/Assets/Scripts/Statistics/StatisticsManager.cs.meta b/Assets/Scripts/Statistics/StatisticsManager.cs.meta new file mode 100644 index 0000000..c000382 --- /dev/null +++ b/Assets/Scripts/Statistics/StatisticsManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 020faba715af37d47b8c8de88a1840ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Statistics/TextStatistics.cs b/Assets/Scripts/Statistics/TextStatistics.cs new file mode 100644 index 0000000..5414982 --- /dev/null +++ b/Assets/Scripts/Statistics/TextStatistics.cs @@ -0,0 +1,85 @@ +using System.Collections; +using System.Collections.Generic; +using Nightmare; +using UnityEngine; +using UnityEngine.UI; + + +public class TextStatistics : MonoBehaviour, IStatisticsData +{ + public static int shotsFired; + public static int shotsHit; + public static double shotAccuracy; + public static double distanceTraveled; + public static double playTime; + public static int highScore; + public static int allTimeScore; + public static int enemiesKilled; + + public Text statistics; + + void Awake() + { + TextStatistics.shotsFired = 0; + TextStatistics.shotsHit = 0; + TextStatistics.shotAccuracy = 0; + TextStatistics.distanceTraveled = 0; + TextStatistics.playTime = 0; + TextStatistics.highScore = 0; + TextStatistics.allTimeScore = 0; + TextStatistics.enemiesKilled = 0; + + this.statistics = GetComponent<Text>(); + } + + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + string timeText = System.TimeSpan.FromSeconds(TextStatistics.playTime).ToString("hh':'mm':'ss"); + if (TextStatistics.shotsFired != 0) + { + TextStatistics.shotAccuracy = ((double)TextStatistics.shotsHit / TextStatistics.shotsFired) * 100; + } + + statistics.text = "Shots Fired: " + TextStatistics.shotsFired + "\n" + + "Shots Hit: " + TextStatistics.shotsHit + "\n" + + "Shot Accuracy: " + TextStatistics.shotAccuracy.ToString("F2") + "%\n" + + "Distance Traveled: " + (TextStatistics.distanceTraveled / 1000).ToString("F3") + "km \n" + + "Play Time: " + timeText + "\n" + + "High Score: " + TextStatistics.highScore + "\n" + + "All Time Score: " + TextStatistics.allTimeScore + "\n" + + "Enemies Killed: " + TextStatistics.enemiesKilled + "\n"; + } + + + public void LoadStatistics(StatisticsData data) + { + TextStatistics.shotsFired = data.shotsFired; + TextStatistics.shotsHit = data.shotsHit; + TextStatistics.shotAccuracy = data.shotAccuracy; + TextStatistics.distanceTraveled = data.distanceTraveled; + TextStatistics.playTime = data.playTime; + TextStatistics.highScore = data.highScore; + TextStatistics.allTimeScore = data.allTimeScore; + TextStatistics.enemiesKilled = data.enemiesKilled; + } + + public void SaveStatistics(ref StatisticsData data) + { + data.shotsFired = TextStatistics.shotsFired; + data.shotsHit = TextStatistics.shotsHit; + data.shotAccuracy = TextStatistics.shotAccuracy; + data.distanceTraveled = TextStatistics.distanceTraveled; + data.playTime = TextStatistics.playTime; + data.highScore = InGameTextStatistics.score > TextStatistics.highScore ? InGameTextStatistics.score : TextStatistics.highScore; + data.allTimeScore = TextStatistics.allTimeScore; + data.enemiesKilled = TextStatistics.enemiesKilled; + } + +} diff --git a/Assets/Scripts/Statistics/TextStatistics.cs.meta b/Assets/Scripts/Statistics/TextStatistics.cs.meta new file mode 100644 index 0000000..19a582a --- /dev/null +++ b/Assets/Scripts/Statistics/TextStatistics.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eac6ca6c33fc23b4bacd03bb38e0618f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Weapons/DefaultGun.cs b/Assets/Scripts/Weapons/DefaultGun.cs index 051b609..4174113 100644 --- a/Assets/Scripts/Weapons/DefaultGun.cs +++ b/Assets/Scripts/Weapons/DefaultGun.cs @@ -44,6 +44,11 @@ public class DefaultGun : Weapons shootRay.origin = transform.position; shootRay.direction = transform.forward; + TextStatistics.shotsFired++; + InGameTextStatistics.shotsFired++; + + + // Perform the raycast against gameobjects on the shootable layer and if it hits something... if (Physics.Raycast(shootRay, out shootHit, range, shootableMask, QueryTriggerInteraction.Ignore)) { @@ -55,6 +60,8 @@ public class DefaultGun : Weapons { // ... the enemy should take damage. enemyHealth.TakeDamage(damagePerShot, shootHit.point); + TextStatistics.shotsHit++; + InGameTextStatistics.shotsHit++; } // Set the second position of the line renderer to the point the raycast hit. diff --git a/Assets/Scripts/Weapons/Shotgun.cs b/Assets/Scripts/Weapons/Shotgun.cs index 3c55626..fb94948 100644 --- a/Assets/Scripts/Weapons/Shotgun.cs +++ b/Assets/Scripts/Weapons/Shotgun.cs @@ -32,9 +32,16 @@ public class Shotgun : Weapons gunParticles.Stop(); gunParticles.Play(); + TextStatistics.shotsFired++; + InGameTextStatistics.shotsFired++; if (!isEnemyWeapon) { shootHit = Physics.SphereCastAll(transform.position, range, transform.forward, range, shootableMask, QueryTriggerInteraction.Ignore); + if (shootHit.Length > 0) + { + TextStatistics.shotsHit++; + InGameTextStatistics.shotsHit++; + } foreach (RaycastHit hit in shootHit) { EnemyHealth enemyHealth = hit.collider.GetComponent<EnemyHealth>(); -- GitLab