粒子播放一次后销毁:
        //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. web安全开发指南--权限管理

    2.1               访问控制安全规则 1 访问控制必须只能在服务器端执行. 2 只通过session来判定用户的真实身份,避免使用其它数据域的参数(比如来自cookie.hidden域 ...

  2. jquer总结

    前端jq总结 选择器********************************************************************** 1,基本选择 器 #id .clss ...

  3. java自带的jvm分析工具

    http://domark.iteye.com/blog/1924302   这段时间觉得很有必要对java的内存分析工具进行熟悉,这样以后出现机器负载较高,或者反应很慢的时候,我就可以查找原因了.上 ...

  4. svn: None of the environment variables SVN_EDITOR...问题解决

    转:http://blog.163.com/lgh_2002/blog/static/44017526201046111856208/ 问题1: svn: Could not use external ...

  5. 【转】Python IDE for Eclipse

    原文地址 PyDev is a plugin that enables Eclipse to be used as a Python IDE (supporting also Jython and I ...

  6. CSS -- 绝对相对定位

    relative相对于自己原来的位置进行相对定位absolute相对于最近的父级元素进行定位fixed始终相对于浏览器窗口进行对位 顺便说一下,fixed就是特殊的absolute.

  7. iOS -- DES算法

    算法步骤: DES算法把64位的明文输入块变为64位的密文输出块,它所使用的密钥也是64位(实际用到了56位,第8.16.24.32.40.48.56.64位是校验位, 使得每个密钥都有奇数个1),其 ...

  8. static_cast ,reinterpret_cast

    用法:static_cast < type-id > ( expression ) 该运算符把expression转换为type-id类型,但没有运行时类型检查来保证转换的安全性.它主要有 ...

  9. Android常用传感器用法一览(2)

    在Android2.3 gingerbread系统中,google提供了11种传感器供应用层使用. #define SENSOR_TYPE_ACCELEROMETER       1 //加速度#de ...

  10. Spring Boot环境下自定义shiro过滤器会过滤所有的url的问题

    在配置shiro过滤器时增加了自定义的过滤器,主要是用来处理未登录状态下返回一些信息 //自定义过滤器 Map<String, Filter> filtersMap = new Linke ...