using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Audio : MonoBehaviour
{
public Slider AP; //实例化一个Slider
public AudioSource audios;
public AudioSource audios1;
// Start is called before the first frame update
void Start()
{
AP.value = 0.5f;
audios = GetComponent<AudioSource>();//获取音频组件
}
// Update is called once per frame
void Update()
{
}
public void stopAudio()
{
audios.Pause();
}
public void playAudio()
{
audios.Play(1);
}
public void Sound()
{
audios.volume = AP.value;
audios1.Play(1);
}
}