Space-Smash-Out/Assets/Scripts/Managers/StatisticsManager.cs

35 lines
853 B
C#

using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using log4net;
using Unity.VisualScripting;
using UnityEngine;
namespace Managers
{
/// <summary>
/// Manages events which influence the overall statistics which accumulate,
/// when the game is played and progress is achieved.
/// </summary>
public class StatisticsManager : MonoBehaviour
{
private static ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private int FreeFlightScore = 0;
/// <summary>
/// Globally accessible member to use manager with.
/// </summary>
public static StatisticsManager G { get; private set; }
void Awake()
{
G = this;
Log.Info("Awake");
}
public void AddFreeFlightScore(int score)
{
FreeFlightScore += score;
UIManager.G.hUD.UpdateScore(FreeFlightScore);
}
}
}