粒子播放一次后销毁:
        //ref: http://answers.unity3d.com/questions/219609/auto-destroying-particle-system.html
        //ref: http://answers.unity3d.com/questions/41855/cannot-implicitly-convert-type-unityengineobject-t.html
        particle.GetComponent<ParticleSystem> ().Stop ();
        particle.GetComponent<ParticleSystem> ().Play ();
        float particleDurTime = particle.GetComponent<ParticleSystem> ().duration + particle.GetComponent<ParticleSystem> ().startLifetime;
        Destroy (particle, particleDurTime);

unity, particle play once and destroy的更多相关文章

  1. Unity Particle System Sorting Order

    http://answers.unity3d.com/questions/577288/particle-system-rendering-behind-sprites.html

  2. unity, particle system Emit from Edge

  3. BEST FREE UNITY ASSETS – OVER 200 CURATED QUALITY ASSETS

    http://www.procedural-worlds.com/blog/best-free-unity-assets-categorised-mega-list/ BEST FREE UNITY ...

  4. unity, destroy gameObject & destroy all children

    一,destroy gameObject 删除名为xxx的gameObject 错误方法1: Destroy(xxx); 以上方法之所以错误,是因为Destroy在下一帧才生效,而在本帧之内xxx还存 ...

  5. UNITY Destroy()和DestroyImadiate()都不会立即释放对象内存

    如题,destroyimadiate是立即将物体从场景hierachy中移除,并标记为 "null",注意 是带引号的null.这是UNITY内部的一个处理技巧.关于这个技巧有很争 ...

  6. UNITY Destroy()和DestroyImadiate()的区别

    using System.Collections; using System.Collections.Generic; using System.Timers; using UnityEngine; ...

  7. unity, Destroy注意事项

    Destroy不是立即发生作用,而是推迟到帧末,所以下面代码是错误的: void OnTriggerEnter(Collider other){   if (other.gameObject.tag  ...

  8. Unity 游戏对象消失 enable,destroy与active的区别

    gameObject.SetActive(false):是否在场景中停用该物体,停用后Hierarchy窗口呈灰色,用Find函数也找不到.如果该物体有子物体,要用SetActive Recursir ...

  9. Unity Destroy和DestroyImmediate

    Destroy(Object obj, float t = 0.0F); 删除一个游戏对象,组件或者资源. 物体obj现在被销毁或在指定了t时间过后销毁.如果obj是组件,它将从GameObject销 ...

随机推荐

  1. Codeforces Round #345 (Div. 2) D. Image Preview 暴力 二分

    D. Image Preview 题目连接: http://www.codeforces.com/contest/651/problem/D Description Vasya's telephone ...

  2. LOG收集系统(一):原日志至收集

    Date: 20140207Auth: Jin 设置一个LOG收集系统1. 收集原生(不解析,不压缩)的业务日志和WEB日志(NGINX,PHP)2. 提供给开发,测试直接阅读和下载 需求分析原生日志 ...

  3. Linux下使用cut切割有规则的列文本

    data.txt NO Name Mark Percent 1 Sarath 45 90 2 Alex 49 98 3 Anu 45 90 分隔符(定界符)为Tab 制表符 如果我要取得第二列,所有人 ...

  4. centos安装lnmp

    安装ssh yum install openssh-server ====================== 查看SSH是否安装. ◆输入命令:rpm -qa | grep ssh 注:若没安装SS ...

  5. 【LaTeX】E喵的LaTeX新手入门教程(2)基础排版

    换了块硬盘折腾了好久..联想的驱动真坑爹.前情回顾[LaTeX]E喵的LaTeX新手入门教程(1)准备篇文档框架嗯昨天我们已经编写了一个最基本的文档,其内容是这样的:\documentclass{ar ...

  6. Nios II uCLinux/Linux启动分析

    1. 说明 本文采用的Linux源码版本来自Altera公司FTP.不考虑zImage生成的Compress过程.因为zImage是内核binary文件经过gzip 压缩,并在头部添加解压缩代码实现的 ...

  7. 【转载】Instagram架构分析笔记

    原文地址:http://chengxu.org/p/401.html Instagram 架构分析笔记 全部 技术博客 Instagram团队上个月才迎来第 7 名员工,是的,7个人的团队.作为 iP ...

  8. Elastic修改副本数量

    分片的个数在创建之后是无法再增加和减少的,除非你另外建一个索引库,而副本是可以在运行的时候,动态增加和减少.因此,在创建索引库时,规划好分片(Shard)是非常重要的,而在插入大量数据时可以先将副本书 ...

  9. Android布局属性集合

    <!-- android:id  —— 为控件指定相应的ID android:text —— 指定控件当中显示的文字,需要注意的是,这里尽量使用strings.xml文件当中的字符串 andro ...

  10. Java中equals()、equalsIgnoreCase()和==的区别

    用久了C#,在Java中,判断一个字符串还是习惯性的用了==,但是总是不能按照正确的判断分支运行,后来才想起来Java中是有equals的,然后就有引出了equalsIgnoreCase.   这三种 ...