HeavenStudioPlus/Assets/Scripts/GameProfiler.cs

37 lines
872 B
C#
Raw Permalink Normal View History

2021-12-19 04:10:43 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
2022-03-14 14:21:05 +00:00
namespace HeavenStudio
2021-12-19 04:10:43 +00:00
{
2021-12-21 01:10:49 +00:00
public class GameProfiler : MonoBehaviour
{
public float score = 0;
public int totalHits = 0;
2021-12-19 04:10:43 +00:00
2021-12-21 01:10:49 +00:00
public bool perfect = false;
2021-12-19 04:10:43 +00:00
2021-12-21 01:10:49 +00:00
public static GameProfiler instance { get; set; }
2021-12-19 04:10:43 +00:00
2021-12-21 01:10:49 +00:00
private void Awake()
{
instance = this;
DontDestroyOnLoad(this.gameObject);
}
private void Start()
{
perfect = true;
}
2021-12-19 04:10:43 +00:00
2021-12-21 01:10:49 +00:00
public void IncreaseScore()
{
totalHits++;
// score = GetPercent(totalHits, GameManager.instance.allPlayerActions.Count); broken right now will fix eventually
2021-12-21 01:10:49 +00:00
}
2021-12-19 04:10:43 +00:00
2021-12-21 01:10:49 +00:00
public float GetPercent(float value, float totalValue)
{
return (value / totalValue) * 100;
}
2021-12-19 04:10:43 +00:00
}
2021-12-21 01:10:49 +00:00
}