diff --git a/Assets/Prefabs/System/SettingSystem.prefab b/Assets/Prefabs/System/SettingSystem.prefab index ba7936e4..f95dbccc 100644 --- a/Assets/Prefabs/System/SettingSystem.prefab +++ b/Assets/Prefabs/System/SettingSystem.prefab @@ -885,7 +885,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 325, y: 88} + m_AnchoredPosition: {x: 127, y: 88} m_SizeDelta: {x: 360, y: 20} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &2676726580588217903 @@ -2088,7 +2088,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5} - m_AnchoredPosition: {x: 80, y: 130} + m_AnchoredPosition: {x: 130, y: 130} m_SizeDelta: {x: 200, y: 84.6133} m_Pivot: {x: 0.5, y: 1} --- !u!222 &1767295622917427692 @@ -2119,7 +2119,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: "\uD654\uBA74\uBAA8\uB4DC" + m_text: "\uD654\uBA74" m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 20df6cf4e3969cc46a9e547f18e066d3, type: 2} m_sharedMaterial: {fileID: 8267675722650998094, guid: 20df6cf4e3969cc46a9e547f18e066d3, type: 2} @@ -2153,7 +2153,7 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_HorizontalAlignment: 2 + m_HorizontalAlignment: 1 m_VerticalAlignment: 512 m_textAlignment: 65535 m_characterSpacing: 0 @@ -2783,7 +2783,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5} - m_AnchoredPosition: {x: 80, y: 130} + m_AnchoredPosition: {x: 130, y: 130} m_SizeDelta: {x: 200, y: 84.6133} m_Pivot: {x: 0.5, y: 1} --- !u!222 &6156808254248267116 @@ -2814,7 +2814,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: "\uC0AC\uC6B4\uB4DC" + m_text: "\uC18C\uB9AC" m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 20df6cf4e3969cc46a9e547f18e066d3, type: 2} m_sharedMaterial: {fileID: 8267675722650998094, guid: 20df6cf4e3969cc46a9e547f18e066d3, type: 2} @@ -2848,7 +2848,7 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_HorizontalAlignment: 2 + m_HorizontalAlignment: 1 m_VerticalAlignment: 512 m_textAlignment: 65535 m_characterSpacing: 0 @@ -2893,6 +2893,7 @@ GameObject: m_Component: - component: {fileID: 7427133140673661764} - component: {fileID: 6154748035360889642} + - component: {fileID: 335110141899180257} m_Layer: 5 m_Name: SFXSlider m_TagString: Untagged @@ -2974,6 +2975,18 @@ MonoBehaviour: m_OnValueChanged: m_PersistentCalls: m_Calls: [] +--- !u!114 &335110141899180257 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6482141921439642028} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0aa69005081197948ba9d97ffb482252, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &6584498748132185721 GameObject: m_ObjectHideFlags: 0 @@ -5153,7 +5166,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5} - m_AnchoredPosition: {x: 80, y: 130} + m_AnchoredPosition: {x: 130, y: 130} m_SizeDelta: {x: 200, y: 84.6133} m_Pivot: {x: 0.5, y: 1} --- !u!222 &9060029179700398446 @@ -5218,7 +5231,7 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_HorizontalAlignment: 2 + m_HorizontalAlignment: 1 m_VerticalAlignment: 512 m_textAlignment: 65535 m_characterSpacing: 0 diff --git a/Assets/Scripts/Runtime/Common/Presentation/SettingsUIPresenter.cs b/Assets/Scripts/Runtime/Common/Presentation/SettingsUIPresenter.cs index 58d86759..53daca29 100644 --- a/Assets/Scripts/Runtime/Common/Presentation/SettingsUIPresenter.cs +++ b/Assets/Scripts/Runtime/Common/Presentation/SettingsUIPresenter.cs @@ -1,5 +1,8 @@ using Runtime.Common.View; +using Runtime.ETC; +using Runtime.InGameSystem; using UnityEngine; +using UnityEngine.Rendering; namespace Runtime.Common.Presentation { @@ -12,6 +15,7 @@ public SettingsUIPresenter(SettingsUIView settingsUIView) _settingsUIView = settingsUIView; InitVolume(); + InitScreenMode(); _settingsUIView.BgmVolumeSlider.onValueChanged.AddListener(SetBgmVolume); _settingsUIView.SfxVolumeSlider.onValueChanged.AddListener(SetSfxVolume); @@ -28,6 +32,21 @@ private void InitVolume() _settingsUIView.SfxVolumeSlider.value = Managers.Data.SfxVolume; } + private void InitScreenMode() + { + if (Managers.Data.IsFullscreen) + { + _settingsUIView.FullScreenToggle.isOn = true; + SetFullScreenMode(true); + } + else + { + _settingsUIView.WindowScreenToggle.isOn = true; + SetWindowScreenMode(true); + } + } + + private void SetBgmVolume(float volume) { Managers.Data.BgmVolume = volume; @@ -43,12 +62,26 @@ private void SetSfxVolume(float volume) private void SetFullScreenMode(bool isOn) { - Screen.SetResolution(1920, 1080, FullScreenMode.FullScreenWindow); + if (isOn) + { + _settingsUIView.FullScreenToggle.interactable = false; + _settingsUIView.WindowScreenToggle.isOn = false; + _settingsUIView.WindowScreenToggle.interactable = true; + Managers.Data.IsFullscreen = true; + Screen.SetResolution(1920, 1080, FullScreenMode.FullScreenWindow); + } } private void SetWindowScreenMode(bool isOn) { - Screen.SetResolution(1920, 1080, FullScreenMode.Windowed); + if (isOn) + { + _settingsUIView.WindowScreenToggle.interactable = false; + _settingsUIView.FullScreenToggle.isOn = false; + _settingsUIView.FullScreenToggle.interactable = true; + Managers.Data.IsFullscreen = false; + Screen.SetResolution(1280, 720, FullScreenMode.Windowed); + } } private void OnGameExitButtonClicked() diff --git a/Assets/Scripts/Runtime/Manager/DataManager.cs b/Assets/Scripts/Runtime/Manager/DataManager.cs index ad0d446d..98f5fc36 100644 --- a/Assets/Scripts/Runtime/Manager/DataManager.cs +++ b/Assets/Scripts/Runtime/Manager/DataManager.cs @@ -13,6 +13,7 @@ public class GameData public int Chapter; public float BgmVolume; public float SfxVolume; + public bool isFullScreen; public CH1Data CH1; public CH2Data CH2; @@ -22,6 +23,7 @@ public GameData() Chapter = 1; BgmVolume = 0.5f; SfxVolume = 0.5f; + isFullScreen = true; CH1 = new CH1Data(); CH2 = new CH2Data(); } @@ -49,6 +51,12 @@ public float SfxVolume set { Mathf.Clamp(value, 0, 1); _gameData.SfxVolume = value; Managers.Sound.SFX.volume = value; } } + public bool IsFullscreen + { + get { return _gameData.isFullScreen; } + set { _gameData.isFullScreen = value; } + } + public CH1Data CH1 { get { return _gameData.CH1; } set { _gameData.CH1 = value; } } public CH2Data CH2 { get { return _gameData.CH2; } set { _gameData.CH2 = value; } } diff --git a/Assets/SettingSFXSlider.cs b/Assets/SettingSFXSlider.cs new file mode 100644 index 00000000..53a01ecf --- /dev/null +++ b/Assets/SettingSFXSlider.cs @@ -0,0 +1,21 @@ +using Runtime.ETC; +using System; +using System.Collections; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.EventSystems; + +public class SettingSFXSlider : MonoBehaviour, IPointerUpHandler +{ + private Slider slider; + + private void Start() + { + slider = GetComponent(); + } + + public void OnPointerUp(PointerEventData eventData) + { + Managers.Sound.Play(Sound.SFX, "SLG/SLG_Stone_SFX"); + } +} \ No newline at end of file diff --git a/Assets/SettingSFXSlider.cs.meta b/Assets/SettingSFXSlider.cs.meta new file mode 100644 index 00000000..e1070a1d --- /dev/null +++ b/Assets/SettingSFXSlider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0aa69005081197948ba9d97ffb482252 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: