您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
31 行
666 B
31 行
666 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Audio;
|
|
using UnityEngine.Serialization;
|
|
using UnityRoyale;
|
|
|
|
public class AudioManager : MonoBehaviour
|
|
{
|
|
public bool muteMusic = false;
|
|
|
|
public AudioMixer audioMixer;
|
|
public AudioMixerSnapshot gameplaySnapshot, endMatchSnapshot;
|
|
public AudioSource musicSource;
|
|
|
|
private AudioSource audioSource;
|
|
|
|
private void Awake()
|
|
{
|
|
audioSource = GetComponent<AudioSource>();
|
|
|
|
muteMusic = PlayerPrefs.GetInt(OptionsScreen.PlayerPrefsMuteMusicKey, 0) == 0;
|
|
|
|
audioSource.Play();
|
|
|
|
if (!muteMusic)
|
|
{
|
|
musicSource.Play();
|
|
}
|
|
}
|
|
}
|