示例#1
0
        protected virtual bool InitializeFromToValues(Vector2PairAsset fromToValues)
        {
            if (fromToValues == null)
            {
                Debug.LogError("Missing Input type Vector2PairAsset.", gameObject);
                return(false);
            }

            StartNewTween();
            startVector2 = fromToValues.A;
            endVector2   = fromToValues.B;
            return(true);
        }
示例#2
0
        public void AnimateRectTransformMaxAnchor(Vector2PairAsset fromToValues)
        {
            var initialized = StartAnimateRectTransformMaxAnchor(fromToValues);

            if (!initialized)
            {
                return;
            }

            var tween = LeanTween.value(gameObject, UpdateRectTransformMaxAnchor, startVector2, endVector2, animationSettings.Duration)
                        .setOnComplete(OnRectTransformMaxAnchorComplete);

            ApplyAdditionalSettings(tween);
            uniqueId = tween.uniqueId;
        }
示例#3
0
        public bool StartAnimateRectTransformMaxAnchor(Vector2PairAsset fromToValues)
        {
            var initialized = ValidateTargetRectTransform() && InitializeFromToValues(fromToValues);

            if (!initialized)
            {
                return(false);
            }

            if (animationSettings.Type == LTAnimationAsset.AnimationType.Relative)
            {
                startVector2 += targetRectTransform.anchorMax;
                endVector2   += targetRectTransform.anchorMax;
            }

            UpdateRectTransformMaxAnchor(startVector2);

            return(true);
        }
示例#4
0
        public bool StartAnimateRectTransformWidthAndHeight(Vector2PairAsset fromToValues)
        {
            var initialized = ValidateTargetRectTransform() && InitializeFromToValues(fromToValues);

            if (!initialized)
            {
                return(false);
            }

            if (animationSettings.Type == LTAnimationAsset.AnimationType.Relative)
            {
                startVector2.x += targetRectTransform.rect.width;
                startVector2.y += targetRectTransform.rect.height;

                endVector2.x += targetRectTransform.rect.width;
                endVector2.y += targetRectTransform.rect.height;
            }

            UpdateRectTransformWidthAndHeight(startVector2);

            return(true);
        }