Exemple #1
0
    private void OnFxStop(CFxOne fxone)
    {
        if (_IsLoading)
        {
            _DeferedGotFx.Remove(fxone);
        }

        --_ActiveFxCount;

        if (_ActiveFxCount == 0)
        {
            DeactiveTime = Time.time;
        }

        // 将干净的RealFxGameObject缓存处理
        // 自身清理在CFxOne的OnStop
        var fx = fxone.GetFxGameObject();

        if (fx != null)
        {
            fx.transform.parent        = CachedFxsRoot;
            fx.transform.localPosition = Vector3.zero;
            _CachedFxs.Add(fx);
            fxone.SetFxGameObject(null);
        }

        // 清理FxOne,回收FxOne组件
        CFxCacheMan.Instance.RecycleFx(fxone);
    }