41 lines
962 B
C#
41 lines
962 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);
|
|
}
|
|
|
|
public void ResetScore()
|
|
{
|
|
FreeFlightScore = 0;
|
|
UIManager.G.HUD.UpdateScore(FreeFlightScore);
|
|
}
|
|
}
|
|
} |