using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public partial class settings : MonoBehaviour {
public AudioSource Music;
public Slider bar;
private void Awake()
{
Music = GetComponent<AudioSource>();
}
public void Start()
{
Music.Play();
}
public void Update()
{
AudioListener.volume = GlobalSettings.musicVolume;
float newVolume = bar.value;
NewMethod(newVolume);
}
public static void NewMethod(float newVolume)
{
GlobalSettings.musicVolume = newVolume;
}
}
using NUnit.Framework;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class audioplay : MonoBehaviour
{
public AudioSource Music;
private void Awake()
{
Music = GetComponent<AudioSource>();
}
// Use this for initialization
void Start () {
Music.Play();
}
// Update is called once per frame
void Update () {
}
}