Projext/Assets/02_Scripts/UI/Menu/ClickSettingsManager.cs
hydrozen e989d20668 카툰 쉐이더 추가 + 중복 스크립트 수정 + 전체 업데이트
- ToonPostProcess.shader: 횃불 고딕 스타일 후처리 쉐이더 (Built-in RP)
- ToonCameraEffect.cs: 카메라 자동 부착 후처리 스크립트
- 중복 UI 스크립트 제거 (MenuIntroController, ToggleCustom)
- 씬, 프리팹, 애니메이션 등 전체 업데이트

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 12:31:16 +09:00

340 lines
11 KiB
C#

using UnityEngine;
using UnityEngine.UI;
using TMPro;
using UnityEngine.Audio;
using UnityEngine.Rendering.PostProcessing;
public class ClickSettingsManager : MonoBehaviour
{
[Header("--- 화면 ---")]
public DropdownCustom ;
private string = "1920 X 1080";
private int = 0;
[Header("--- 그래픽 ---")]
public Slider ;
private int = 0;
private int = 0;
private int = 0;
[Header("--- 효과 ---")]
public ToggleCustom ;
public ToggleCustom ;
public ToggleCustom ;
[Header("--- 시스템 ---")]
public TMP_InputField ;
[Header("--- 오디오 ---")]
public Slider ;
public Slider BGM볼륨슬라이더;
public Slider ;
public Slider ;
public DropdownCustom ;
[Header("--- AudioMixer ---")]
public AudioMixer ;
[Header("--- 게임 ---")]
public Slider ;
private string = "한국어";
[Header("--- 버튼 셀렉터 ---")]
public ButtonSelector ;
public ButtonSelector ;
public ButtonSelector ;
public ButtonSelector ;
[Header("--- 취소버튼 ---")]
public Button ;
public Sprite ;
public Sprite ;
public Color = new Color(1f, 0.85f, 0.2f); // 황금빛
public Color = new Color(0.4f, 0.4f, 0.4f); // 회색
[Header("--- 조작 ---")]
public KeyRebinder ;
[Header("--- Post Processing ---")]
public PostProcessVolume ;
// 마지막으로 적용된 값 저장용
private int = 0;
private int = 0;
private int = 0;
private int = 0;
private string = "1920 X 1080";
private bool = false;
void Start()
{
();
}
// ── 취소버튼 활성/비활성 ────────────────
void ()
{
= false;
.interactable = false;
.GetComponent<Image>().sprite = ;
// 텍스트 색상 변경
TextMeshProUGUI = .GetComponentInChildren<TextMeshProUGUI>();
if ( != null)
.color = ;
}
void ()
{
if () return;
= true;
.interactable = true;
.GetComponent<Image>().sprite = ;
// 텍스트 색상 변경
TextMeshProUGUI = .GetComponentInChildren<TextMeshProUGUI>();
if ( != null)
.color = ;
}
// ── 화면 모드 선택 ──────────────────────
public void () { = 0; (); }
public void () { = 1; (); }
public void () { = 2; (); }
// ── 해상도 선택 ─────────────────────────
public void (string )
{
= ;
();
}
// ── 그래픽 선택 ─────────────────────────
public void (int ) { = ; (); }
public void (int ) { = ; (); }
public void (int ) { = ; (); }
// ── 적용 버튼 ───────────────────────────
public void ()
{
= ;
= ;
= ;
= ;
= ;
();
();
();
();
();
PlayerPrefs.Save();
Debug.Log("설정 적용 완료!");
}
// ── 취소 버튼 ───────────────────────────
public void ()
{
= ;
= ;
= ;
= ;
= ;
if ( != null) .();
if ( != null) .();
if ( != null) .();
if ( != null) .();
();
();
();
Debug.Log("취소됨!");
}
// ── 기본값 복원 ─────────────────────────
public void ()
{
= 0;
= 2;
= 2;
= 2;
if ( != null) .(2);
if ( != null) .(2);
if ( != null) .(2);
if ( != null) .(0);
if ( != null) .value = 100;
if ( != null) .value = 100;
if (BGM볼륨슬라이더 != null) BGM볼륨슬라이더.value = 100;
if ( != null) .value = 100;
if ( != null) .value = 100;
if ( != null)
.text = "60";
if ( != null) .(false);
if ( != null) .(false);
if ( != null) .(false);
// 키 리바인딩 기본값 복원 추가!
if ( != null) .();
// 게임 기본값
if ( != null)
.value = 50;
= "한국어";
();
();
();
();
();
();
PlayerPrefs.DeleteAll();
Debug.Log("기본값 복원 완료!");
}
// ── 화면 적용 ───────────────────────────
void ()
{
string[] = .Split('X');
if (.Length == 2)
{
int = int.Parse([0].Trim());
int = int.Parse([1].Trim());
Screen.SetResolution(, , Screen.fullScreen);
}
if ( == 0)
{
Screen.fullScreenMode = FullScreenMode.ExclusiveFullScreen;
Screen.fullScreen = true;
}
else if ( == 1)
{
Screen.fullScreenMode = FullScreenMode.Windowed;
Screen.fullScreen = false;
}
else if ( == 2)
{
Screen.fullScreenMode = FullScreenMode.FullScreenWindow;
Screen.fullScreen = true;
}
}
// ── 그래픽 적용 ─────────────────────────
void ()
{
if ( != null)
PlayerPrefs.SetFloat("FOV", .value);
QualitySettings.globalTextureMipmapLimit = 2 - ;
Debug.Log("텍스처 적용: " + QualitySettings.globalTextureMipmapLimit);
if ( == 0)
{
QualitySettings.shadows = ShadowQuality.Disable;
Debug.Log("그림자: 꺼짐");
}
else if ( == 1)
{
QualitySettings.shadows = ShadowQuality.HardOnly;
Debug.Log("그림자: 보통");
}
else
{
QualitySettings.shadows = ShadowQuality.All;
Debug.Log("그림자: 높음");
}
if ( != null)
PlayerPrefs.SetInt("AntiAliasing", .() ? 1 : 0);
if ( != null)
PlayerPrefs.SetInt("Bloom", .() ? 1 : 0);
if ( != null)
PlayerPrefs.SetInt("ScreenShake", .() ? 1 : 0);
}
// ── 오디오 적용 ─────────────────────────
void ()
{
if ( != null)
{
float = .value;
PlayerPrefs.SetFloat("MasterVolume", );
.SetFloat("MasterVolume",
> 0 ? Mathf.Log10( / 100f) * 20 : -80f);
}
if (BGM볼륨슬라이더 != null)
{
float = BGM볼륨슬라이더.value;
PlayerPrefs.SetFloat("BGMVolume", );
.SetFloat("BGMVolume",
> 0 ? Mathf.Log10( / 100f) * 20 : -80f);
}
if ( != null)
{
float = .value;
PlayerPrefs.SetFloat("SFXVolume", );
.SetFloat("SFXVolume",
> 0 ? Mathf.Log10( / 100f) * 20 : -80f);
}
if ( != null)
{
float = .value;
PlayerPrefs.SetFloat("ENVVolume", );
.SetFloat("ENVVolume",
> 0 ? Mathf.Log10( / 100f) * 20 : -80f);
}
}
// ── 시스템 적용 ─────────────────────────
void ()
{
if ( != null && .text != "")
{
int = int.Parse(.text);
Application.targetFrameRate = ;
PlayerPrefs.SetInt("TargetFPS", );
}
}
// ── 게임 적용 ─────────────────────────
void ()
{
// 밝기 적용
if ( != null && != null)
{
float = .value;
PlayerPrefs.SetFloat("Brightness", );
ColorGrading ;
if (.profile.TryGetSettings(out ))
{
// 0~100 슬라이더 값을 -3~3 범위로 변환
.postExposure.value = ( / 100f - 0.5f) * 6f;
}
}
// 언어 저장
PlayerPrefs.SetString("Language", );
Debug.Log("언어 저장: " + );
}
// ── 언어 ─────────────────────────
public void (string )
{
= ;
();
}
}