本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
示例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;
}
}
示例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);
}
示例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 ];
}
}
}
示例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;
}
示例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 );
}
示例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);
}
示例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;
}
示例11: LTMoveLocal
public static LTDescr LTMoveLocal(this Transform self, LTBezierPath to, float time)
{
return LeanTween.moveLocal(self.gameObject, to, time);
}
示例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;
}
示例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} );
}
示例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);
}
示例15: setPath
public LTDescr setPath( LTBezierPath path )
{
this.path = path;
return this;
}