private NewEffectBuilder UI(NewImageEffect.ImageType target)
 {
     imageEffect        = new NewImageEffect();
     imageEffect.state  = new SpriteState();
     imageEffect.target = target;
     return(this);
 }
 private NewEffectBuilder UI(int depth)
 {
     imageEffect        = new NewImageEffect();
     imageEffect.state  = new SpriteState();
     imageEffect.target = NewImageEffect.ImageType.Sprite;
     imageEffect.depth  = depth;
     return(this);
 }
        public static NewImageEffect PreTransAll()
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(NewImageEffect.ImageType.All)
                                       .Operate(NewImageEffect.OperateMode.PreTrans)
                                       .Get();

            return(e);
        }
        public static NewImageEffect PreTransByDepth(int depth)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(depth)
                                       .Operate(NewImageEffect.OperateMode.PreTrans)
                                       .Get();

            return(e);
        }
        public static NewImageEffect TransByDepth(int depth, float time)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(depth)
                                       .TotalTime(time)
                                       .Operate(NewImageEffect.OperateMode.Trans)
                                       .Get();

            return(e);
        }
        public static NewImageEffect TransAll(float time)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(NewImageEffect.ImageType.All)
                                       .TotalTime(time)
                                       .Operate(NewImageEffect.OperateMode.TransAll)
                                       .Get();

            return(e);
        }
        public static NewImageEffect SetPostionByDepth(int depth, Vector3 position)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(depth)
                                       .Operate(NewImageEffect.OperateMode.SetPos)
                                       .FinalPosition(position)
                                       .Get();

            return(e);
        }
        public static NewImageEffect OldPhoto()
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(-1)
                                       .Operate(NewImageEffect.OperateMode.Effect)
                                       .Effect(NewImageEffect.EffectMode.OldPhoto)
                                       .Get();

            return(e);
        }
        public static NewImageEffect RemoveSpriteByDepth(int depth, bool delete)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(depth)
                                       .Operate(NewImageEffect.OperateMode.Remove)
                                       .Delete(delete)
                                       .Get();

            return(e);
        }
        public static NewImageEffect UnlockGallery(string filename)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(NewImageEffect.ImageType.All)
                                       .Source(filename)
                                       .Operate(NewImageEffect.OperateMode.Gallery)
                                       .Get();

            return(e);
        }
        public static NewImageEffect SetAlphaByDepth(int depth, float alpha)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(depth)
                                       .Operate(NewImageEffect.OperateMode.SetAlpha)
                                       .FinalAlpha(alpha)
                                       .Get();

            return(e);
        }
        public static NewImageEffect SetRotateByDepth(int depth, Vector3 angle)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(depth)
                                       .Operate(NewImageEffect.OperateMode.SetRotate)
                                       .Rotate(angle)
                                       .Get();

            return(e);
        }
        public static NewImageEffect SetDefaultPostionByDepth(int depth, string pstr)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(depth)
                                       .Operate(NewImageEffect.OperateMode.SetPos)
                                       .FinalPosition(pstr)
                                       .Get();

            return(e);
        }
        public static NewImageEffect PreTransByDepth(int depth, string sprite, string postision)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(depth)
                                       .Source(sprite)
                                       .Operate(NewImageEffect.OperateMode.PreTrans)
                                       .FinalPosition(postision)
                                       .Get();

            return(e);
        }
        public static NewImageEffect ChangeLive2dExpression(int depth, int expre)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(depth)
                                       .Frequency(expre)
                                       .Operate(NewImageEffect.OperateMode.Live2d)
                                       .Live2d(NewImageEffect.Live2dMode.ChangeExpression)
                                       .Get();

            return(e);
        }
        //public static NewImageEffect ChangeByDepth(int depth, string sprite)
        //{
        //    return SetSpriteByDepth(depth, sprite);
        //}
        #endregion

        public static NewImageEffect SetLive2dSpriteByDepth(int depth, string modelName)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(depth)
                                       .Source(modelName)
                                       .Operate(NewImageEffect.OperateMode.Live2d)
                                       .Live2d(NewImageEffect.Live2dMode.SetLive2D)
                                       .Get();

            return(e);
        }
        public static NewImageEffect Masking(string mask)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(-1)
                                       .Operate(NewImageEffect.OperateMode.Effect)
                                       .Effect(NewImageEffect.EffectMode.Mask)
                                       .Mask(mask)
                                       .Get();

            return(e);
        }
