Made background music and started on difficulty slider
This commit is contained in:
12
Assets/Scripts/BackgroundMusic.cs
Normal file
12
Assets/Scripts/BackgroundMusic.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace InterfaceOff.MainMenu
|
||||
{
|
||||
public class BackgroundMusic : MonoBehaviour
|
||||
{
|
||||
private void Start()
|
||||
{
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/BackgroundMusic.cs.meta
Normal file
11
Assets/Scripts/BackgroundMusic.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a54fafe58853b204da37b60f25743c6a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
20
Assets/Scripts/DifficultyManager.cs
Normal file
20
Assets/Scripts/DifficultyManager.cs
Normal 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);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/DifficultyManager.cs.meta
Normal file
3
Assets/Scripts/DifficultyManager.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 985fe7203793456f84cbf0526b831a3a
|
||||
timeCreated: 1769122965
|
||||
Reference in New Issue
Block a user