Unity3D圣典3.3版本-中文版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
AudioSource.spread 扩散
# [AudioSource](AudioSource.html).spread 扩散 var *spread* : float *Description* 描述 Sets the spread angle a 3d stereo or multichannel sound in speaker space. 设置 3d stereo 的扩散角或扬声器空间的多声道声音。 0 = all sound channels are located at the same speaker location and is 'mono'. 360 = all subchannels are located at the opposite speaker location to the speaker location that it should be according to 3D position. Default = 0. 0=所有声音通道位于相同的扬声器位置并且是单声道。360=所有子通道位于对面扬声器的位置到扬声器位置,这应该根据 3D 位置。默认为 0。 * [C#](#) * [JavaScript](#) ``` using UnityEngine; using System.Collections; public class example : MonoBehaviour { void OnTriggerEnter(Collider other) { if (other.audio) other.audio.spread = 0; } void OnTriggerExit(Collider other) { if (other.audio) other.audio.spread = 360; } } ``` ``` // when any AudioSource goes trough this transform, it will set it as 'mono' // and will restore the value to 3D effect after exiting // Make sure the audio source has a collider. //当任意AudioSource通过这个变换,将设置它为单通道,并且退出后恢复值到3D效果 //确定音频源有一个碰撞器 function OnTriggerEnter(other : Collider) { if(other.audio) other.audio.spread = 0; } function OnTriggerExit(other : Collider) { if(other.audio) other.audio.spread = 360; } ```
da
2022年5月14日 23:22
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码