diff --git a/Assets/Gun.cs b/Assets/Gun.cs index 52eb0271085b130bb7f96ff5717d636844506262..65e804423e0f90b135d3cb4971304d0d8ce1a24d 100644 --- a/Assets/Gun.cs +++ b/Assets/Gun.cs @@ -88,7 +88,7 @@ public class Gun : MonoBehaviour EnemyManager enemyHealth = hit.collider.GetComponent<EnemyManager>(); if (enemyHealth != null) { - GeneralStatistics.Instance.Kill += 1; + GeneralStatistics.Instance.totalHitCount += 1; enemyHealth.TakeDamage(damage*PlayerManager.PlayerDamageMultiplier, hit.point); } diff --git a/Assets/Scripts/Statistic/GeneralStatistics.cs b/Assets/Scripts/Statistic/GeneralStatistics.cs index a5df027411856e877f7e11c535e9f5dd88b86856..77cf828d0b7ddabdf95718b7404fa7f54521d55a 100644 --- a/Assets/Scripts/Statistic/GeneralStatistics.cs +++ b/Assets/Scripts/Statistic/GeneralStatistics.cs @@ -125,4 +125,9 @@ public class GeneralStatistics : MonoBehaviour return (float) totalKillCount / totalDeathCount; } + public float GetAccuracy() + { + return (float) totalHitCount / totalBulletCount; + } + } \ No newline at end of file diff --git a/Assets/Scripts/Statistic/StatisticsPage.cs b/Assets/Scripts/Statistic/StatisticsPage.cs index e61223c7b73060cab9d8eec1f8fd41320fa38833..6d0815a82936f25d55c8a5e7302ce0ecbd32033a 100644 --- a/Assets/Scripts/Statistic/StatisticsPage.cs +++ b/Assets/Scripts/Statistic/StatisticsPage.cs @@ -30,7 +30,7 @@ public class StatisticsPage : MonoBehaviour int seconds = Mathf.FloorToInt(generalStatistics.ElapsedTime % 60); // calculate seconds time.text = string.Format("{0:00}:{1:00}:{2:00}", hours, minutes, seconds); travelDistance.text = generalStatistics.TravelDistance.ToString(); - accuracy.text = generalStatistics.Accuracy.ToString(); + accuracy.text = generalStatistics.GetAccuracy().ToString(); kdr.text = generalStatistics.KillDeathRatio().ToString(); death.text = generalStatistics.Death.ToString(); kill.text = generalStatistics.Kill.ToString();