FloatTweenProperty.prepareForUse C# (CSharp) Method

prepareForUse() public method

public prepareForUse ( ) : void
return void
    public override void prepareForUse()
    {
        // retrieve the getter
        var getter = GoTweenUtils.getterForProperty<Func<float>>( _ownerTween.target, propertyName );

        _endValue = _originalEndValue;

        // if this is a from tween we need to swap the start and end values
        if( _ownerTween.isFrom )
        {
            _startValue = _endValue;
            _endValue = getter();
        }
        else
        {
            _startValue = getter();
        }

        // setup the diff value
        if( _isRelative && !_ownerTween.isFrom )
            _diffValue = _endValue;
        else
            _diffValue = _endValue - _startValue;
    }