Пример #1
0
        public XFx CreateUIFx(string location, Transform parent, Vector3 scale)
        {
            XFx xFx   = this.CreateFx(location, true);
            int layer = LayerMask.NameToLayer("UI");

            xFx.Fx.layer = layer;
            if (xFx.FxAnimation != null)
            {
                xFx.FxAnimation.gameObject.layer = layer;
            }
            if (xFx.FxAnimator != null)
            {
                xFx.FxAnimator.gameObject.layer = layer;
            }
            if (xFx.Particles != null)
            {
                for (int i = 0; i < xFx.Particles.Count; i++)
                {
                    xFx.Particles[i].gameObject.layer = layer;
                }
            }
            if (xFx.Projectors != null)
            {
                for (int j = 0; j < xFx.Projectors.Count; j++)
                {
                    xFx.Projectors[j].gameObject.layer = layer;
                }
            }
            xFx.Play(parent, 1f, scale, Vector3.zero, true, false);
            return(xFx);
        }
Пример #2
0
        public XFx CreateAndPlay(string location, Transform parent, float speed_ratio, Vector3 scale, Vector3 offset, bool follow, float duration, bool import = false)
        {
            XFx xFx = this.CreateFx(location, import);

            xFx.Play(parent, speed_ratio, scale, offset, follow, false);
            xFx.DelayDestroy = duration;
            XSingleton <XFxMgr> .singleton.DestroyFx(xFx, false);

            return(xFx);
        }