public override void prepareForUse()
 {
     _target = (_ownerTween.target as Transform);
     if (_ownerTween.isFrom)
     {
         _path.reverseNodes();
     }
     else
     {
         _path.unreverseNodes();
     }
     _path.buildPath();
     if (_ownerTween.isFrom)
     {
         _startValue = _path.getLastNode();
     }
     else if (_useLocalPosition)
     {
         _startValue = _target.localPosition;
     }
     else
     {
         _startValue = _target.position;
     }
     if (_lookAtType == GoLookAtType.TargetTransform && _lookTarget == null)
     {
         _lookAtType = GoLookAtType.None;
     }
     _smoothedRotation = _target.rotation;
 }
 public PositionPathTweenProperty(GoSpline path, bool isRelative = false, bool useLocalPosition = false, GoLookAtType lookAtType = GoLookAtType.None, Transform lookTarget = null) : base(isRelative)
 {
     _path             = path;
     _useLocalPosition = useLocalPosition;
     _lookAtType       = lookAtType;
     _lookTarget       = lookTarget;
 }
Exemplo n.º 3
0
	/// <summary>
	/// position path tween
	/// </summary>
	public GoTweenConfig positionPath( GoSpline path, bool isRelative = false, GoLookAtType lookAtType = GoLookAtType.None, Transform lookTarget = null )
	{
		var prop = new PositionPathTweenProperty( path, isRelative, false, lookAtType, lookTarget );
		_tweenProperties.Add( prop );
		
		return this;
	}
    public override void prepareForUse ()
    {
        _target = _ownerTween.target as Transform;

        // if this is a from tween first reverse the path then build it
        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
        {
            if ( _useLocalPosition )
                _startValue = _target.localPosition;
            else
                _startValue = _target.position;
        }

        // validate the lookTarget if we are set to look at it
        if ( _lookAtType == GoLookAtType.TargetTransform )
        {
            if ( _lookTarget == null )
                _lookAtType = GoLookAtType.None;
        }

        // prep our smoothed rotation
        _smoothedRotation = _target.rotation;
    }
 public PositionPathTweenProperty ( GoSpline path , bool isRelative = false , bool useLocalPosition = false , GoLookAtType lookAtType = GoLookAtType.None , Transform lookTarget = null ) : base( isRelative )
 {
     _path = path;
     _useLocalPosition = useLocalPosition;
     _lookAtType = lookAtType;
     _lookTarget = lookTarget;
 }
    public GoTweenConfig positionPath(GoSpline path, bool isRelative = false, GoLookAtType lookAtType = GoLookAtType.None, Transform lookTarget = null)
    {
        PositionPathTweenProperty item = new PositionPathTweenProperty(path, isRelative, useLocalPosition: false, lookAtType, lookTarget);

        _tweenProperties.Add(item);
        return(this);
    }
Exemplo n.º 7
0
    /// <summary>
    /// position path tween
    /// </summary>
    public GoTweenConfig localPositionPath(GoSpline path, bool isRelative = false, GoLookAtType lookAtType = GoLookAtType.None, Transform lookTarget = null)
    {
        var prop = new PositionPathTweenProperty(path, isRelative, true, lookAtType, lookTarget);

        _tweenProperties.Add(prop);

        return(this);
    }
    public override void prepareForUse()
    {
        _target = _ownerTween.target as Transform;

        // if this is a from tween first reverse the path then build it
        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
        {
            if (_useLocalPosition)
            {
                _startValue = _target.localPosition;
            }
            else
            {
                _startValue = _target.position;
            }
        }

        // validate the lookTarget if we are set to look at it
        if (_lookAtType == GoLookAtType.TargetTransform)
        {
            if (_lookTarget == null)
            {
                _lookAtType = GoLookAtType.None;
            }
        }

        // prep our smoothed rotation
        _smoothedRotation = _target.rotation;
    }