当前位置: 首页>>代码示例>>C#>>正文


C# LTBezierPath类代码示例

本文整理汇总了C#中LTBezierPath的典型用法代码示例。如果您正苦于以下问题:C# LTBezierPath类的具体用法?C# LTBezierPath怎么用?C# LTBezierPath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LTBezierPath类属于命名空间,在下文中一共展示了LTBezierPath类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: _CreateLTBezierPath

	static int _CreateLTBezierPath(IntPtr L)
	{
		try
		{
			int count = LuaDLL.lua_gettop(L);

			if (count == 0)
			{
				LTBezierPath obj = new LTBezierPath();
				ToLua.PushObject(L, obj);
				return 1;
			}
			else if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.Vector3[])))
			{
				UnityEngine.Vector3[] arg0 = ToLua.CheckObjectArray<UnityEngine.Vector3>(L, 1);
				LTBezierPath obj = new LTBezierPath(arg0);
				ToLua.PushObject(L, obj);
				return 1;
			}
			else
			{
				return LuaDLL.luaL_throw(L, "invalid arguments to ctor method: LTBezierPath.New");
			}
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}
开发者ID:woshihuo12,项目名称:UnityHello,代码行数:29,代码来源:LTBezierPathWrap.cs

示例2: constructor

 public static int constructor(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         LTBezierPath o;
         if(argc==1){
             o=new LTBezierPath();
             pushValue(l,true);
             pushValue(l,o);
             return 2;
         }
         else if(argc==2){
             UnityEngine.Vector3[] a1;
             checkType(l,2,out a1);
             o=new LTBezierPath(a1);
             pushValue(l,true);
             pushValue(l,o);
             return 2;
         }
         return error(l,"New object failed.");
     }
     catch(Exception e) {
         return error(l,e);
     }
 }
开发者ID:dafei2015,项目名称:hugula,代码行数:25,代码来源:Lua_LTBezierPath.cs

示例3: Start

	// Use this for initialization
	void Start () {
		lt1 = GameObject.Find("LeanTweenAvatar1");
		lt2 = GameObject.Find("LeanTweenAvatar2");

		ltPath1 = new LTBezierPath(editorPath.vec3);
		ltPath2 = new LTBezierPath(editorPath.vec3);
	}
开发者ID:Kundara,项目名称:project1,代码行数:8,代码来源:LTPathExampleIterateCS.cs

示例4: Start

	// Use this for initialization
	void Start () 
	{
		Nuts = new Transform[numNuts];

		// Get the leantween editor path
		path = GetComponent<LeanTweenPath>();

		// Create a bezier path based on the path
		nutPath = new LTBezierPath(path.vec3);

		// Load up the prefab
		itemPrefab = Resources.Load("CrystalNutPrefab", typeof(GameObject)) as GameObject;

		// Fill up the array with nuts
		for (int i=0; i< Nuts.Length; i++)
			Nuts[i] = (Transform) Instantiate(itemPrefab).transform;

		float pct = 0.0f;
		//float portion = 1.0f/Nuts.Length + 0.1f;
		float portion = 1.0f / Nuts.Length;
		//print("portion:" + portion);
		for (int i = 0; i < Nuts.Length; i++)
		{
			//float pct = 0.1f * i * (10 / Nuts.Length);
			//print(pct);
			nutPath.place(Nuts[i], pct);
			pct += portion;

		}
	}
开发者ID:pencilking2002,项目名称:TOF_Movement_Protype,代码行数:31,代码来源:PlaceNuts.cs

示例5: Start

    void Start()
    {
        if(points.Count != 4)
        {
            Debug.LogError("You need 4 points to animate on a curve");
        }

        LTBezierPath ltPath = new LTBezierPath(new Vector3[]{ points[0].position, points[2].position, points[1].position, points[3].position });
        LeanTween.move(gameObject, ltPath.pts, duration).setEase(easing).setOnComplete(TurnOnCameraFollow);
    }
开发者ID:Incipia,项目名称:SpaceRace,代码行数:10,代码来源:CameraMoveAlongCurve.cs

示例6: Start

	void Start () {
		// Create a LTBezierPath from the array of vectors made with the LeanTween Editor
		ltBezierPath = new LTBezierPath( ltPathDefinition.vec3 );

		// Adding Light Posts
		for(int i = 0; i < ltBezierPath.pts.Length; i++){
			// Add a Trigger at each bezier control node (which is every fourth point)
			if(i%4==0){
				GameObject post = GameObject.Instantiate( prefabLightPost );
				post.AddComponent<TriggerPointExample>(); // This component will track the entering and exiting of the car along the path
				post.transform.position = ltBezierPath.pts[ i ];
			}
		}
	}
