- 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
39 lines
929 B
C#
39 lines
929 B
C#
using UnityEngine;
|
|
|
|
namespace RR.Common.Managers
|
|
{
|
|
public class PaymentManager : MonoBehaviour
|
|
{
|
|
public static PaymentManager Instance { get; private set; }
|
|
|
|
public int CreditsCount;
|
|
|
|
public void Initialize()
|
|
{
|
|
if (Instance != null && Instance != this)
|
|
{
|
|
Destroy(gameObject);
|
|
return;
|
|
}
|
|
|
|
Instance = this;
|
|
DontDestroyOnLoad(gameObject);
|
|
|
|
CreditsCount = 0;
|
|
|
|
ComWrapper.OnCreditAdded.AddListener(UpdateCredits);
|
|
}
|
|
|
|
private void UpdateCredits(int newCreditsCount)
|
|
{
|
|
CreditsCount = newCreditsCount;
|
|
}
|
|
|
|
// Если не инициализируется в GameManager, инициализировать тут
|
|
// private void Awake()
|
|
// {
|
|
// Initialize();
|
|
// }
|
|
}
|
|
}
|