Esempio n. 1
0
    public PotaTween SetPosition(Vector3 from, Vector3 to, bool isLocal = false, bool isRelative = false)
    {
        Position            = new PTTVector3(from, to, isLocal, isRelative);
        Position.IgnoreAxis = new PTTAxisMask(false, false, false);

        return(this);
    }
Esempio n. 2
0
    public PotaTween SetScale(Vector3 from, Vector3 to, bool isRelative = false)
    {
        Scale            = new PTTVector3(from, to, false, isRelative);
        Scale.IgnoreAxis = new PTTAxisMask(false, false, false);

        return(this);
    }
Esempio n. 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 (Curve != null && FlipCurveOnReverse)
        {
            Curve = ReverseCurve(Curve);
        }
    }
Esempio n. 4
0
    void Initialize()
    {
        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);

        Duration = 1;
        Speed    = 0;
        Delay    = 0;
        SetEaseEquation(Ease.Equation.Linear);
        _startCallback  = null;
        _updateCallback = null;
        finishCallback.Clear();
        _hasReverted = false;

        _loopcount = 0;

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