chenxin
2020-11-20 424feadd6adf57195da00db43caced2ede6884e9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System;
using System.Collections;
using UnityEngine;
 
/// <summary>
/// 回收粒子特效
/// </summary>
public class RecycleEffectc : MonoBehaviour
{
    public delegate void RecycleAC(RecycleEffectc fx);
    public RecycleAC myAC;
    public void StartPlay(float fxLifeTime, RecycleAC ac)
    {
        myAC = ac;
        StartCoroutine(Recycle(fxLifeTime));
    }
 
    IEnumerator Recycle(float fxLifeTime)
    {
        yield return new WaitForSeconds(fxLifeTime);
        if(myAC!=null){
            myAC(this);
        }
    }
}