buildPath() public method

responsible for calculating total length, segmentStartLocations and segmentDistances
public buildPath ( ) : void
return void
Exemplo 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();
        }
    }
 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 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
        {
            _startValue = _target.localScale;
        }
    }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     thePath = new GoSpline (dummy.nodes);
     thePath.buildPath ();
     startSpeed = Random.Range (0.01f, .3f);
     targetSpeed = startSpeed;
     currentSpeed = 0f;
 }
Exemplo n.º 5
0
 public GoSpline Spline()
 {
     if (spline == null)
     {
         spline = new GoSpline(nodes);
         spline.buildPath();
     }
     return(spline);
 }
Exemplo n.º 6
0
	protected void BuildSplines(int num) {
		for (int s=0; s<num; s++) {
			GoSpline spline = new GoSpline(splineNodes);
			spline.buildPath();

			if (splineLookupCount > 0) {
				LookupSpline(spline);
			}
		}
	}
Exemplo n.º 7
0
    public static GoTween from(object target, GoSpline path, float speed, GoTweenConfig config)
    {
        config.setIsFrom();
        path.buildPath();
        float   duration = path.pathLength / speed;
        GoTween goTween  = new GoTween(target, duration, config);

        addTween(goTween);
        return(goTween);
    }
Exemplo n.º 8
0
    public GoTween to(object target, GoSpline path, float speed, GoTweenConfig config)
    {
        config.setIsTo();
        path.buildPath();
        float duration = path.pathLength / speed;
        var   tween    = new GoTween(target, duration, config);

        addTween(tween);

        return(tween);
    }
Exemplo n.º 9
0
 static public int buildPath(IntPtr l)
 {
     try {
         GoSpline self = (GoSpline)checkSelf(l);
         self.buildPath();
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 10
0
    protected void BuildSplines(int num)
    {
        for (int s = 0; s < num; s++)
        {
            GoSpline spline = new GoSpline(splineNodes);
            spline.buildPath();

            if (splineLookupCount > 0)
            {
                LookupSpline(spline);
            }
        }
    }
    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;
    }
Exemplo n.º 12
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()
 {
     _target = (_ownerTween.target as Transform);
     if (_ownerTween.isFrom)
     {
         _path.reverseNodes();
     }
     else
     {
         _path.unreverseNodes();
     }
     _path.buildPath();
     if (_ownerTween.isFrom)
     {
         _startValue = _path.getLastNode();
     }
     else
     {
         _startValue = _target.localScale;
     }
 }
Exemplo n.º 14
0
    public static GoTween to( object target, GoSpline path, float speed, GoTweenConfig config )
    {
        config.setIsTo();
        path.buildPath();
        float duration = path.pathLength / speed;
        var tween = new GoTween( target, duration, config );
        addTween( tween );

        return tween;
    }