Unity添加unity3d声音控制问题

【频道】unity3d
Unity3D Student 教程 初学者 9 材质
播放:2211
Unity3D Student 教程 初学者 8 施加力
播放:1815
Unity3D Student 教程 初学者 7 移动基础
播放:1826
Unity3D Student 教程 初学者 6 简单计时器
播放:1364
Unity3D Student 教程 初学者 5 实例化
播放:1342
Unity3D Student 教程 初学者 4 销毁指令
播放:1243
Unity3D Student 教程 初学者 3 预制件
播放:1485
Unity3D Student 教程 初学者 10 声音
播放:1639
Unity3D Student 教程 初学者 2 输入检测
播放:1958
Unity3D Student 教程 初学者 1 碰撞检测基础
播放:5368
Unity3D Student 教程 初学者 0 使用重力
播放:5973
分享给站外好友
页面地址:
FLASH地址:
HTML代码:
通用代码:
可以让视频在手机、平板电脑上播放!
举报此视频包含不当内容:
请填写你要举报的内容,标明举报内容所在地时段,将有助于我们更及时的处理举报内容。感谢您对PPS的支持!
广告和欺诈
触犯我的版权
你可以把视频下载到不同的设备
使用电脑飞速下载轻易收藏喜欢的视频
使用苹果设备支持iPhone、iPad高清视频亦可离线观看
使用Android设备支持手机、平板高清视频亦可离线观看
拍下二维码,视频随身看
用PPS影音IOS/Android版扫描二维码,在您的移动设备上继续观看视频,也可以分享给您的好友。
Unity3D Student 教程 初学者 10 声音
手机没装PPS影音?
频道信息:
播放:2.57万
对不起,该频道暂无简介!
注:数据来自爱奇艺、PPS全平台
Unity3D Student 教程 初学者 10 声音
上传时间:32个月前
上 传 者:鸿鹄激昂
所属频道:unity3d
上 传 自:
分&&&&&&类:原创
暂无相关内容
视频简介:Unity3D Student 教程 初学者 10 声音
现在可以用QQ账号直接发表评论,分享给我的好友
大家都在看
互联网药品信息服务许可证:
互联网医疗保健信息服务许可证:
Copyright&2005 - 2014 PPStream, Inc. All Rights Reservedunity-tweak-tool和系统设置中声音设置及audacious插件的问题 - 查看主题 & Ubuntu中文论坛
&[ 3 篇帖子 ]&
&文章标题 : unity-tweak-tool和系统设置中声音设置及audacious插件的问题发表于 :
2:40帖子: 5
送出感谢: 0 次
接收感谢: 0 次
神舟A560-i7-d1处理器:I7-720qm显卡:nvidiaGT335m声卡:应该是realtel ALC272(集成)系统:ununtu 13.04 64位1、unity-tweak-tool版本是0.0.4ubuntu0.1在里面设置鼠标移动到左下角显示工作区,右上角和右下角显示当前工作区的程序窗口、所有程序窗口。总是重启系统后失效(有时可以,大多时候无效),要重新打开unity-tweak-tool设置一次才行(之前设置的有保留,但不起作用)。装了CompizConfig 设置管理器,用它设置也一样的情况。2、系统设置中的声音那里“淡入淡出”和“重低音”是灰色(附图的下面),不能设置,不知道有不办法打开,还是说要电脑有单独的低间炮才能用。3、audacious的VU Meter插件怎么安装,去下载皮肤的时候看那里要多一个VU的窗口(附图的下面),在新立得里安装了audacious-analog-vumeter-plugin,结果找不到地方显示出来,是不是安装方式有什么要求,或者还要装什么。不知道是不是这几个问题太菜了,论坛和谷歌、百度什么的都查不到什么,在桌面特效区和影音多媒体区发了一次,也没结果。哪位知道怎么解决麻烦说一下,不胜感激。主要是unity-tweak-tool的那个问题,还是比较喜欢那个效果的,每次开机重新设置一次实在是太烦人了。附件:
文件注释: 系统设置的声音设置状态
a.png [ 47.72 KiB | 被浏览 9096 次 ]
文件注释: 声音设置里突然出现这个东西,不知道怎么搞出来的,能设置了,但没声音
c.png [ 54.86 KiB | 被浏览 8857 次 ]
文件注释: VU Meter插件窗口
b.png [ 219.04 KiB | 被浏览 9096 次 ]
呃,不能传.log文件,整个太长,截了一段出来: 15:45:33,713 - DEBUG
:: UnityTweakTool.elements.toolbutton - __init__ - Initialised a toolbutton with id tool_hotcorners in section 2 and page 4 15:45:33,713 - DEBUG
:: UnityTweakTool.elements.toolbutton - __init__ - Initialised a toolbutton with id tool_wm_additional in section 2 and page 5 15:45:33,713 - DEBUG
:: UnityTweakTool.elements.toolbutton - __init__ - Initialised a toolbutton with id tool_system in section 3 and page 0 15:45:33,713 - DEBUG
:: UnityTweakTool.elements.toolbutton - __init__ - Initialised a toolbutton with id tool_icons in section 3 and page 1 15:45:33,714 - DEBUG
:: UnityTweakTool.elements.toolbutton - __init__ - Initialised a toolbutton with id tool_cursors in section 3 and page 2 15:45:33,714 - DEBUG
:: UnityTweakTool.elements.toolbutton - __init__ - Initialised a toolbutton with id tool_fonts in section 3 and page 3 15:45:33,714 - DEBUG
:: UnityTweakTool.elements.toolbutton - __init__ - Initialised a toolbutton with id tool_window_controls in section 3 and page 4 15:45:33,714 - DEBUG
:: UnityTweakTool.elements.toolbutton - __init__ - Initialised a toolbutton with id tool_desktop_icons in section 4 and page 0 15:45:33,714 - DEBUG
:: UnityTweakTool.elements.toolbutton - __init__ - Initialised a toolbutton with id tool_desktop_security in section 4 and page 1 15:45:33,714 - DEBUG
:: UnityTweakTool.elements.toolbutton - __init__ - Initialised a toolbutton with id tool_desktop_scrolling in section 4 and page 2 15:45:33,714 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_launcher registered 15:45:33,714 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_dash registered 15:45:33,714 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_panel registered 15:45:33,714 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_unity_switcher registered 15:45:33,715 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_unity_webapps registered 15:45:33,715 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_additional registered 15:45:33,715 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_general registered 15:45:33,715 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_compiz_switcher registered 15:45:33,715 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_windows_spread registered 15:45:33,715 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_windows_snapping registered 15:45:33,715 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_hotcorners registered 15:45:33,715 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_wm_additional registered 15:45:33,715 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_system registered 15:45:33,715 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_icons registered 15:45:33,715 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_cursors registered 15:45:33,715 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_fonts registered 15:45:33,715 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_window_controls registered 15:45:33,715 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_desktop_icons registered 15:45:33,716 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_desktop_security registered 15:45:33,716 - DEBUG
:: UnityTweakTool.elements.toolbutton - register - Handler for tool_desktop_scrolling registered
16:22,总共编辑了 1 次
&文章标题 : Re: unity-tweak-tool和系统设置中声音设置及audacious插件的问题发表于 :
16:34帖子: 46
系统: win8/ubuntu 12.04LTS
就unity-tweak-tool的永久设置问题,要永久生效我觉得你可以终端下打:代码:dconf-editor进去找这个软件项目,里面应该有你想要的有关设置值,甚至可以自己创建
&文章标题 : Re: unity-tweak-tool和系统设置中声音设置及audacious插件的问题发表于 :
2:40帖子: 5
送出感谢: 0 次
接收感谢: 0 次
QXLIANG2013 写道:就unity-tweak-tool的永久设置问题,要永久生效我觉得你可以终端下打:代码:dconf-editor进去找这个软件项目,里面应该有你想要的有关设置值,甚至可以自己创建呃,那里看过,dconf-editor里面的unity-tweak-tool分支是空的,在.config文件夹的unity-tweak-tool里面只有pid.lockfile文件,内容是四位数字,好象会变,目前是3196,剩下的就是debug.log了(上传到顶楼了),英语不好,只能看出来好象是软件有问题,没装好或者说是装得有问题,unity分支倒是有相关选项,试了下卸掉unity-tweak-tool直接改unity分支下的没效果。
显示帖子 : 全部帖子1天7天2周1个月3个月6个月1年&排序 作者发表时间文章标题 升序降序&
&[ 3 篇帖子 ]&
正在浏览此版面的用户:没有注册用户 和 11 位游客
您 不能 在这个版面发表主题您 不能 在这个版面回复主题您 不能 在这个版面编辑帖子您 不能 在这个版面删除帖子您 不能 在这个版面提交附件
选择一个版面
------------------
公告/注意事项
& &新闻和通知
& &校园社团支持
& && &华东校区
& && &华南校区
& && &华北校区
& && &华中校区
& && &东北校区
& && &西北校区
& && &港澳台校区
& && &国外校区
& &软件推荐
& &非常任务
系统安装区
& &教学和常见问答
& && &课堂教学和培训
& &初学者园地 - 15.04
& &系统安装和升级
& && &新立得和软件源
& && &Wubi安装讨论
& &启动和引导
& &网卡问题以及网络和拨号
& && &校园网拨号
& &笔记本、UMPC支持
& &手机和平板
& && &Ubuntu移动应用开发
& &常用硬件支持
& &系统架构支持
配置美化区
& &字体美化和中文支持
& && &个人配置文件存放点
& &桌面特效
& &窗口管理器
& &屏幕抓图
& &办公、图像、机械电子设计等
& && &Vim和Emacs
& &因特网相关软件
& &影音多媒体
& &Wine及其分支
& &游戏和游戏模拟器
& &虚拟机和虚拟化
& &其它类软件
服务器管理
& &服务器基础应用
& &数据库管理
& &服务器维护和硬件相关
& &Ubuntu VPS
参与Ubuntu开发
& &软件和文档翻译
& &编译或打包
& &Ubuntu错误报告
程序设计区
& &Shell脚本
& &GTK+和QT
& &软件/网站开发
& && &Python/Php/Perl
& && &C/C++/Java
& &内核及嵌入式开发
& &开源小工具
& &Ubuntu 15.10
& &Ubuntu 14.10
& &Ubuntu 14.04 LTS
& &Ubuntu 12.04 LTS
& &Ubuntu 10.04 LTS
& &老旧版本支持
衍生发行版
& &Ubuntu GNOME
& &Kubuntu
& &Xubuntu & Lubuntu
& &Ubuntu中文衍生版
& && &Deepin
& && &UbuntuKylin
& &Ubuntu国外衍生版
& && &Mint
& &Ubuntu衍生版制作
& &其它类Unix OS发行版
& && &Arch发行版
& && &Debian发行版
& && &OpenSUSE发行版
& &深度PK版
& &Ubuntu故事和感慨
& &Full Circle开源杂志
分享交流区
& &同城交流
& &线下活动专版
& &Ubuntu宣传推广
& &论坛管理
& && && &Ubuntu中文网上商店声音与特效
本文所属图书&>&
本书以实例教学为主线,循序渐进地介绍了Unity在游戏开发方面的不同功能。第1章,由零开始,引导读者熟悉Unity编辑器的各个功能模块,这部分内容对Unity程序员、美工和策划都有帮助。第2~4章是3个不同特色的3D游&&
现在的游戏是无声的,我们将添加几个简单的音效,并增加一个爆炸效果。
在Project窗口单击右键,选择【Import Package】&【Custom Package】,然后到资源文件目录packages浏览Unity包文件,选择ShootingFX.unitypackage,将其打开,选择【Import】导入到当前工程中,如图2-32所示。在这个包中包含了几个音效文件和一个爆炸特效Prefab,它们都会被导入到Assets目录的FX文件夹下。
.unitypackage文件是Unity专用的资源包,在Project窗口选择资源,如脚本、模型、声音等任何资源,然后单击右键选择【Export Package】,可以将所选资源导出为.unitypackage格式的包,然后重用到其他Unity工程中。
选择主角飞船游戏体,在菜单栏选择【Component】&【Audio】&【Audio Source】为主角添加一个Audio Source,凡是需要发声的游戏体,必须有这个。
打开Player.cs 脚本,添加并修改代码如下:
& & & // 声音
& & public AudioClip m_shootC
& & // 声音源
& & protected AudioSource m_
& & // 爆炸特效
& & public Transform m_explosionFX;
// Use this for initialization
void Start () {
& & & & m_transform = this.
& & & & m_audio = this.
m_shootClip属性是射击的声音,在后面会将它和音效文件关联。
m_audio属性是声音源组件,用于播放声音,在Start函数中将其指向实际的声音源组件。
在Player脚本的Update函数中添加播放声音的代码:
& & & & if ( &Input.GetKey( KeyCode.Space ) || Input.GetMouseButton(0) &)
& & & & & & Instantiate( m_rocket, m_transform.position, m_transform.rotation );
&// 播放射击声音
& & & & & & m_audio.PlayOneShot(m_shootClip);
在Player脚本的OnTriggerEnter函数中添加创建爆炸特效的代码:
&if (m_life &= 0)&
& & & & & & // 爆炸特效
& & & & & & Instantiate(m_explosionFX, m_transform.position, Quaternion.identity);
& & & & & & Destroy(this.gameObject);
选择主角游戏体,在Project窗口的FX文件夹下分别找到shoot.WAV音效文件和Explosion.prefab爆炸特效文件,在Player组件中将其分别与m_shootClip和m_explosionFX属性关联,如图2-33所示。
选择爆炸特效的Prefab,为其添加一个Audio Source组件,然后在FX文件夹下找到explosion.WAV文件,将其指定到Audio Source的Audio Clip中,因为默认Play On Awake选项是处于选中状态,所以当爆炸特效被实例化后,会自动播放爆炸的声音,如图2-34所示。
运行游戏,可以听到射击声音,当主角死亡,会看到爆炸效果,并能听到爆炸声音,如图2-35所示。我们也需要为敌人添加同样的爆炸效果和声音,重复前面的步骤即可,这里就不再赘述。
您对本文章有什么意见或着疑问吗?请到您的关注和建议是我们前行的参考和动力&&
您的浏览器不支持嵌入式框架,或者当前配置为不显示嵌入式框架。

我要回帖

更多关于 unity3d声音添加 的文章

 

随机推荐