示例#1
0
    public PotaTween SetColor(Color from, Color to, string colorProperty = "_Color")
    {
        Color = new PTTColor(from, to);
        this._colorProperty = colorProperty;
        GetRenderers();

        return(this);
    }
示例#2
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);
        }
    }
示例#3
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;
    }