Files
ichni_Official/Assets/Scripts/Settings/GameSettings.cs

66 lines
2.1 KiB
C#
Raw Normal View History

2025-06-06 10:14:55 -04:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
2025-08-11 14:04:06 -04:00
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
2025-06-06 10:14:55 -04:00
namespace Ichni
{
public class GameSettings
{
2025-08-11 14:04:06 -04:00
public int masterVolume = 50;
public int musicVolume = 50;
public int soundEffectVolume = 50;
public int uiVolume = 50;
2025-06-06 10:14:55 -04:00
public int targetFrame = 60;
2025-08-11 14:04:06 -04:00
public int resolutionLevel = 3;
public int beatmapOffset = 0;
2025-08-22 14:54:40 -04:00
public int languageIndex = 0;
2025-06-06 10:14:55 -04:00
public bool debugMode = false;
public GameSettings()
{
}
2025-08-11 14:04:06 -04:00
public GameSettings(int masterVolume, int musicVolume, int soundEffectVolume, int uiVolume,
2025-08-22 14:54:40 -04:00
int beatmapOffset, int targetFrame, int resolutionLevel, int languageIndex, bool debugMode)
2025-06-06 10:14:55 -04:00
{
2025-08-11 14:04:06 -04:00
this.masterVolume = masterVolume;
this.musicVolume = musicVolume;
2025-06-06 10:14:55 -04:00
this.soundEffectVolume = soundEffectVolume;
this.uiVolume = uiVolume;
2025-08-11 14:04:06 -04:00
this.beatmapOffset = beatmapOffset;
2025-06-06 10:14:55 -04:00
this.targetFrame = targetFrame;
2025-08-11 14:04:06 -04:00
this.resolutionLevel = resolutionLevel;
2025-08-22 14:54:40 -04:00
this.languageIndex = languageIndex;
2025-06-06 10:14:55 -04:00
this.debugMode = debugMode;
}
2025-08-11 14:04:06 -04:00
public void ApplyVolume()
{
AkSoundEngine.SetRTPCValue("MasterVolume", masterVolume);
AkSoundEngine.SetRTPCValue("MusicVolume", musicVolume);
AkSoundEngine.SetRTPCValue("SoundFXVolume", soundEffectVolume);
AkSoundEngine.SetRTPCValue("UIVolume", uiVolume);
}
public void ApplyGraphic()
{
Application.targetFrameRate = targetFrame;
UniversalRenderPipelineAsset currentUrpAsset = GraphicsSettings.renderPipelineAsset as UniversalRenderPipelineAsset;
2025-12-14 18:44:35 -05:00
currentUrpAsset.renderScale = 0.5f + 0.1f * resolutionLevel;
2025-08-11 14:04:06 -04:00
}
2025-08-22 14:54:40 -04:00
public void ApplyLanguage()
{
I2.Loc.LocalizationManager.CurrentLanguage = MenuManager.instance.languageList[languageIndex];
I2.Loc.LocalizationManager.UpdateSources();
}
2025-06-06 10:14:55 -04:00
}
}