当前位置: 首页>>代码示例>>C#>>正文


C# AudioSource.Pause方法代码示例

本文整理汇总了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();
			
		}


	}
开发者ID:Asutosh11,项目名称:CountryDriver,代码行数:27,代码来源:OppositeCars.cs

示例2: Start

    void Start()
    {
        audio = GetComponent<AudioSource>();
		ParentAudio = transform.parent.gameObject.GetComponent<AudioSource>();
        if (audio.isPlaying)
                audio.Pause();
    }
开发者ID:jerrybeanman,项目名称:GGJ2016-Freya-s-Temptations,代码行数:7,代码来源:Killable.cs

示例3: Start

 public override void Start()
 {
     base.Start();
     _audio = this.GetComponent<AudioSource>();
     _baseVolume = _audio.volume;
     _audio.Pause();
 }
开发者ID:DrSkipper,项目名称:ForAshley,代码行数:7,代码来源:MusicDurationHandler.cs

示例4: Start

 void Start()
 {
     Player = GameObject.FindGameObjectWithTag ("Player");
     GetComponent<MeshRenderer>().enabled = false;
     Scare = false;
     audiosource = this.GetComponent<AudioSource>();
     audiosource.Pause ();
 }
开发者ID:tbhosman,项目名称:Reaktor,代码行数:8,代码来源:JumpScareScript.cs

示例5: PauseMusic

    IEnumerator PauseMusic(AudioSource toPause, AudioMixerSnapshot current, float time)
    {
        yield return new WaitForSeconds(time);

        if (this.current == current)
        {
            toPause.Pause();
        }
    }
开发者ID:MarjieVolk,项目名称:ShopTilYouDrop,代码行数:9,代码来源:AudioSwitcher.cs

示例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 ();
 }
开发者ID:charlieusc,项目名称:Perplexus,代码行数:9,代码来源:BeltController.cs

示例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> ();
	}
开发者ID:Changtx,项目名称:Perplexes,代码行数:10,代码来源:BeltController.cs

示例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 ();
     }
 }
开发者ID:fdu5526,项目名称:balloon,代码行数:10,代码来源:FlowerPlayerAudio.cs

示例9: Start

    void Start()
    {
        audio = GetComponent<AudioSource>();
        if(audio == null)
        {
            Debug.Log("Hello World");
        }
        audio.Pause();

        ammoCount = 15;
    }
开发者ID:sweeseng789,项目名称:Interface,代码行数:11,代码来源:Weapon.cs

示例10: Start

 void Start()
 {
     music = GetComponent<AudioSource>();
     if (PlayerPrefs.HasKey ("Music")) {
         int audio = PlayerPrefs.GetInt("Music");
         if(audio == 0){
             musicOn = false;
             music.Pause();
         }
     }
 }
开发者ID:pavelstefan,项目名称:Kenney-s-Adventures,代码行数:11,代码来源:Music.cs

示例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;
 }
开发者ID:ThomasVanRiel,项目名称:NotFish,代码行数:15,代码来源:SoundManager.cs

示例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();
    }
开发者ID:Pucek9,项目名称:ProjectUnity,代码行数:14,代码来源:PauseManager.cs

示例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();
        }

	}
开发者ID:tangjie466,项目名称:Crazy_panda_noyoumi,代码行数:16,代码来源:audio_controller.cs

示例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;

	}
开发者ID:SamReha,项目名称:SnapshotGame,代码行数:22,代码来源:UIManager.cs

示例15: PauseSound

 public void PauseSound(AudioSource sound)
 {
     sound.Pause();
 }
开发者ID:FlorinVasileNechita,项目名称:PlantsVsZombies_unity,代码行数:4,代码来源:AudioManager.cs


注:本文中的UnityEngine.AudioSource.Pause方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。