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


C# AudioSource.SetSpatializerFloat方法代码示例

本文整理汇总了C#中UnityEngine.AudioSource.SetSpatializerFloat方法的典型用法代码示例。如果您正苦于以下问题:C# AudioSource.SetSpatializerFloat方法的具体用法?C# AudioSource.SetSpatializerFloat怎么用?C# AudioSource.SetSpatializerFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.AudioSource的用法示例。


在下文中一共展示了AudioSource.SetSpatializerFloat方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetParameter

 /// <summary>
 /// Sets a Spatial Sound parameter on an AudioSource.
 /// </summary>
 /// <param name="audioSource">The AudioSource on which the specified parameter will be set.</param>
 /// <param name="param">The Spatial Sound parameter to set.</param>
 /// <param name="value">The value to set for the Spatial Sound parameter.</param>
 private static void SetParameter(AudioSource audioSource, SpatialSoundParameters param, float value)
 {
     audioSource.SetSpatializerFloat((int)param, value);
 }
开发者ID:CameronVetter,项目名称:HoloToolkit-Unity,代码行数:10,代码来源:SpatialSoundSettings.cs

示例2: SetParameters

	/// <summary>
	/// Sets the parameters.
	/// </summary>
	/// <param name="source">Source.</param>
	public void SetParameters(ref AudioSource source)
	{
#if ENABLE_SPATIALIZER_API 

        // See if we should enable spatialization
        source.spatialize = enableSpatialization;
		
        source.SetSpatializerFloat(0, gain);
		// All inputs are floats; convert bool to 0.0 and 1.0
		if(useInvSqr == true)
			source.SetSpatializerFloat(1, 1.0f);
		else
			source.SetSpatializerFloat(1, 0.0f);

		source.SetSpatializerFloat(2, near);
		source.SetSpatializerFloat(3, far);

		if(enableRfl == true)
			source.SetSpatializerFloat(4, 0.0f);
		else
			source.SetSpatializerFloat(4, 1.0f);
		
#endif
	}
开发者ID:emomper23,项目名称:PsychVR,代码行数:28,代码来源:ONSPAudioSource.cs

示例3: SetParameters

	/// <summary>
	/// Sets the parameters.
	/// </summary>
	/// <param name="source">Source.</param>
	public void SetParameters(ref AudioSource source)
	{
#if ENABLE_SPATIALIZER_API 

        // Check to see if we should disable spatializion
        if ((Application.isPlaying == false) || 
            (AudioListener.pause == true) || 
            (source.isPlaying == false) ||
            (source.isActiveAndEnabled == false)
           )
        {
            source.spatialize = false;
            return;
        }
        else
        {
            source.spatialize = enableSpatialization;
        }

		source.SetSpatializerFloat(0, gain);
		// All inputs are floats; convert bool to 0.0 and 1.0
		if(useInvSqr == true)
			source.SetSpatializerFloat(1, 1.0f);
		else
			source.SetSpatializerFloat(1, 0.0f);

		source.SetSpatializerFloat(2, near);
		source.SetSpatializerFloat(3, far);

		if(disableRfl == true)
			source.SetSpatializerFloat(4, 1.0f);
		else
			source.SetSpatializerFloat(4, 0.0f);
		
#endif
	}
开发者ID:catarak,项目名称:neural-network-vr,代码行数:40,代码来源:ONSPAudioSource.cs

示例4: SetParameters

	/// <summary>
	/// Sets the parameters.
	/// </summary>
	/// <param name="source">Source.</param>
	void SetParameters(ref AudioSource source)
	{
#if ENABLE_SPATIALIZER_API 

		if(dirtyParams == true)
		{
  	    	source.spatialize = enableSpatialization;
 
			source.SetSpatializerFloat(0, gain);
			// All inputs are floats; convert bool to 0.0 and 1.0
			if(useInvSqr == true)
				source.SetSpatializerFloat(1, 1.0f);
			else
				source.SetSpatializerFloat(1, 0.0f);

			source.SetSpatializerFloat(2, near);
			source.SetSpatializerFloat(3, far);

			if(disableRfl == true)
				source.SetSpatializerFloat(4, 1.0f);
			else
				source.SetSpatializerFloat(4, 0.0f);
		
			dirtyParams = false;
		}
#endif
	}
开发者ID:natewinck,项目名称:LightsOut,代码行数:31,代码来源:ONSPAudioSource.cs

示例5: ShutdownChannelSet

 // Shuts down given channel set of the soundfield.
 private void ShutdownChannelSet(AudioSource source, int channelSet) {
   source.SetSpatializerFloat((int) GvrAudio.SpatializerData.Id, -1.0f);
   // Ensure that the output is zeroed after shutdown.
   source.SetSpatializerFloat((int) GvrAudio.SpatializerData.ZeroOutput, 1.0f);
   source.spatialize = false;
 }
开发者ID:MaTriXy,项目名称:cardboard-unity,代码行数:7,代码来源:GvrAudioSoundfield.cs

示例6: InitializeChannelSet

 // Initializes given channel set of the soundfield.
 private void InitializeChannelSet(AudioSource source, int channelSet) {
   source.spatialize = true;
   source.SetSpatializerFloat((int) GvrAudio.SpatializerData.Type,
                              (float) GvrAudio.SpatializerType.Soundfield);
   source.SetSpatializerFloat((int) GvrAudio.SpatializerData.NumChannels,
                              (float) GvrAudio.numFoaChannels);
   source.SetSpatializerFloat((int) GvrAudio.SpatializerData.ChannelSet, (float) channelSet);
   source.SetSpatializerFloat((int) GvrAudio.SpatializerData.Gain,
                              GvrAudio.ConvertAmplitudeFromDb(gainDb));
   source.SetSpatializerFloat((int) GvrAudio.SpatializerData.ZeroOutput, 0.0f);
   // Soundfield id must be set after all the spatializer parameters, to ensure that the soundfield
   // is properly initialized before processing.
   source.SetSpatializerFloat((int) GvrAudio.SpatializerData.Id, (float) id);
 }
开发者ID:MaTriXy,项目名称:cardboard-unity,代码行数:15,代码来源:GvrAudioSoundfield.cs

示例7: ShutdownChannelSet

 // Shuts down given channel set of the soundfield.
 private void ShutdownChannelSet(AudioSource source, int channelSet)
 {
     source.SetSpatializerFloat(0, -1.0f);
     source.spatialize = false;
 }
开发者ID:CaitieGlover,项目名称:SyperVR,代码行数:6,代码来源:GvrAudioSoundfield.cs

示例8: InitializeChannelSet

 // Initializes given channel set of the soundfield.
 private void InitializeChannelSet(AudioSource source, int channelSet)
 {
     source.spatialize = true;
     source.SetSpatializerFloat(0, (float)id);
     source.SetSpatializerFloat(1, (float)GvrAudio.SpatializerType.Soundfield);
     source.SetSpatializerFloat(2, (float)GvrAudio.numFoaChannels);
     source.SetSpatializerFloat(3, (float)channelSet);
 }
开发者ID:CaitieGlover,项目名称:SyperVR,代码行数:9,代码来源:GvrAudioSoundfield.cs


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