Danil Iarosh 98d5285b46 feat(logging): add advanced logging example with file output
- 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
2025-11-07 14:12:50 +03:00

71 lines
2.0 KiB
C#

using RR.Common.UI;
using RR.Game2D.Core.Managers;
using UnityEngine;
namespace RR.Common.Behaviour.ScriptableObjects
{
[CreateAssetMenu(fileName = "GameSettings", menuName = "Game/GameSettings")]
public class GameSettings : ScriptableObject
{
// General settings
public bool isFullscreen;
// ATTENTION: Music between 0f and 1f
public float musicVolume;
public float sfxVolume;
// Payment settings
public bool isFreeGame;
public bool isGivingPrizes;
// Player settings
public int startLivesCount;
public int livesIncreasedByCredits;
public bool setLivesToDefaultAfterFirstLose;
public void SetDefaultValues()
{
isFullscreen = true;
musicVolume = 1f;
sfxVolume = 1f;
isFreeGame = false;
isGivingPrizes = true;
setLivesToDefaultAfterFirstLose = true;
startLivesCount = 3;
livesIncreasedByCredits = 1;
}
public void ValidateSettings()
{
if (musicVolume < 0f || musicVolume > 1f)
musicVolume = Mathf.Clamp01(musicVolume);
if (sfxVolume < 0f || sfxVolume > 1f)
sfxVolume = Mathf.Clamp01(sfxVolume);
if (startLivesCount < 1)
startLivesCount = 3;
if (livesIncreasedByCredits < 0)
livesIncreasedByCredits = 0;
}
public void ApplySettings()
{
if (isFullscreen)
FullscreenToggle.SetFullscreen(isFullscreen);
if (GameManager.Instance != null)
{
if (!setLivesToDefaultAfterFirstLose)
GameManager.Instance.ResetLives = true;
GameManager.Instance.Audio.SetMusicVolume(musicVolume);
GameManager.Instance.Audio.SetSfxVolume(sfxVolume);
}
}
}
}