Beispiel #1
0
 public LTDescr setPath(LTBezierPath path)
 {
     this.path = path;
     return this;
 }
Beispiel #2
0
public static int moveLocal(GameObject gameObject, Vector3[] to, float time, Hashtable optional){
	if(to.Length<4){
		string errorMsg = "LeanTween - When passing values for a vector path, you must pass four or more values!";
		if(throwErrors) Debug.LogError(errorMsg); else Debug.Log(errorMsg);
		return -1;
	}
	if(to.Length%4!=0){
		string errorMsg2 = "LeanTween - When passing values for a vector path, they must be in sets of four: controlPoint1, controlPoint2, endPoint2, controlPoint2, controlPoint2...";
		if(throwErrors) Debug.LogError(errorMsg2); else Debug.Log(errorMsg2);
		return -1;
	}

	init();
	if( optional == null )
		optional = new Hashtable();

	LTBezierPath ltPath = new LTBezierPath( to );
	if(optional["orientToPath"]!=null)
		ltPath.orientToPath = true;
	optional["path"] = ltPath;

	return pushNewTween( gameObject, new Vector3(1.0f,0.0f,0.0f), time, TweenAction.MOVE_CURVED_LOCAL, optional );
}
Beispiel #3
0
        /**
    * While tweening along a curve, set this property to true, to be perpendicalur to the path it is moving upon
    * @method setOrientToPath
    * @param {bool} doesOrient:bool whether the gameobject will orient to the path it is animating along
    * @return {LTDescr} LTDescr an object that distinguishes the tween
    * @example
    * LeanTween.move( ltLogo, path, 1.0f ).setEase(LeanTweenType.easeOutQuad).setOrientToPath(true).setAxis(Vector3.forward);<br>
    */

        public LTDescr setOrientToPath(bool doesOrient)
        {
            if (this.type == TweenAction.MOVE_CURVED || this.type == TweenAction.MOVE_CURVED_LOCAL)
            {
                if (this.path == null)
                    this.path = new LTBezierPath();
                this.path.orientToPath = doesOrient;
            }
            else
            {
                this.spline.orientToPath = doesOrient;
            }
            return this;
        }