Exemple #1
0
    public int PlayFXOfUI(int templateId, Transform host, int time = 0, int depthValue = 2001, Action finishCallback = null)
    {
        if (!SystemConfig.IsFXOn)
        {
            return(0);
        }
        if (templateId <= 0)
        {
            return(0);
        }
        if (host == null)
        {
            return(0);
        }
        Fx fx = DataReader <Fx> .Get(templateId);

        if (fx == null || string.IsNullOrEmpty(fx.path))
        {
            return(0);
        }
        int uid = ++this.m_fxOfcounter;

        this.m_fxs.set_Item(uid, null);
        AssetManager.LoadAssetWithPool(FXPool.GetPathWithLOD(fx.path, false), delegate(bool isSuccess)
        {
            if (this.m_fxs.ContainsKey(uid))
            {
                this.JustPlayfxOnUI(uid, templateId, host, time, depthValue, finishCallback);
            }
        });
        return(uid);
    }
Exemple #2
0
    public int PlayFXOfFollow(int templateId, Vector3 position, Transform targetFollow, float speed, float lessDistance, float offset = 0f, Action finishCallback = null, FXClassification fxClassification = FXClassification.Normal)
    {
        if (!SystemConfig.IsFXOn)
        {
            return(0);
        }
        if (templateId <= 0)
        {
            return(0);
        }
        Fx fx = DataReader <Fx> .Get(templateId);

        if (fx == null || string.IsNullOrEmpty(fx.path))
        {
            return(0);
        }
        int uid = ++this.m_fxOfcounter;

        this.m_fxs.set_Item(uid, null);
        AssetManager.LoadAssetWithPool(FXPool.GetPathWithLOD(fx.path, fxClassification == FXClassification.LowLod), delegate(bool isSuccess)
        {
            if (this.m_fxs.ContainsKey(uid))
            {
                this.JustPlayFXOfFollow(uid, templateId, position, targetFollow, speed, lessDistance, offset, finishCallback, fxClassification);
            }
        });
        return(uid);
    }
Exemple #3
0
    public ActorFX Get(int guid, bool isLow)
    {
        string text = this.pipeline.GetPath(guid);

        if (text == null)
        {
            return(null);
        }
        text = FXPool.GetPathWithLOD(text, isLow);
        GameObject gameObject = this.GetPool().Get(text);

        if (gameObject == null)
        {
            Debug.LogError(string.Format("马上联系左总,m_loader.Get拿到空值,路径是{0}", text));
            return(null);
        }
        return(base.SetGameObject(gameObject, guid));
    }
Exemple #4
0
    public void Preload(int templateId, Action callbackSuccess)
    {
        Fx fx = DataReader <Fx> .Get(templateId);

        if (fx == null || string.IsNullOrEmpty(fx.path))
        {
            if (callbackSuccess != null)
            {
                callbackSuccess.Invoke();
            }
            return;
        }
        AssetManager.LoadAssetWithPool(FXPool.GetPathWithLOD(fx.path, false), delegate(bool isSuccess)
        {
            if (callbackSuccess != null)
            {
                callbackSuccess.Invoke();
            }
        });
    }
Exemple #5
0
    private int AsyncPlayfxOnScene(int templateId, Transform host, Vector3 position, Quaternion rotation, float speed = 1f, float scale = 1f, int time = 0, bool syncNode = false, int bulletLife = 0, Action <Actor, XPoint, ActorParent> bulletCallback = null, Action finishCallback = null, Action <ActorFX> loadCallback = null, bool sound3D = true, float rate = 1f, FXClassification fxClassification = FXClassification.Normal)
    {
        if (!SystemConfig.IsFXOn)
        {
            return(0);
        }
        if (templateId == ClientGMManager.fxout_id)
        {
            return(0);
        }
        if (templateId <= 0)
        {
            return(0);
        }
        if (fxClassification == FXClassification.NoPlay)
        {
            return(0);
        }
        Fx fx = DataReader <Fx> .Get(templateId);

        if (fx == null || string.IsNullOrEmpty(fx.path))
        {
            return(0);
        }
        int uid = ++this.m_fxOfcounter;

        this.m_fxs.set_Item(uid, null);
        AssetManager.LoadAssetWithPool(FXPool.GetPathWithLOD(fx.path, fxClassification == FXClassification.LowLod), delegate(bool isSuccess)
        {
            if (this.m_fxs.ContainsKey(uid))
            {
                this.JustPlayfxOnScene(uid, templateId, host, position, rotation, speed, scale, time, syncNode, bulletLife, bulletCallback, finishCallback, loadCallback, sound3D, rate, fxClassification);
            }
        });
        return(uid);
    }