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


C# TweenAction类代码示例

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


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

示例1: setTextAlpha

 public LTDescr setTextAlpha()
 {
     this.type = TweenAction.TEXT_ALPHA;
     this.initInternal = ()=>{
         this.uiText = trans.gameObject.GetComponent<UnityEngine.UI.Text>();
         this.fromInternal.x = this.uiText != null ? this.uiText.color.a : 1f;
     };
     this.easeInternal = ()=>{ textAlphaRecursive( trans, easeMethod().x, this.useRecursion ); };
     return this;
 }
开发者ID:AK2S,项目名称:LeanTweenExtensions,代码行数:10,代码来源:LTDescr.cs

示例2: update


//.........这里部分代码省略.........
							isTweenFinished = true;
							tween.passed = Mathf.Epsilon;
						}
					}

					if (!tween.hasInitiliazed && ((tween.passed == 0.0 && tween.delay == 0.0) || tween.passed > 0.0))
					{
						tween.init();
					}

					if (tween.delay <= 0)
					{
						// Move Values
						if (timeTotal <= 0f)
						{
							//Debug.LogError("time total is zero Time.timeScale:"+Time.timeScale+" useEstimatedTime:"+tween.useEstimatedTime);
							ratioPassed = 1f;
						}
						else
						{
							ratioPassed = tween.passed / timeTotal;
						}

						if (ratioPassed > 1.0f)
						{
							ratioPassed = 1.0f;
						}
						else if (ratioPassed < 0f)
						{
							ratioPassed = 0f;
						}
						// Debug.Log("action:"+tweenAction+" ratioPassed:"+ratioPassed + " timeTotal:" + timeTotal + " tween.passed:"+ tween.passed +" dt:"+dt);

						if (tweenAction >= TweenAction.MOVE_X && tweenAction < TweenAction.MOVE)
						{
							if (tween.animationCurve != null)
							{
								val = tweenOnCurve(tween, ratioPassed);
							}
							else
							{
								switch (tween.tweenType)
								{
									case LeanTweenType.linear:
										val = tween.from.x + tween.diff.x * ratioPassed; break;
									case LeanTweenType.easeOutQuad:
										val = easeOutQuadOpt(tween.from.x, tween.diff.x, ratioPassed); break;
									case LeanTweenType.easeInQuad:
										val = easeInQuadOpt(tween.from.x, tween.diff.x, ratioPassed); break;
									case LeanTweenType.easeInOutQuad:
										val = easeInOutQuadOpt(tween.from.x, tween.diff.x, ratioPassed); break;
									case LeanTweenType.easeInCubic:
										val = easeInCubic(tween.from.x, tween.to.x, ratioPassed); break;
									case LeanTweenType.easeOutCubic:
										val = easeOutCubic(tween.from.x, tween.to.x, ratioPassed); break;
									case LeanTweenType.easeInOutCubic:
										val = easeInOutCubic(tween.from.x, tween.to.x, ratioPassed); break;
									case LeanTweenType.easeInQuart:
										val = easeInQuart(tween.from.x, tween.to.x, ratioPassed); break;
									case LeanTweenType.easeOutQuart:
										val = easeOutQuart(tween.from.x, tween.to.x, ratioPassed); break;
									case LeanTweenType.easeInOutQuart:
										val = easeInOutQuart(tween.from.x, tween.to.x, ratioPassed); break;
									case LeanTweenType.easeInQuint:
										val = easeInQuint(tween.from.x, tween.to.x, ratioPassed); break;
									case LeanTweenType.easeOutQuint:
开发者ID:djfdat,项目名称:UnityTemplateProject-FolderStructure,代码行数:67,代码来源:LeanTween.cs

示例3: pushNewTween

    private static LTDescr pushNewTween( GameObject gameObject, Vector3 to, float time, TweenAction tweenAction, LTDescr tween )
    {
        init(maxTweens);
        if(gameObject==null)
        return null;
        tween.trans = gameObject.transform;
        tween.to = to;
        tween.time = time;
        tween.type = tweenAction;
        //tween.hasPhysics = gameObject.rigidbody!=null;

        return tween;
    }
开发者ID:KittyMac,项目名称:LeanTween,代码行数:13,代码来源:LeanTween.cs

示例4: setGUIScale

 public LTDescr setGUIScale()
 {
     this.type = TweenAction.GUI_SCALE;
     this.initInternal = ()=>{ this.from = new Vector3(this._optional.ltRect.rect.width, this._optional.ltRect.rect.height, 0); };
     this.easeInternal = ()=>{ Vector3 v = easeMethod(); this._optional.ltRect.rect = new Rect( this._optional.ltRect.rect.x, this._optional.ltRect.rect.y, v.x, v.y); };
     return this;
 }
开发者ID:AK2S,项目名称:LeanTweenExtensions,代码行数:7,代码来源:LTDescr.cs

示例5: setMoveCurved

 public LTDescr setMoveCurved()
 {
     this.type = TweenAction.MOVE_CURVED;
     this.initInternal = this.initFromInternal;
     this.easeInternal = ()=>{
         newVect = easeMethod();
         val = newVect.x;
         if(this._optional.path.orientToPath){
             if(this._optional.path.orientToPath2d){
                 this._optional.path.place2d( trans, val );
             }else{
                 this._optional.path.place( trans, val );
             }
         }else{
             trans.position = this._optional.path.point( val );
         }
     };
     return this;
 }
开发者ID:AK2S,项目名称:LeanTweenExtensions,代码行数:19,代码来源:LTDescr.cs

示例6: setDelayedSound

 public LTDescr setDelayedSound()
 {
     this.type = TweenAction.DELAYED_SOUND;
     this.initInternal = ()=>{ this.hasExtraOnCompletes = true; };
     this.easeInternal = this.callback;
     return this;
 }
开发者ID:AK2S,项目名称:LeanTweenExtensions,代码行数:7,代码来源:LTDescr.cs

示例7: setGUIMoveMargin

 public LTDescr setGUIMoveMargin()
 {
     this.type = TweenAction.GUI_MOVE_MARGIN;
     this.initInternal = ()=>{ this.from = new Vector2(this._optional.ltRect.margin.x, this._optional.ltRect.margin.y); };
     this.easeInternal = ()=>{ Vector3 v = easeMethod(); this._optional.ltRect.margin = new Vector2(v.x, v.y); };
     return this;
 }
开发者ID:AK2S,项目名称:LeanTweenExtensions,代码行数:7,代码来源:LTDescr.cs

示例8: setCanvasMoveZ

 public LTDescr setCanvasMoveZ()
 {
     this.type = TweenAction.CANVAS_MOVE_Z;
     this.initInternal = ()=>{ this.fromInternal.x = this.rectTransform.anchoredPosition3D.z; };
     this.easeInternal = ()=>{ Vector3 c = this.rectTransform.anchoredPosition3D; this.rectTransform.anchoredPosition3D = new Vector3(c.x, c.y, easeMethod().x); };
     return this;
 }
开发者ID:AK2S,项目名称:LeanTweenExtensions,代码行数:7,代码来源:LTDescr.cs

示例9: setCanvasPlaySprite

 public LTDescr setCanvasPlaySprite()
 {
     this.type = TweenAction.CANVAS_PLAYSPRITE;
     this.initInternal = ()=>{
         this.uiImage = trans.gameObject.GetComponent<UnityEngine.UI.Image>();
         this.fromInternal.x = 0f;
     };
     this.easeInternal = ()=>{
         newVect = easeMethod();
         val = newVect.x;
         int frame = (int)Mathf.Round( val );
         this.uiImage.sprite = this.sprites[ frame ];
     };
     return this;
 }
开发者ID:AK2S,项目名称:LeanTweenExtensions,代码行数:15,代码来源:LTDescr.cs

示例10: setCanvasGroupAlpha

 public LTDescr setCanvasGroupAlpha()
 {
     this.type = TweenAction.CANVASGROUP_ALPHA;
     this.initInternal = ()=>{this.fromInternal.x = trans.gameObject.GetComponent<CanvasGroup>().alpha;};
     this.easeInternal = ()=>{ this.trans.GetComponent<CanvasGroup>().alpha = easeMethod().x; };
     return this;
 }
开发者ID:AK2S,项目名称:LeanTweenExtensions,代码行数:7,代码来源:LTDescr.cs

示例11: setCanvasMove

 public LTDescr setCanvasMove()
 {
     this.type = TweenAction.CANVAS_MOVE;
     this.initInternal = ()=>{ this.fromInternal = this.rectTransform.anchoredPosition3D; };
     this.easeInternal = ()=>{ this.rectTransform.anchoredPosition3D = easeMethod(); };
     return this;
 }
开发者ID:AK2S,项目名称:LeanTweenExtensions,代码行数:7,代码来源:LTDescr.cs

示例12: setCanvasColor

    public LTDescr setCanvasColor()
    {
        this.type = TweenAction.CANVAS_COLOR;
        this.initInternal = ()=>{
            this.uiImage = trans.gameObject.GetComponent<UnityEngine.UI.Image>();
            if(this.uiImage != null){
                this.setFromColor( this.uiImage.color );
            }else{
                this.setFromColor( Color.white );
            }
        };
        this.easeInternal = ()=>{
            newVect = easeMethod();
            val = newVect.x;
            Color toColor = tweenColor(this, val);
            this.uiImage.color = toColor;
            if (dt!=0f && this._optional.onUpdateColor != null)
                this._optional.onUpdateColor(toColor);

            if(this.useRecursion)
                colorRecursive(this.rectTransform, toColor);
        };
        return this;
    }
开发者ID:AK2S,项目名称:LeanTweenExtensions,代码行数:24,代码来源:LTDescr.cs

示例13: setCanvasAlpha

 public LTDescr setCanvasAlpha()
 {
     this.type = TweenAction.CANVAS_ALPHA;
     this.initInternal = ()=>{
         this.uiImage = trans.gameObject.GetComponent<UnityEngine.UI.Image>();
         this.fromInternal.x = this.uiImage != null ? this.uiImage.color.a : 1f;
     };
     this.easeInternal = ()=>{
         newVect = easeMethod();
         val = newVect.x;
         if(this.uiImage!=null){
             Color c = this.uiImage.color; c.a = val; this.uiImage.color = c;
         }
         if(this.useRecursion){
             alphaRecursive( this.rectTransform, val, 0 );
             textAlphaRecursive( this.rectTransform, val);
         }
     };
     return this;
 }
开发者ID:AK2S,项目名称:LeanTweenExtensions,代码行数:20,代码来源:LTDescr.cs

示例14: setValue3

 public LTDescr setValue3()
 {
     this.type = TweenAction.VALUE3;
     this.initInternal = ()=>{};
     this.easeInternal = this.callback;
     return this;
 }
开发者ID:AK2S,项目名称:LeanTweenExtensions,代码行数:7,代码来源:LTDescr.cs

示例15: setCallbackColor

    public LTDescr setCallbackColor()
    {
        this.type = TweenAction.CALLBACK_COLOR;
        this.initInternal = ()=>{ this.diff = new Vector3(1.0f,0.0f,0.0f); };
        this.easeInternal = ()=>{
            newVect = easeMethod();
            val = newVect.x;
            Color toColor = tweenColor(this, val);

            #if !UNITY_3_5 && !UNITY_4_0 && !UNITY_4_0_1 && !UNITY_4_1 && !UNITY_4_2
            if(this.spriteRen!=null){
                this.spriteRen.color = toColor;
                colorRecursiveSprite( trans, toColor);
            }else{
            #endif
                // Debug.Log("val:"+val+" tween:"+tween+" tween.diff:"+tween.diff);
                if(this.type==TweenAction.COLOR)
                    colorRecursive(trans, toColor, this.useRecursion);

                #if !UNITY_3_5 && !UNITY_4_0 && !UNITY_4_0_1 && !UNITY_4_1 && !UNITY_4_2
            }
                #endif
            if(dt!=0f && this._optional.onUpdateColor!=null){
                this._optional.onUpdateColor(toColor);
            }else if(dt!=0f && this._optional.onUpdateColorObject!=null){
                this._optional.onUpdateColorObject(toColor, this._optional.onUpdateParam);
            }
        };
        return this;
    }
开发者ID:AK2S,项目名称:LeanTweenExtensions,代码行数:30,代码来源:LTDescr.cs


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