本文整理汇总了C#中LTDescr.setId方法的典型用法代码示例。如果您正苦于以下问题:C# LTDescr.setId方法的具体用法?C# LTDescr.setId怎么用?C# LTDescr.setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LTDescr
的用法示例。
在下文中一共展示了LTDescr.setId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: options
public static LTDescr options()
{
init();
for(j=0, i = startSearch; j < maxTweens; i++){
if(i>=maxTweens-1)
i = 0;
if(tweens[i].toggle==false){
if(i+1>tweenMaxSearch)
tweenMaxSearch = i+1;
startSearch = i + 1;
break;
}
j++;
if(j>=maxTweens)
return logError("LeanTween - You have run out of available spaces for tweening. To avoid this error increase the number of spaces to available for tweening when you initialize the LeanTween class ex: LeanTween.init( "+(maxTweens*2)+" );") as LTDescr;
}
tween = tweens[i];
tween.reset();
tween.setId( (uint)i );
return tween;
}
示例2: pushNewTween
private static int pushNewTween( GameObject gameObject, Vector3 to, float time, TweenAction tweenAction, Hashtable optional )
{
init(maxTweens);
if(gameObject==null)
return -1;
j = 0;
for(i = startSearch; j < maxTweens; i++){
if(i>=maxTweens-1)
i = 0;
if(tweens[i].toggle==false){
if(i+1>tweenMaxSearch)
tweenMaxSearch = i+1;
startSearch = i + 1;
break;
}
j++;
if(j>=maxTweens){
logError("LeanTween - You have run out of available spaces for tweening. To avoid this error increase the number of spaces to available for tweening when you initialize the LeanTween class ex: LeanTween.init( "+(maxTweens*2)+" );");
return -1;
}
}
tween = tweens[i];
tween.toggle = true;
tween.reset();
tween.trans = gameObject.transform;
tween.to = to;
tween.time = time;
tween.type = tweenAction;
tween.optional = optional;
tween.setId( (uint)i );
//tween.hasPhysics = gameObject.rigidbody!=null;
if(optional!=null){
var ease = optional["ease"];
//LeanTweenType ease;
var optionsNotUsed = 0;
if(ease!=null) {
tween.tweenType = LeanTweenType.linear;
if( ease.GetType() ==typeof( LeanTweenType) ){
tween.tweenType = (LeanTweenType)ease;// Enum.Parse(typeof(LeanTweenType), optional["ease"].ToString());
} else if(ease.GetType() == typeof(AnimationCurve)){
tween.animationCurve = optional["ease"] as AnimationCurve;
} else{
string func = optional["ease"].ToString();
if(func.Equals("easeOutQuad")){
tween.tweenType = LeanTweenType.easeOutQuad;
}else if(func.Equals("easeInQuad")){
tween.tweenType = LeanTweenType.easeInQuad;
}else if(func.Equals("easeInOutQuad")){
tween.tweenType = LeanTweenType.easeInOutQuad;
}
}
optionsNotUsed++;
}
if(optional["rect"]!=null){
tween.ltRect = (LTRect)optional["rect"];
optionsNotUsed++;
}
if(optional["path"]!=null){
tween.path = (LTBezierPath)optional["path"];
optionsNotUsed++;
}
if(optional["delay"]!=null){
tween.delay = (float)optional["delay"];
optionsNotUsed++;
}
if(optional["useEstimatedTime"]!=null){
tween.useEstimatedTime =(bool) optional["useEstimatedTime"];
optionsNotUsed++;
}
if(optional["useFrames"]!=null){
tween.useFrames =(bool) optional["useFrames"];
optionsNotUsed++;
}
if(optional["loopType"]!=null){
tween.loopType = (LeanTweenType)optional["loopType"];
optionsNotUsed++;
}
if(optional["repeat"]!=null){
tween.loopCount = (int)optional["repeat"];
if(tween.loopType==LeanTweenType.once)
tween.loopType = LeanTweenType.clamp;
optionsNotUsed++;
}
if(optional["point"]!=null){
tween.point = (Vector3)optional["point"];
optionsNotUsed++;
}
if(optional["axis"]!=null){
tween.axis = (Vector3)optional["axis"];
optionsNotUsed++;
}
if(optional.Count <= optionsNotUsed)
tween.optional = null; // nothing else is used with the extra piece, so set to null
}else{
tween.optional = null;
}
//Debug.Log("pushing new tween["+i+"]:"+tweens[i]);
//.........这里部分代码省略.........