示例#1
0
        /// <summary>
        /// Creates and returns a Tween for all components contained inside the UniTweenTarget.
        /// The Tween is configured based on the attribute values of this TweenData file.
        /// </summary>
        /// <param name="uniTweenTarget">Wrapper that contains a List of the component that this TweenData can tween.</param>
        /// <returns></returns>
        public override Tween GetTween(UniTweenObject.UniTweenTarget uniTweenTarget)
        {
            List <RectTransform> rects  = (List <RectTransform>)GetComponent(uniTweenTarget);
            Sequence             tweens = DOTween.Sequence();

            if (customEase)
            {
                foreach (var t in rects)
                {
                    if (t != null)
                    {
                        tweens.Join(GetTween(t).SetEase(curve));
                    }
                }
            }
            else
            {
                foreach (var t in rects)
                {
                    if (t != null)
                    {
                        tweens.Join(GetTween(t).SetEase(ease));
                    }
                }
            }
            return(tweens);
        }
        /// <summary>
        /// Creates and returns a Tween for all components contained inside the UniTweenTarget.
        /// The Tween is configured based on the attribute values of this TweenData file.
        /// </summary>
        /// <param name="uniTweenTarget">Wrapper that contains a List of the component that this TweenData can tween.</param>
        /// <returns></returns>
        public override Tween GetTween(UniTweenObject.UniTweenTarget uniTweenTarget)
        {
            List <PostProcessVolume> volumes = (List <PostProcessVolume>)GetComponent(uniTweenTarget);
            Sequence tweens = DOTween.Sequence();

            if (customEase)
            {
                foreach (var t in volumes)
                {
                    if (t != null)
                    {
                        tweens.Join(GetTween(t).SetEase(curve));
                    }
                }
            }
            else
            {
                foreach (var t in volumes)
                {
                    if (t != null)
                    {
                        tweens.Join(GetTween(t).SetEase(ease));
                    }
                }
            }
            return(tweens);
        }
示例#3
0
 /// <summary>
 /// Gets the List of components contained inside the UniTweenTarget
 /// </summary>
 /// <param name="uniTweenTarget">Wrapper that contains a List of the component that this TweenData can tween.</param>
 /// <returns></returns>
 public object GetComponent(UniTweenObject.UniTweenTarget uniTweenTarget)
 {
     return(uniTweenTarget.GetType().GetField("components").GetValue(uniTweenTarget));
 }
示例#4
0
 /// <summary>
 /// This method should be overriden to return the Tween the TweenData
 /// is configured to perform.
 /// </summary>
 /// <param name="uniTweenTarget">Wrapper that contains a List of the component that this TweenData can tween.</param>
 /// <returns></returns>
 public virtual Tween GetTween(UniTweenObject.UniTweenTarget uniTweenTarget)
 {
     return(null);
 }