找回密码
 立即注册
楼主: 强子

[脚本] 炮弹发射代码 碰撞声音效果

[复制链接]
发表于 2013-3-7 13:23 | 显示全部楼层 |阅读模式
  1. var BulletPoint:Transform;
  2. var BulletXG:GameObject;
  3. var BulletSound:GameObject;
  4. function Update () {
  5.         
  6. }
  7. function OnCollisionEnter(collisionInfo : Collision) {
  8.            if(BulletXG&&BulletPoint)
  9.            {
  10.                         var Clone:GameObject=Instantiate(BulletXG,BulletPoint.transform.position,transform.rotation);
  11.                         var CloneSound:GameObject=Instantiate(BulletSound,BulletPoint.transform.position,transform.rotation);
  12.                          if(CloneSound)
  13.                          {
  14.                                 Destroy(CloneSound,2);
  15.                          }
  16.            }
  17.           Destroy(this.gameObject);
  18. }
复制代码
发表于 2014-4-26 10:32 | 显示全部楼层
好东西 好东西
发表于 2017-3-9 20:08 | 显示全部楼层
很不错
发表于 2017-3-9 20:02 | 显示全部楼层
楼主是超人
发表于 2017-3-9 20:15 | 显示全部楼层
顶顶多好
发表于 2017-3-9 19:41 | 显示全部楼层
真心顶
发表于 2017-3-9 20:01 | 显示全部楼层
很好哦
发表于 2017-6-6 18:57 | 显示全部楼层
很不错
发表于 2017-6-6 19:41 | 显示全部楼层
顶顶多好
发表于 2017-6-6 19:19 | 显示全部楼层
说的非常好
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Unity开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2024-4-30 08:23 , Processed in 0.072928 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表