Esempio n. 1
0
        //release effect with a new client transform.
        //note: if the xffect is not auto-deactive, you should remember to manually deactive it.
        public XffectComponent ReleaseEffect(string name, Transform client)
        {
            XffectComponent xft = GetEffect(name);

            if (xft == null)
            {
                Debug.LogWarning("can't find available effect in cache!:" + name);
                return(null);
            }
            xft.Active();
            xft.SetClient(client);
            return(xft);
        }
Esempio n. 2
0
        //release effect by world position. in this case, the client transform's position should be zero.
        //notice: if the xffect is not auto-deactive, you should remember to manually deactive it.
        //** automaticaly set client to EffectCache, so you should make sure EffectCache's position is always zero.
        public XffectComponent ReleaseEffect(string name, Vector3 pos)
        {
            XffectComponent xft = GetEffect(name);

            if (xft == null)
            {
                Debug.LogWarning("can't find available effect in cache!:" + name);
                return(null);
            }
            xft.Active();
            xft.SetClient(transform);
            xft.SetEmitPosition(pos);
            return(xft);
        }