Exemplo n.º 1
0
        public Vector3 Update(float invert, float factor, Vector3 vect)
        {
            if (_updateXIndex == 1)
            {
                vect.x = AbstractUpdater.Calcurate(_sPos.x, _dPos.x, invert, factor);
            }
            else if (_updateXIndex == 2)
            {
                vect.x = AbstractUpdater.Calcurate(_controlX, _sPos.x, _dPos.x, invert, factor);
            }

            if (_updateYIndex == 1)
            {
                vect.y = AbstractUpdater.Calcurate(_sPos.y, _dPos.y, invert, factor);
            }
            else if (_updateYIndex == 2)
            {
                vect.y = AbstractUpdater.Calcurate(_controlY, _sPos.y, _dPos.y, invert, factor);
            }

            if (_updateZIndex == 1)
            {
                vect.z = AbstractUpdater.Calcurate(_sPos.z, _dPos.z, invert, factor);
            }
            else if (_updateZIndex == 2)
            {
                vect.z = AbstractUpdater.Calcurate(_controlZ, _sPos.z, _dPos.z, invert, factor);
            }
            return(vect);
        }
Exemplo n.º 2
0
        public void Update(float invert, float factor, RectTransform transform)
        {
            Vector2 offsetMin = transform.offsetMin;
            Vector2 offsetMax = transform.offsetMax;

            if (_updateLeftIndex == 1)
            {
                offsetMin.x = AbstractUpdater.Calcurate(_sRect.x, _dRect.x, invert, factor);
            }
            else if (_updateLeftIndex == 2)
            {
                offsetMin.x = AbstractUpdater.Calcurate(_controlLeft, _sRect.x, _dRect.x, invert, factor);
            }

            if (_updateBottom)
            {
                offsetMin.y = _sRect.height * invert + _dRect.height * factor;
            }

            if (_updateBottomIndex == 1)
            {
                offsetMin.y = AbstractUpdater.Calcurate(_sRect.height, _dRect.height, invert, factor);
            }
            else if (_updateBottomIndex == 2)
            {
                offsetMin.y = AbstractUpdater.Calcurate(_controlBottom, _sRect.height, _dRect.height, invert, factor);
            }

            if (_updateRightIndex == 1)
            {
                offsetMax.x = -AbstractUpdater.Calcurate(_sRect.width, _dRect.width, invert, factor);
            }
            else if (_updateRightIndex == 2)
            {
                offsetMax.x = -AbstractUpdater.Calcurate(_controlRight, _sRect.width, _dRect.width, invert, factor);
            }

            if (_updateTop)
            {
                offsetMax.y = -(_sRect.y * invert + _dRect.y * factor);
            }

            if (_updateTopIndex == 1)
            {
                offsetMax.y = -AbstractUpdater.Calcurate(_sRect.y, _dRect.y, invert, factor);
            }
            else if (_updateTopIndex == 2)
            {
                offsetMax.y = -AbstractUpdater.Calcurate(_controlTop, _sRect.y, _dRect.y, invert, factor);
            }

            transform.offsetMin = offsetMin;
            transform.offsetMax = offsetMax;
        }
Exemplo n.º 3
0
        public Color Update(float invert, float factor, Color color)
        {
            if (_updateRedIndex == 1)
            {
                color.r = AbstractUpdater.Calcurate(_sColor.r, _dColor.r, invert, factor);
            }
            else if (_updateRedIndex == 2)
            {
                color.r = AbstractUpdater.Calcurate(_controlRed, _sColor.r, _dColor.r, invert, factor);
            }

            if (_updateGreenIndex == 1)
            {
                color.g = AbstractUpdater.Calcurate(_sColor.g, _dColor.g, invert, factor);
            }
            else if (_updateGreenIndex == 2)
            {
                color.g = AbstractUpdater.Calcurate(_controlGreen, _sColor.g, _dColor.g, invert, factor);
            }

            if (_updateBlueIndex == 1)
            {
                color.b = AbstractUpdater.Calcurate(_sColor.b, _dColor.b, invert, factor);
            }
            else if (_updateBlueIndex == 2)
            {
                color.b = AbstractUpdater.Calcurate(_controlBlue, _sColor.b, _dColor.b, invert, factor);
            }

            if (_updateAlphaIndex == 1)
            {
                color.a = AbstractUpdater.Calcurate(_sColor.a, _dColor.a, invert, factor);
            }
            else if (_updateAlphaIndex == 2)
            {
                color.a = AbstractUpdater.Calcurate(_controlAlpha, _sColor.a, _dColor.a, invert, factor);
            }
            return(color);
        }
Exemplo n.º 4
0
        public Vector2 Update(float invert, float factor, Vector2 vect)
        {
            if (_updateXIndex == 1)
            {
                vect.x = AbstractUpdater.Calcurate(_sSize.x, _dSize.x, invert, factor);
            }
            else if (_updateXIndex == 2)
            {
                vect.x = AbstractUpdater.Calcurate(_controlX, _sSize.x, _dSize.x, invert, factor);
            }

            if (_updateYIndex == 1)
            {
                vect.y = AbstractUpdater.Calcurate(_sSize.y, _dSize.y, invert, factor);
            }
            else if (_updateYIndex == 2)
            {
                vect.y = AbstractUpdater.Calcurate(_controlY, _sSize.y, _dSize.y, invert, factor);
            }

            return(vect);
        }