71 lines
2.3 KiB
C#
71 lines
2.3 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Rendering;
|
|
using UnityEngine.Rendering.Universal;
|
|
|
|
namespace Ichni
|
|
{
|
|
public class GameSettings
|
|
{
|
|
public int masterVolume = 50;
|
|
public int musicVolume = 50;
|
|
public int soundEffectVolume = 50;
|
|
public int uiVolume = 50;
|
|
|
|
public int targetFrame = 60;
|
|
public int resolutionLevel = 3;
|
|
|
|
public int beatmapOffset = 0;
|
|
|
|
public int languageIndex = 0;
|
|
|
|
public bool debugMode = false;
|
|
public bool judgeType = false;
|
|
public bool autoPlay = false;
|
|
|
|
public GameSettings()
|
|
{
|
|
|
|
}
|
|
|
|
public GameSettings(int masterVolume, int musicVolume, int soundEffectVolume, int uiVolume,
|
|
int beatmapOffset, int targetFrame, int resolutionLevel, int languageIndex, bool debugMode,
|
|
bool judgeType, bool autoPlay)
|
|
{
|
|
this.masterVolume = masterVolume;
|
|
this.musicVolume = musicVolume;
|
|
this.soundEffectVolume = soundEffectVolume;
|
|
this.uiVolume = uiVolume;
|
|
this.beatmapOffset = beatmapOffset;
|
|
this.targetFrame = targetFrame;
|
|
this.resolutionLevel = resolutionLevel;
|
|
this.languageIndex = languageIndex;
|
|
this.debugMode = debugMode;
|
|
this.judgeType = judgeType;
|
|
this.autoPlay = autoPlay;
|
|
}
|
|
|
|
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.defaultRenderPipeline as UniversalRenderPipelineAsset;
|
|
currentUrpAsset.renderScale = 0.5f + 0.1f * resolutionLevel;
|
|
}
|
|
|
|
public void ApplyLanguage()
|
|
{
|
|
I2.Loc.LocalizationManager.CurrentLanguage = MenuManager.instance.languageList[languageIndex];
|
|
I2.Loc.LocalizationManager.UpdateSources();
|
|
}
|
|
}
|
|
} |