粒子播放一次后销毁:
        //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. Unity中Invoke 和 InvokeRepeating的区别

    Invoke() 方法是 Unity3D 的一种委托机制 如: Invoke("Test", 5);   它的意思是:5 秒之后调用 Test() 方法: 使用 Invoke() ...

  2. centos6.5编译安装nginx

    系统64位 centos6.5 nginx官网:http://nginx.org/ 下载nginx源码包: wget  http://nginx.org/download/nginx-1.6.2.ta ...

  3. #iOS问题记录# UITextview富文本链接,禁止长按事件

    UITextView的富文本组装,添加图片点击事件,启动 - (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *) ...

  4. shell-网上lnmp一键安装讲解

    shell-网上lnmp一键安装讲解 #!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/b ...

  5. 修改activeMQ端口号

    原文:http://jingyan.baidu.com/article/3ea51489fba6a152e61bbacc.html 修改TCP 61616端口 打开您的mq安装目录 请看下图 如下图所 ...

  6. [Android实例] Android 6.0RecyclerView SwipeRefreshLayout 下拉刷新 上拉加载

    这是Android 6.0的 SwipeRefreshLayout 实现下拉刷新和RecyclerView的上拉加载更多,以及添加分割线等 Android <ignore_js_op> r ...

  7. Python数据结构与算法(几种排序)

    数据结构与算法(Python) 冒泡排序 冒泡排序(英语:Bubble Sort)是一种简单的排序算法.它重复地遍历要排序的数列,一次比较两个元素,如果他们的顺序错误就把他们交换过来.遍历数列的工作是 ...

  8. 转: ios的关于autolayout的设计与实现

    http://www.taijicoder.com/2015/12/12/iOS-Layout-and-Masnory/

  9. 在 TDA 工具里看到 Java Thread State 的第一反应是

    转载:http://itindex.net/detail/43158-tda-%E5%B7%A5%E5%85%B7-java   使用 TDA 工具,看到大量 Java Thread State 的第 ...

  10. JList的基本操作

    1.初始化并添加元素DefaultListModel leftListModel=new DefaultListModel();String[] items = Model.getPairs();fo ...