예제 #1
0
        public PYTweenAnimation SetRotation(Vector3 from, Vector3 to, bool isLocal = false, bool isRelative = false)
        {
            Rotation            = new PTTVector3(from, to, isLocal, isRelative);
            Rotation.ignoreAxis = new PTTAxisMask(false, false, false);

            return(this);
        }
예제 #2
0
        public PYTweenAnimation SetScale(Vector3 from, Vector3 to, bool isRelative = false)
        {
            Scale            = new PTTVector3(from, to, false, isRelative);
            Scale.ignoreAxis = new PTTAxisMask(false, false, false);

            return(this);
        }
예제 #3
0
        void ReverseDirection()
        {
            _hasReverted = !_hasReverted;

            Position = new PTTVector3(Position.to, Position.from, Position.isLocal, Position.isRelative, Position.ignoreAxis);
            Rotation = new PTTVector3(Rotation.to, Rotation.from, Rotation.isLocal, Rotation.isRelative, Rotation.ignoreAxis);
            Scale    = new PTTVector3(Scale.to, Scale.from, Scale.isLocal, Scale.isRelative, Scale.ignoreAxis);
            Color    = new PTTColor(Color.to, Color.from);
            Alpha    = new PTTFloat(Alpha.to, Alpha.from);
            Float    = new PTTFloat(Float.to, Float.from);

            if (AnimationData.Curve != null && FlipCurveOnReverse)
            {
                AnimationData.Curve = ReverseCurve(AnimationData.Curve);
            }
        }
예제 #4
0
        void Initialize()
        {
            if (AnimationData == null)
            {
                Awake();
            }

            Position = new PTTVector3(OwnTransform.position);
            Rotation = new PTTVector3(OwnTransform.eulerAngles);
            Scale    = new PTTVector3(OwnTransform.localScale);
            if (GetComponent <Renderer>() != null && GetComponent <Renderer>().sharedMaterial != null)
            {
                Color =
                    new PTTColor((GetComponent <Renderer>().sharedMaterial.HasProperty(colorProperty)
                        ? GetComponent <Renderer>().sharedMaterial.GetColor(colorProperty)
                        : UnityEngine.Color.white));
                Alpha =
                    new PTTFloat((GetComponent <Renderer>().sharedMaterial.HasProperty(colorProperty)
                        ? GetComponent <Renderer>().sharedMaterial.GetColor(colorProperty).a
                        : 1));
            }
            else
            {
                Color = new PTTColor(UnityEngine.Color.white);
                Alpha = new PTTFloat(1);
            }
            Float = new PTTFloat(0);

            AnimationData.Duration = 1;
            Speed        = 0;
            DelayToStart = 0;
            SetEaseType(Ease.Type.Linear);
            startCallback  = null;
            updateCallback = null;
            finishCallback = null;
            _hasReverted   = false;

            _loopcount = 0;

            AnimationData.Curve = AnimationCurve.Linear(0, 0, 1, 1);
            AnimationData.Loop  = TagManager.LoopType.None;
        }