2025-08-11 14:04:06 -04:00
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using DG.Tweening;
|
|
|
|
|
using Ichni.UI;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.Serialization;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
namespace Ichni.Menu
|
|
|
|
|
{
|
|
|
|
|
public partial class SettingsWindowController : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public GameSettings gameSettings => SettingsManager.instance.gameSettings;
|
|
|
|
|
|
|
|
|
|
public CanvasGroup canvasGroup;
|
|
|
|
|
|
2025-08-27 21:45:18 -04:00
|
|
|
public RectTransform buttonsContainer;
|
2025-08-11 14:04:06 -04:00
|
|
|
public Button audioButton;
|
|
|
|
|
public Button graphicsButton;
|
|
|
|
|
public Button gameplayButton;
|
|
|
|
|
public Button rebindingButton;
|
|
|
|
|
public Button debugButton;
|
|
|
|
|
|
|
|
|
|
public AudioSettingsWindow audioSettingsWindow;
|
|
|
|
|
public GraphicsSettingsWindow graphicsSettingsWindow;
|
|
|
|
|
public GamePlaySettingsWindow gamePlaySettingsWindow;
|
|
|
|
|
public RebindingWindow rebindingWindow;
|
|
|
|
|
public DebugSettingsWindow debugSettingsWindow;
|
|
|
|
|
|
|
|
|
|
public SettingsWindow currentSettingsWindow;
|
|
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
|
{
|
|
|
|
|
audioButton.onClick.AddListener(() => OpenWindow(audioSettingsWindow));
|
|
|
|
|
graphicsButton.onClick.AddListener(() => OpenWindow(graphicsSettingsWindow));
|
|
|
|
|
gameplayButton.onClick.AddListener(() => OpenWindow(gamePlaySettingsWindow));
|
|
|
|
|
#if UNITY_IOS || UNITY_ANDROID
|
|
|
|
|
rebindingButton.gameObject.SetActive(false);
|
|
|
|
|
#endif
|
|
|
|
|
rebindingButton.onClick.AddListener(() => OpenWindow(rebindingWindow));
|
|
|
|
|
debugButton.onClick.AddListener(() => OpenWindow(debugSettingsWindow));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Start()
|
|
|
|
|
{
|
|
|
|
|
Initialize();
|
|
|
|
|
OpenWindow(audioSettingsWindow);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Initialize()
|
|
|
|
|
{
|
|
|
|
|
audioSettingsWindow.Initialize();
|
|
|
|
|
graphicsSettingsWindow.Initialize();
|
|
|
|
|
gamePlaySettingsWindow.Initialize();
|
|
|
|
|
rebindingWindow.Initialize();
|
|
|
|
|
debugSettingsWindow.Initialize();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void OpenWindow(SettingsWindow targetWindow)
|
|
|
|
|
{
|
|
|
|
|
currentSettingsWindow?.gameObject.SetActive(false);
|
|
|
|
|
currentSettingsWindow = targetWindow;
|
|
|
|
|
targetWindow.gameObject.SetActive(true);
|
|
|
|
|
targetWindow.SetValuesFromSettings();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public partial class SettingsWindowController
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|