Exemplo n.º 1
0
        public PotaTween SetRotation(TweenAxis axis, float from, float to, bool isLocal = false, bool isRelative = false)
        {
            if (Rotation.IgnoreAxis.None)
            {
                Rotation.IgnoreAxis = new PTTAxisMask(true, true, true);
            }

            switch (axis)
            {
            case TweenAxis.X:
                Rotation.IgnoreAxis.X = false;
                Rotation.From.x       = from;
                Rotation.To.x         = to;
                break;

            case TweenAxis.Y:
                Rotation.IgnoreAxis.Y = false;
                Rotation.From.y       = from;
                Rotation.To.y         = to;
                break;

            case TweenAxis.Z:
                Rotation.IgnoreAxis.Z = false;
                Rotation.From.z       = from;
                Rotation.To.z         = to;
                break;
            }

            Rotation.IsLocal    = isLocal;
            Rotation.IsRelative = isRelative;

            return(this);
        }
Exemplo n.º 2
0
        public PotaTween SetScale(TweenAxis axis, float from, float to, bool isRelative = false)
        {
            if (Scale.IgnoreAxis.None)
            {
                Scale.IgnoreAxis = new PTTAxisMask(true, true, true);
            }

            switch (axis)
            {
            case TweenAxis.X:
                Scale.IgnoreAxis.X = false;
                Scale.From.x       = from;
                Scale.To.x         = to;
                break;

            case TweenAxis.Y:
                Scale.IgnoreAxis.Y = false;
                Scale.From.y       = from;
                Scale.To.y         = to;
                break;

            case TweenAxis.Z:
                Scale.IgnoreAxis.Z = false;
                Scale.From.z       = from;
                Scale.To.z         = to;
                break;
            }

            Scale.IsRelative = isRelative;

            return(this);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Set an Animation Curve to be added to the Target Vector.
        /// ie Target Vector3 010 and CurveY ending with 3 and Amplitude 1 will result in final target position of 040.
        /// Play with the curves
        /// </summary>
        /// <param name="curve">Unity Animation Curve can be set in Editor</param>
        /// <param name="axis">Select which Axis to apply the curve to, TweenAxis.All applies the same curve to all Axes</param>
        /// <param name="amplitude">Can be more than 1 if you want to multiply the values of the curve</param>
        /// <returns></returns>
        public TweenJobTransform SetCurve(AnimationCurve curve, TweenAxis axis, float amplitude = 1)
        {
            switch (axis)
            {
            case TweenAxis.X:
                curveX     = curve;
                amplitudeX = amplitude;
                break;

            case TweenAxis.Y:
                curveY     = curve;
                amplitudeY = amplitude;
                break;

            case TweenAxis.Z:
                curveZ     = curve;
                amplitudeZ = amplitude;
                break;

            case TweenAxis.All:
                curveX     = curve;
                curveY     = curve;
                curveZ     = curve;
                amplitudeX = amplitude;
                amplitudeY = amplitude;
                amplitudeZ = amplitude;
                break;
            }
            ;

            return(this);
        }