Example #1
0
        /// <summary>
        /// tweens the RectTransforms sizeDelta property
        /// </summary>
        /// <returns>The sizeDelta to.</returns>
        /// <param name="self">Self.</param>
        /// <param name="to">To.</param>
        /// <param name="duration">Duration.</param>
        public static ITween <Vector2> SizeDeltaTo(this RectTransform self, Vector2 to, float duration = 0.3f)
        {
            var tweenTarget = new RectTransformSizeDeltaTarget(self);
            var tween       = Vector2Tween.Create();

            tween.Initialize(tweenTarget, to, duration);

            return(tween);
        }
Example #2
0
        /// <summary>
        /// tweens the ScrollRects normalizedPosition (scroll position)
        /// </summary>
        /// <returns>The knormalized position to.</returns>
        /// <param name="self">Self.</param>
        /// <param name="to">To.</param>
        /// <param name="duration">Duration.</param>
        public static ITween <Vector2> NormalizedPositionTo(this ScrollRect self, Vector2 to, float duration = 0.3f)
        {
            var tweenTarget = new ScrollRectNormalizedPositionTarget(self);
            var tween       = Vector2Tween.Create();

            tween.Initialize(tweenTarget, to, duration);

            return(tween);
        }
Example #3
0
        /// <summary>
        /// tweens the Materials texture scale
        /// </summary>
        /// <returns>The ktexture scale to.</returns>
        /// <param name="self">Self.</param>
        /// <param name="to">To.</param>
        /// <param name="duration">Duration.</param>
        /// <param name="propertyName">Property name.</param>
        public static ITween <Vector2> TextureScaleTo(this Material self, Vector2 to, float duration, string propertyName = "_MainTex")
        {
            var tweenTarget = new MaterialTextureScaleTarget(self, propertyName);
            var tween       = Vector2Tween.Create();

            tween.Initialize(tweenTarget, to, duration);

            return(tween);
        }