public override void prepareForUse() { // retrieve the getter var getter = GoTweenUtils.getterForProperty <Func <Vector2> >(_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(); } // prep the diff value if (_isRelative && !_ownerTween.isFrom) { _diffValue = _endValue; } else { _diffValue = _endValue - _startValue; } }
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(); } }
public override void prepareForUse() { // retrieve the getter var getter = GoTweenUtils.getterForProperty <Func <Color> >(_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(); }