本文整理汇总了C#中UnityEngine.AudioSource.Pause方法的典型用法代码示例。如果您正苦于以下问题:C# AudioSource.Pause方法的具体用法?C# AudioSource.Pause怎么用?C# AudioSource.Pause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.AudioSource
的用法示例。
在下文中一共展示了AudioSource.Pause方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start () {
InvokeRepeating("CreateMyInstance", 1.0f, 1.0f);
// Checks the value of muteSound that is set on Home Screen page via the mute sound button.
muteSoundValueCheck = PlayerPrefs.GetString("SoundValue") ;
// Debug.Log(muteSoundValueCheck);
// Fetches engine sound attached to Main Camera object
soundObject = GameObject.Find("Camera");
audioSource = soundObject.GetComponent<AudioSource>();
// Fetches Car Dash sound attached to 'car-control-cube' object
soundObject2 = GameObject.Find("car-control-cube");
audioSource2 = soundObject.GetComponent<AudioSource>();
if (muteSoundValueCheck == "mute") {
audioSource.Pause();
audioSource2.Pause();
}
}
示例2: Start
void Start()
{
audio = GetComponent<AudioSource>();
ParentAudio = transform.parent.gameObject.GetComponent<AudioSource>();
if (audio.isPlaying)
audio.Pause();
}
示例3: Start
public override void Start()
{
base.Start();
_audio = this.GetComponent<AudioSource>();
_baseVolume = _audio.volume;
_audio.Pause();
}
示例4: Start
void Start()
{
Player = GameObject.FindGameObjectWithTag ("Player");
GetComponent<MeshRenderer>().enabled = false;
Scare = false;
audiosource = this.GetComponent<AudioSource>();
audiosource.Pause ();
}
示例5: PauseMusic
IEnumerator PauseMusic(AudioSource toPause, AudioMixerSnapshot current, float time)
{
yield return new WaitForSeconds(time);
if (this.current == current)
{
toPause.Pause();
}
}
示例6: Start
void Start()
{
float distance = father.transform.localScale.x;
float radian = Mathf.Min (distance, father.transform.localScale.z);
transform.localScale = new Vector3 (2.0f - radian / distance, transform.localScale.y, 1.0f);
OnUpdateVariable ();
frictionSound = father.GetComponent<AudioSource> ();
frictionSound.Pause ();
}
示例7: Start
void Start ()
{
Transform father = transform.parent;
distance = father.localScale.x;
float radian = Mathf.Min (distance, father.localScale.z);
transform.localScale = new Vector3 (2f - radian / distance, transform.localScale.y, 1f);
frictionSound = father.gameObject.GetComponent<AudioSource> ();
frictionSound.Pause ();
beltRenders = GetComponentsInChildren<Renderer> ();
}
示例8: FadeOut
private void FadeOut(AudioSource audioSource)
{
if(audioSource.volume > 0f) {
audioSource.volume -= .05f;
//print ("offing" + audioSource.clip.name);
}
if (audioSource.volume == 0f) {
audioSource.Pause ();
}
}
示例9: Start
void Start()
{
audio = GetComponent<AudioSource>();
if(audio == null)
{
Debug.Log("Hello World");
}
audio.Pause();
ammoCount = 15;
}
示例10: Start
void Start()
{
music = GetComponent<AudioSource>();
if (PlayerPrefs.HasKey ("Music")) {
int audio = PlayerPrefs.GetInt("Music");
if(audio == 0){
musicOn = false;
music.Pause();
}
}
}
示例11: Start
//public AudioClip Clip;// = null;
// Use this for initialization
void Start()
{
//initiate audio source
_audioSource = GetComponent<AudioSource>();
float r = Random.Range(-PitchVariation, PitchVariation);
_audioSource.pitch += r;
//_audioSource.clip = Clip;
//set random start
_random = Random.Range(LowerRange/Frequency, Upperrange/Frequency);
_random += PitchOffset;
_audioSource.Pause();
_clipLength = _audioSource.clip.length;
}
示例12: Start
// Use this for initialization
void Start()
{
// audioPause = GetComponent<AudioSource>();
// audioPause.Pause();
// audioLevelOne = GetComponent<AudioSource>();
// audioLevelOne.Play();
AudioSource[] audios = GetComponents<AudioSource>();
audioPause = audios[1];
audioLevelOne = audios[0];
audioPause.Pause();
}
示例13: Start
// Use this for initialization
void Start () {
music_isplaying = PlayerPrefs.GetInt(Common_data.music_pref, 1);
sound_isplaying = PlayerPrefs.GetInt(Common_data.sound_pref, 1);
audio = this.gameObject.GetComponent<AudioSource>();
if (music_isplaying == 1)
{
audio.Play();
}
else {
audio.Pause();
}
}
示例14: Start
// Use this for initialization
void Start () {
Time.timeScale = 1.0f;
manager.loadAchievements();
isPaused = false;
isOpen = false;
PlayerProfile.profile.load ();
pauseSource = GetComponent<AudioSource> ();
pauseSource.ignoreListenerPause = true;
pauseSource.Play ();
pauseSource.Pause ();
PanelControls.SetActive(false);
MovementTip.SetActive(false);
BasicCameraTip.SetActive(false);
SeeControlsTip.SetActive(false);
setPause (false);
tutTimer = PlayerProfile.profile.timeElapsedInPark;
}
示例15: PauseSound
public void PauseSound(AudioSource sound)
{
sound.Pause();
}