Ejemplo n.º 1
0
    public override void prepareForUse()
    {
        // if this is a from tween first reverse the path then build it. we unreverse in case we were copied
        if (_ownerTween.isFrom)
        {
            _path.reverseNodes();
        }
        else
        {
            _path.unreverseNodes();
        }

        _path.buildPath();

        // a from tween means the start value is the last node
        if (_ownerTween.isFrom)
        {
            _startValue = _path.getLastNode();
        }
        else
        {
            // retrieve the getter only when needed
            var getter = GoTweenUtils.getterForProperty <Func <Vector3> >(_ownerTween.target, propertyName);
            _startValue = getter();
        }
    }
Ejemplo n.º 2
0
    public override void prepareForUse()
    {
        // retrieve the getter
        if (_getter == null)
        {
            _getter = GoTweenUtils.getterForProperty <Func <Vector3> >(_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().x;
        }
        else
        {
            _startValue = _getter().x;
        }

        // prep the diff value
        if (_isRelative && !_ownerTween.isFrom)
        {
            _diffValue = _endValue;
        }
        else
        {
            _diffValue = _endValue - _startValue;
        }
    }
Ejemplo n.º 3
0
    public override void prepareForUse()
    {
        // retrieve the getter
        _endValue = _originalEndValue;

        var     transform = _ownerTween.TargetTransform;
        Vector3 value;

        _targetTransform = transform;

        if (transform != null)
        {
            value = transform.FastGetterVector3(propertyName);
        }
        else
        {
            var getter = GoTweenUtils.getterForProperty <Func <Vector3> >(_ownerTween.target, propertyName);
            value = getter();
        }

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

        base.prepareForUse();
    }
    public override void prepareForUse()
    {
        Func <Color> func = GoTweenUtils.getterForProperty <Func <Color> >(_ownerTween.target, propertyName);

        _endValue = _originalEndValue;
        if (_ownerTween.isFrom)
        {
            _startValue = _endValue;
            _endValue   = func();
        }
        else
        {
            _startValue = func();
        }
        base.prepareForUse();
    }
    public override void prepareForUse()
    {
        // retrieve the getter
        var getter = GoTweenUtils.getterForProperty <Func <Vector3> >(_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();
        }

        base.prepareForUse();
    }
Ejemplo n.º 6
0
    public override void prepareForUse()
    {
        if (_ownerTween.isFrom)
        {
            _path.reverseNodes();
        }
        else
        {
            _path.unreverseNodes();
        }
        _path.buildPath();
        if (_ownerTween.isFrom)
        {
            _startValue = _path.getLastNode();
            return;
        }
        Func <Vector3> func = GoTweenUtils.getterForProperty <Func <Vector3> >(_ownerTween.target, propertyName);

        _startValue = func();
    }
    public override void prepareForUse()
    {
        Func <Vector4> func = GoTweenUtils.getterForProperty <Func <Vector4> >(_ownerTween.target, propertyName);

        _endValue = _originalEndValue;
        if (_ownerTween.isFrom)
        {
            _endValue = _startValue;
            _endValue = func();
        }
        else
        {
            _startValue = func();
        }
        if (_isRelative && !_ownerTween.isFrom)
        {
            _diffValue = _endValue;
        }
        else
        {
            _diffValue = _endValue - _startValue;
        }
    }
 public override void prepareForUse()
 {
     _getter   = GoTweenUtils.getterForProperty <Func <Vector3> >(_ownerTween.target, base.propertyName);
     _endValue = _originalEndValue;
     if (_ownerTween.isFrom)
     {
         _startValue = _endValue;
         Vector3 vector = _getter();
         _endValue = vector.z;
     }
     else
     {
         Vector3 vector2 = _getter();
         _startValue = vector2.z;
     }
     if (_isRelative && !_ownerTween.isFrom)
     {
         _diffValue = _endValue;
     }
     else
     {
         _diffValue = _endValue - _startValue;
     }
 }
Ejemplo n.º 9
0
    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;
    }