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


C# LTDescr.reset方法代码示例

本文整理汇总了C#中LTDescr.reset方法的典型用法代码示例。如果您正苦于以下问题:C# LTDescr.reset方法的具体用法?C# LTDescr.reset怎么用?C# LTDescr.reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LTDescr的用法示例。


在下文中一共展示了LTDescr.reset方法的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;
    }
开发者ID:KittyMac,项目名称:LeanTween,代码行数:24,代码来源:LeanTween.cs

示例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]);
//.........这里部分代码省略.........
开发者ID:KittyMac,项目名称:LeanTween,代码行数:101,代码来源:LeanTween.cs


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