started sound settings menu, still in progress
This commit is contained in:
@@ -438,6 +438,7 @@ GameObject:
|
|||||||
- component: {fileID: 7681847596368765025}
|
- component: {fileID: 7681847596368765025}
|
||||||
- component: {fileID: 4444498079052879519}
|
- component: {fileID: 4444498079052879519}
|
||||||
- component: {fileID: 5173819118098093347}
|
- component: {fileID: 5173819118098093347}
|
||||||
|
- component: {fileID: 1410439939888368689}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: GameManager
|
m_Name: GameManager
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -560,3 +561,15 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier: Assembly-CSharp::PlayerManager
|
m_EditorClassIdentifier: Assembly-CSharp::PlayerManager
|
||||||
CurrentToolIndex: 0
|
CurrentToolIndex: 0
|
||||||
|
--- !u!114 &1410439939888368689
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8685480739473632986}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: ab14394efecbd6540af369ced75e81d0, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: Assembly-CSharp::SoundSettingManager
|
||||||
|
|||||||
@@ -3,10 +3,13 @@
|
|||||||
|
|
||||||
public class PauseMenu : MonoBehaviour
|
public class PauseMenu : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
public Button SettingsButton;
|
||||||
public Button SaveButton;
|
public Button SaveButton;
|
||||||
public Button DeleteSaveButton;
|
public Button DeleteSaveButton;
|
||||||
public Button QuitButton;
|
public Button QuitButton;
|
||||||
|
|
||||||
|
public GameObject SettingsMenu;
|
||||||
|
|
||||||
public void ReloadReferences()
|
public void ReloadReferences()
|
||||||
{
|
{
|
||||||
// pull all game objs here
|
// pull all game objs here
|
||||||
@@ -14,6 +17,7 @@ public void ReloadReferences()
|
|||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
SettingsButton.onClick.AddListener(ShowSettings);
|
||||||
SaveButton.onClick.AddListener(SaveSystem.Save);
|
SaveButton.onClick.AddListener(SaveSystem.Save);
|
||||||
DeleteSaveButton.onClick.AddListener(SaveSystem.ClearSave);
|
DeleteSaveButton.onClick.AddListener(SaveSystem.ClearSave);
|
||||||
}
|
}
|
||||||
@@ -22,4 +26,9 @@ void Update()
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ShowSettings()
|
||||||
|
{
|
||||||
|
SettingsMenu.SetActive(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3838,6 +3838,17 @@ Transform:
|
|||||||
- {fileID: 2146681817}
|
- {fileID: 2146681817}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &1889534305 stripped
|
||||||
|
MonoBehaviour:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 249075524138301096, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 6325623361260993107}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Button
|
||||||
--- !u!1 &1892268938
|
--- !u!1 &1892268938
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -4375,10 +4386,46 @@ PrefabInstance:
|
|||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_TransformParent: {fileID: 1704696510}
|
m_TransformParent: {fileID: 1704696510}
|
||||||
m_Modifications:
|
m_Modifications:
|
||||||
|
- target: {fileID: 818899427131401759, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 1376587328550839904, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
- target: {fileID: 1376587328550839904, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
value: UI
|
value: UI
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 2975696880262954876, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3851509619645923519, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
||||||
|
propertyPath: m_IsActive
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 4155624016714589187, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.y
|
||||||
|
value: -201
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 4264548731807291060, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 4666577222808766051, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.y
|
||||||
|
value: -330.1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 4906462856215206936, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
||||||
|
propertyPath: m_AnchoredPosition.y
|
||||||
|
value: -76
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5101319162034548862, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 5514935285560916770, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 6792308726050395253, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
- target: {fileID: 6792308726050395253, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
||||||
propertyPath: m_LocalPosition.x
|
propertyPath: m_LocalPosition.x
|
||||||
value: 0
|
value: 0
|
||||||
@@ -4419,6 +4466,18 @@ PrefabInstance:
|
|||||||
propertyPath: m_LocalEulerAnglesHint.z
|
propertyPath: m_LocalEulerAnglesHint.z
|
||||||
value: 0
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 7535213278904715570, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 8504793874200787636, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
||||||
|
propertyPath: SettingsMenu
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 6325623361260993109}
|
||||||
|
- target: {fileID: 8504793874200787636, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
||||||
|
propertyPath: SettingsButton
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 1889534305}
|
||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_RemovedGameObjects: []
|
m_RemovedGameObjects: []
|
||||||
m_AddedGameObjects: []
|
m_AddedGameObjects: []
|
||||||
@@ -4429,6 +4488,11 @@ Transform:
|
|||||||
m_CorrespondingSourceObject: {fileID: 6792308726050395253, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
m_CorrespondingSourceObject: {fileID: 6792308726050395253, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
||||||
m_PrefabInstance: {fileID: 6325623361260993107}
|
m_PrefabInstance: {fileID: 6325623361260993107}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!1 &6325623361260993109 stripped
|
||||||
|
GameObject:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 3851509619645923519, guid: 6d1ef2b53d3ef0446852da522af66b73, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 6325623361260993107}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!1001 &7959480261809233915
|
--- !u!1001 &7959480261809233915
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ public class GameManager : MonoBehaviour
|
|||||||
public Inventory Inventory { get; private set; }
|
public Inventory Inventory { get; private set; }
|
||||||
public Storybools Storybools { get; private set; }
|
public Storybools Storybools { get; private set; }
|
||||||
public PauseMenu PauseMenu { get; private set; }
|
public PauseMenu PauseMenu { get; private set; }
|
||||||
|
public SoundSettingManager SoundSettingManager { get; private set; }
|
||||||
public PlayerController PlayerController { get; private set; }
|
public PlayerController PlayerController { get; private set; }
|
||||||
public Image BlackScreen { get; private set; }
|
public Image BlackScreen { get; private set; }
|
||||||
|
|
||||||
@@ -63,6 +64,9 @@ private void ReloadReferences()
|
|||||||
Instance.Inventory = GetComponent<Inventory>();
|
Instance.Inventory = GetComponent<Inventory>();
|
||||||
Instance.TimeManager = GetComponent<TimeManager>();
|
Instance.TimeManager = GetComponent<TimeManager>();
|
||||||
Instance.PlayerManager = GetComponent<PlayerManager>();
|
Instance.PlayerManager = GetComponent<PlayerManager>();
|
||||||
|
|
||||||
|
Instance.SoundSettingManager = GetComponent<SoundSettingManager>();
|
||||||
|
Instance.SoundSettingManager.ReloadReferences();
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Map Load Handling
|
#region Map Load Handling
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ MonoImporter:
|
|||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
defaultReferences: []
|
defaultReferences: []
|
||||||
executionOrder: -2
|
executionOrder: -501
|
||||||
icon: {instanceID: 0}
|
icon: {instanceID: 0}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ public struct SaveData
|
|||||||
public InventorySaveData InventorySaveData;
|
public InventorySaveData InventorySaveData;
|
||||||
public TimeSaveData TimeSaveData;
|
public TimeSaveData TimeSaveData;
|
||||||
public PlayerSaveData PlayerSaveData;
|
public PlayerSaveData PlayerSaveData;
|
||||||
|
public SoundSettingSaveData SoundSettingSaveData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string SaveFileName()
|
public static string SaveFileName()
|
||||||
@@ -61,6 +62,7 @@ private static void HandleSaveData()
|
|||||||
GameManager.Instance.TimeManager.SaveTime(ref _saveData.TimeSaveData);
|
GameManager.Instance.TimeManager.SaveTime(ref _saveData.TimeSaveData);
|
||||||
GameManager.Instance.PlayerManager.SavePlayerData(ref _saveData.PlayerSaveData);
|
GameManager.Instance.PlayerManager.SavePlayerData(ref _saveData.PlayerSaveData);
|
||||||
QuestRegistry.Instance.SaveQuestData(ref _saveData.QuestData);
|
QuestRegistry.Instance.SaveQuestData(ref _saveData.QuestData);
|
||||||
|
GameManager.Instance.SoundSettingManager.SaveSoundSettingsData(ref _saveData.SoundSettingSaveData);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Load()
|
public static void Load()
|
||||||
@@ -101,5 +103,6 @@ public static void HandleLoadData()
|
|||||||
GameManager.Instance.TimeManager.LoadTime(_saveData.TimeSaveData);
|
GameManager.Instance.TimeManager.LoadTime(_saveData.TimeSaveData);
|
||||||
GameManager.Instance.PlayerManager.LoadPlayerData(_saveData.PlayerSaveData);
|
GameManager.Instance.PlayerManager.LoadPlayerData(_saveData.PlayerSaveData);
|
||||||
QuestRegistry.Instance.LoadQuestData(_saveData.QuestData);
|
QuestRegistry.Instance.LoadQuestData(_saveData.QuestData);
|
||||||
|
GameManager.Instance.SoundSettingManager.LoadSoundSettingsData(_saveData.SoundSettingSaveData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class SoundSettingManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
float masterVolume;
|
||||||
|
float musicVolume;
|
||||||
|
float sfxVolume;
|
||||||
|
|
||||||
|
Slider MasterSlider;
|
||||||
|
Slider SfxSlider;
|
||||||
|
Slider MusicSlider;
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
MasterSlider.value = masterVolume;
|
||||||
|
SfxSlider.value = sfxVolume;
|
||||||
|
MusicSlider.value = musicVolume;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReloadReferences()
|
||||||
|
{
|
||||||
|
MasterSlider = GameObject.FindWithTag("MasterSlider").GetComponent<Slider>();
|
||||||
|
SfxSlider = GameObject.FindWithTag("SfxSlider").GetComponent<Slider>();
|
||||||
|
MusicSlider = GameObject.FindWithTag("MusicSlider").GetComponent<Slider>();
|
||||||
|
|
||||||
|
MasterSlider.onValueChanged.AddListener(OnMasterValueChanged);
|
||||||
|
SfxSlider.onValueChanged.AddListener(OnSfxValueChanged);
|
||||||
|
MusicSlider.onValueChanged.AddListener(OnMusicValueChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnMasterValueChanged(float newValue)
|
||||||
|
{
|
||||||
|
masterVolume = newValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnSfxValueChanged(float newValue)
|
||||||
|
{
|
||||||
|
sfxVolume = newValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnMusicValueChanged(float newValue)
|
||||||
|
{
|
||||||
|
musicVolume = newValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Sound Settings Data Save/Load
|
||||||
|
public void SaveSoundSettingsData(ref SoundSettingSaveData data)
|
||||||
|
{
|
||||||
|
data.musicVolume = musicVolume;
|
||||||
|
data.sfxVolume = sfxVolume;
|
||||||
|
data.masterVolume = masterVolume;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LoadSoundSettingsData(SoundSettingSaveData data)
|
||||||
|
{
|
||||||
|
musicVolume = data.musicVolume;
|
||||||
|
sfxVolume = data.sfxVolume;
|
||||||
|
masterVolume = data.masterVolume;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public struct SoundSettingSaveData
|
||||||
|
{
|
||||||
|
public float musicVolume;
|
||||||
|
public float sfxVolume;
|
||||||
|
public float masterVolume;
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ab14394efecbd6540af369ced75e81d0
|
||||||
+2134
-3
File diff suppressed because it is too large
Load Diff
@@ -14,6 +14,9 @@ TagManager:
|
|||||||
- ItemPickupText
|
- ItemPickupText
|
||||||
- DialogContainer
|
- DialogContainer
|
||||||
- PauseMenu
|
- PauseMenu
|
||||||
|
- MasterSlider
|
||||||
|
- SfxSlider
|
||||||
|
- MusicSlider
|
||||||
layers:
|
layers:
|
||||||
- Default
|
- Default
|
||||||
- TransparentFX
|
- TransparentFX
|
||||||
|
|||||||
Reference in New Issue
Block a user