开发者ID:Kundara,项目名称:project1,代码行数:14,代码来源:LTPathExampleTriggers.cs

示例7: setOrientToPath

 /**
 * 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;
 }
开发者ID:KittyMac,项目名称:LeanTween,代码行数:19,代码来源:LeanTween.cs

示例8: moveLocal

    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 );
    }
开发者ID:KittyMac,项目名称:LeanTween,代码行数:24,代码来源:LeanTween.cs

示例9: moveLocal

	public static LTDescr moveLocal(GameObject gameObject, LTBezierPath to, float time)
	{
		d = options();
		d.path = to;

		return pushNewTween(gameObject, new Vector3(1.0f, 0.0f, 0.0f), time, TweenAction.MOVE_CURVED_LOCAL, d);
	}
开发者ID:djfdat,项目名称:UnityTemplateProject-FolderStructure,代码行数:7,代码来源:LeanTween.cs

示例10: setDirection

	/**
	* Set the direction of a tween -1f for backwards 1f for forwards (currently only bezier and spline paths are supported)
	* @method setDirection ()
	* @param {float} direction:float the direction that the tween should run, -1f for backwards 1f for forwards
	* @return {LTDescr} LTDescr an object that distinguishes the tween
	* @example
	* LeanTween.moveSpline(gameObject, new Vector3[]{new Vector3(0f,0f,0f),new Vector3(1f,0f,0f),new Vector3(1f,0f,0f),new Vector3(1f,0f,1f)}, 1.5f).setDirection(-1f);<br>
	*/

	public LTDescr setDirection( float direction )
	{
		if(this.direction!=-1f && this.direction!=1f)
		{
			Debug.LogWarning("You have passed an incorrect direction of '"+direction+"', direction must be -1f or 1f");
			return this;
		}

		if(this.direction!=direction)
		{
			// Debug.Log("reverse path:"+this.path+" spline:"+this.spline);
			if(this.path!=null)
			{
				this.path = new LTBezierPath( LTUtility.reverse( this.path.pts ) );
			}
			else if(this.spline!=null)
			{
				this.spline = new LTSpline( LTUtility.reverse( this.spline.pts ) );
			}
		}

		return this;
	}
开发者ID:PinkRodeo,项目名称:GGJ2016,代码行数:32,代码来源:LeanTween.cs

示例11: LTMoveLocal

 public static LTDescr LTMoveLocal(this Transform self, LTBezierPath to, float time)
 {
     return LeanTween.moveLocal(self.gameObject, to, time);
 }
开发者ID:AK2S,项目名称:LeanTweenExtensions,代码行数:4,代码来源:LeanTweenExtensions.cs

示例12: setOrientToPath

 /**
 * 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);<br>
 */
 public LTDescr setOrientToPath( bool doesOrient )
 {
     if(this.path==null)
         this.path = new LTBezierPath();
     this.path.orientToPath = doesOrient;
     return this;
 }
开发者ID:Tartarus1901,项目名称:LeanTween,代码行数:15,代码来源:LeanTween.cs

示例13: OnEnable

 void OnEnable()
 {
     // create the path
     cr = new LTBezierPath( new Vector3[] {trans[0].position, trans[2].position, trans[1].position, trans[3].position, trans[3].position, trans[5].position, trans[4].position, trans[6].position} );
 }
开发者ID:ckimmons,项目名称:newbies-vets-jam,代码行数:5,代码来源:PathSplinesBezier.cs

示例14: moveLocal

	public static LTDescr moveLocal(GameObject gameObject, LTBezierPath to, float time) {
		d = options().setMoveCurvedLocal();
		d.optional.path = to;

		return pushNewTween(gameObject, new Vector3(1.0f, 0.0f, 0.0f), time, d);
	}
开发者ID:dentedpixel,项目名称:LeanTween,代码行数:6,代码来源:LeanTween.cs

示例15: setPath

 public LTDescr setPath( LTBezierPath path )
 {
     this.path = path;
     return this;
 }
开发者ID:KittyMac,项目名称:LeanTween,代码行数:5,代码来源:LeanTween.cs


注:本文中的LTBezierPath类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。