- Created AdvancedLoggingExample class demonstrating composite and file loggers - Implemented multi-file logging setup with separate error and full logs - Added game event and performance logging methods - Included key input handling for log operations (flush, clear) - Setup proper resource disposal on application quit
47 lines
1.8 KiB
C#
47 lines
1.8 KiB
C#
using System;
|
|
using RR.Game2D.Core.Managers;
|
|
using UnityEngine;
|
|
using UnityEngine.InputSystem;
|
|
|
|
namespace RR.Common.Managers
|
|
{
|
|
public class GlobalsManager : MonoBehaviour
|
|
{
|
|
private SettingsManager _settingsManager;
|
|
private ComWrapper _comWrapper;
|
|
private In _in;
|
|
private PrizeSystem _prizeSystem;
|
|
private ComInputToInputSystemAdapter _adapter;
|
|
|
|
private void Awake()
|
|
{
|
|
GameManager.Logger.Log(name ,"Initializing global objects...");
|
|
_settingsManager = GetComponent<SettingsManager>();
|
|
_comWrapper = GetComponent<ComWrapper>();
|
|
_in = GetComponent<In>();
|
|
_prizeSystem = GetComponent<PrizeSystem>();
|
|
_adapter = GetComponent<ComInputToInputSystemAdapter>();
|
|
|
|
if (_comWrapper == null) gameObject.AddComponent<ComWrapper>();
|
|
if (_in == null) gameObject.AddComponent<In>();
|
|
if (_prizeSystem == null) gameObject.AddComponent<PrizeSystem>();
|
|
if (_settingsManager == null) gameObject.AddComponent<SettingsManager>();
|
|
if (_adapter == null) gameObject.AddComponent<ComInputToInputSystemAdapter>();
|
|
|
|
_settingsManager.Initialize();
|
|
GameManager.Logger.Log(name, "SettingsManager successfully initialized.");
|
|
|
|
_comWrapper.Initialize();
|
|
GameManager.Logger.Log(name, "ComWrapper successfully initialized.");
|
|
|
|
_in.Initialize();
|
|
GameManager.Logger.Log(name, "In.cs successfully initialized.");
|
|
|
|
_prizeSystem.Initialize();
|
|
GameManager.Logger.Log(name, "PrizeSystem successfully initialized.");
|
|
|
|
_adapter.Initialize();
|
|
GameManager.Logger.Log(name, "InputAdapter successfully initialized.");
|
|
}
|
|
}
|
|
} |