您的位置:首页 > 房产 > 家装 > 出纳工作内容_开源免费建站程序用的最多的_网站建设开发_seo的方式包括

出纳工作内容_开源免费建站程序用的最多的_网站建设开发_seo的方式包括

2025/5/9 16:19:03 来源:https://blog.csdn.net/weixin_50379372/article/details/145516631  浏览:    关键词:出纳工作内容_开源免费建站程序用的最多的_网站建设开发_seo的方式包括
出纳工作内容_开源免费建站程序用的最多的_网站建设开发_seo的方式包括

1.创建一个地面
在这里插入图片描述
2.去资源商店下载一个火焰素材

在这里插入图片描述
3.把procedural fire导入到自己的项目包管理器中

在这里插入图片描述
4.
4.给magic fire 0 挂在碰撞组件Rigidbody , Sphere Collider
在这里插入图片描述
5.创建脚本test 并挂在magic fire 0
在这里插入图片描述
脚本代码


using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class test : MonoBehaviour
{// 创建 一个爆炸的预设体public GameObject Prefab;// Start is called once before the first execution of Update after the MonoBehaviour is createdvoid Start(){}// Update is called once per framevoid Update(){}// 监听发生碰撞private void OnCollisionEnter(Collision collision){// 创建一个爆炸物体Instantiate(Prefab, transform.position, Quaternion.identity);// 销毁自身Destroy(gameObject);}// 持续碰撞中private void OnCollisionStay(Collision collision){}// 结束碰撞private void OnCollisionExit(Collision collision){}}

6.把explosion 加到test 脚本的预制件
在这里插入图片描述
7.创建碰撞销毁脚本BZ,并挂在到EXPLOSION
在这里插入图片描述


using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class bz : MonoBehaviour
{float timer = 0;// Start is called once before the first execution of Update after the MonoBehaviour is createdvoid Start(){}// Update is called once per framevoid Update(){timer += Time.deltaTime;if (timer > 1){Destroy(gameObject);}}
}

运行结果

untiy 3D碰撞监测

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com