示例#18
0
 public void Move(NewImageEffect effect)
 {
     origin = transform.localPosition;
     final  = effect.state.GetPosition();
     if (!string.IsNullOrEmpty(effect.defaultpos))
     {
         final = SetDefaultPos(gameObject, effect.defaultpos);
     }
     curT = 0;
     allT = effect.time;
 }
        /// <summary>
        /// 精灵设定块
        /// </summary>
        /// <param name="depth">编号</param>
        /// <param name="fname">文件名</param>
        /// <param name="cg">是否是CG</param>
        public static NewImageEffect SetSpriteByDepth(int depth, string fname, bool cg = false)
        {
            //Path: 0 背景 1立绘 -1CG</param>
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(depth)
                                       .Path(cg? -1 : depth < 0 ? 0 : 1)
                                       .Source(fname)
                                       .Operate(NewImageEffect.OperateMode.Set)
                                       .Get();

            return(e);
        }
        /// <summary>
        ///  动态精灵设定块
        /// </summary>
        /// <param name="depth">编号</param>
        /// <param name="fname">文件名</param>
        /// <param name="isLoop">是否循环</param>
        public static NewImageEffect SetMovieSprite(int depth, string fname, bool isLoop = false)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(depth)
                                       .Source(fname)
                                       .Operate(NewImageEffect.OperateMode.Set)
                                       .Movie(true)
                                       .Loop(isLoop)
                                       .Get();

            return(e);
        }
        public static NewImageEffect MoveDefaultByDepth(int depth, string pstr, float time)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(depth)
                                       .TotalTime(time)
                                       .Operate(NewImageEffect.OperateMode.Action)
                                       .Action(NewImageEffect.ActionMode.Move)
                                       .FinalPosition(pstr)
                                       .Get();

            return(e);
        }
        public static NewImageEffect RotateToByDepth(int depth, Vector3 angle, float time)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(depth)
                                       .TotalTime(time)
                                       .Operate(NewImageEffect.OperateMode.Action)
                                       .Action(NewImageEffect.ActionMode.Rotate)
                                       .Rotate(angle)
                                       .Get();

            return(e);
        }
        public static NewImageEffect FadeToByDepth(int depth, float alpha, float time)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(depth)
                                       .TotalTime(time)
                                       .Operate(NewImageEffect.OperateMode.Action)
                                       .Action(NewImageEffect.ActionMode.Fade)
                                       .FinalAlpha(alpha)
                                       .Get();

            return(e);
        }
        public static NewImageEffect Circle(string sprite, bool inverse, float time)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(-1)
                                       .Source(sprite)
                                       .TotalTime(time)
                                       .Direction(inverse)
                                       .Operate(NewImageEffect.OperateMode.Trans)
                                       .Trans(NewImageEffect.TransMode.Circle)
                                       .Get();

            return(e);
        }
        public static NewImageEffect WindowShake(float v, int freq, float time)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(NewImageEffect.ImageType.All)
                                       .TotalTime(time)
                                       .Operate(NewImageEffect.OperateMode.Action)
                                       .Action(NewImageEffect.ActionMode.WinShake)
                                       .Variation(v)
                                       .Frequency(freq)
                                       .Get();

            return(e);
        }
        public static NewImageEffect SpriteShakeByDepth(int depth, float v, int freq, float time)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(depth)
                                       .TotalTime(time)
                                       .Operate(NewImageEffect.OperateMode.Action)
                                       .Action(NewImageEffect.ActionMode.Shake)
                                       .Variation(v)
                                       .Frequency(freq)
                                       .Get();

            return(e);
        }
        public static NewImageEffect MoveByDepth(int depth, Vector3 final, float time, bool sync)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(depth)
                                       .TotalTime(time)
                                       .Sync(sync)
                                       .Operate(NewImageEffect.OperateMode.Action)
                                       .Action(NewImageEffect.ActionMode.Move)
                                       .FinalPosition(final)
                                       .Get();

            return(e);
        }
        public static NewImageEffect Universial(string sprite, string rule, float time)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(-1)
                                       .Source(sprite)
                                       .TotalTime(time)
                                       .Operate(NewImageEffect.OperateMode.Trans)
                                       .Trans(NewImageEffect.TransMode.Universial)
                                       .Mask(rule)
                                       .Get();

            return(e);
        }
        public static NewImageEffect Shutter(string sprite, string direction, float time)
        {
            NewEffectBuilder builder = new NewEffectBuilder();
            NewImageEffect   e       = builder.UI(-1)
                                       .Source(sprite)
                                       .TotalTime(time)
                                       .Operate(NewImageEffect.OperateMode.Trans)
                                       .Trans(NewImageEffect.TransMode.Shutter)
                                       .Direction(direction)
                                       .Get();

            return(e);
        }