Made background music and started on difficulty slider

This commit is contained in:
2026-01-22 23:18:33 +00:00
parent b3e5769758
commit 3c25ec932f
9 changed files with 253 additions and 28 deletions

View File

@@ -0,0 +1,12 @@
using UnityEngine;
namespace InterfaceOff.MainMenu
{
public class BackgroundMusic : MonoBehaviour
{
private void Start()
{
DontDestroyOnLoad(gameObject);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a54fafe58853b204da37b60f25743c6a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,20 @@
using UnityEngine.UI;
using UnityEngine;
namespace InterfaceOff.MainMenu
{
public class DifficultyManager : MonoBehaviour
{
public static float DifficultyMultiplier { get; private set; } = 1;
[SerializeField] private Slider DifficultySlider;
private void Awake()
{
DifficultySlider.onValueChanged.AddListener((val) =>
{
DifficultyMultiplier = val / 4f; // Makes it between 0.75 and 1.25
Debug.Log("Difficulty Slider: " + DifficultyMultiplier);
});
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 985fe7203793456f84cbf0526b831a3a
timeCreated: 1769122965