• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# EaseType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Begin

 public static void Begin(GameObject target, Vector3 from, Vector3 to, float duration, EaseType easeType = EaseType.Linear)
 {
     var tweenScale = target.GetComponent<TweenScale>();
     if (tweenScale == null)
         tweenScale = target.AddComponent<TweenScale>();
     tweenScale.Begin(from, to, duration, easeType);
 }
开发者ID:teodorplop,项目名称:Tower-Defense-Multiplayer,代码行数:7,代码来源:TweenScale.cs


示例2: Blink

    /*
    ============================================================================
    Blink functions
    ============================================================================
    */
    public IEnumerator Blink(bool fc, bool fa, float als, float ae, bool fr, float rs, float re,
			bool fg, float gs, float ge, bool fb, float bs, float be, EaseType et, float t)
    {
        this.Clear();

        this.fadeChildren = fc;
        this.fadeAlpha = fa;
        this.alphaStart = als;
        this.alphaEnd = ae;
        this.alphaDistance = ae - als;
        this.fadeRed = fr;
        this.redStart = rs;
        this.redEnd = re;
        this.redDistance = re - rs;
        this.fadeGreen = fg;
        this.greenStart = gs;
        this.greenEnd = ge;
        this.greenDistance = ge - gs;
        this.fadeBlue = fb;
        this.blueStart = bs;
        this.blueEnd = be;
        this.blueDistance = be - bs;
        this.interpolate = Interpolate.Ease(et);
        this.time = 0;
        this.time2 = t;

        yield return null;
        this.fading = true;
        this.flash = true;
        this.blink = true;
    }
开发者ID:hughrogers,项目名称:RPGQuest,代码行数:36,代码来源:EventFader.cs


示例3: EaseFunction

 public static Function EaseFunction(EaseType type)
 {
     //Returns the static method that implements the given easing type for scalars.
     //Use this method to easily switch between easing interpolation types.
     //All easing methods clamp elapsedTime so that it is always less than duration.
     Function f = null;
     switch (type)
     {
         case EaseType.Linear: f = Easing.Linear; break;
         case EaseType.EaseInQuad: f = Easing.EaseInQuad; break;
         case EaseType.EaseOutQuad: f = Easing.EaseOutQuad; break;
         case EaseType.EaseInOutQuad: f = Easing.EaseInOutQuad; break;
         case EaseType.EaseInCubic: f = Easing.EaseInCubic; break;
         case EaseType.EaseOutCubic: f = Easing.EaseOutCubic; break;
         case EaseType.EaseInOutCubic: f = Easing.EaseInOutCubic; break;
         case EaseType.EaseInQuart: f = Easing.EaseInQuart; break;
         case EaseType.EaseOutQuart: f = Easing.EaseOutQuart; break;
         case EaseType.EaseInOutQuart: f = Easing.EaseInOutQuart; break;
         case EaseType.EaseInQuint: f = Easing.EaseInQuint; break;
         case EaseType.EaseOutQuint: f = Easing.EaseOutQuint; break;
         case EaseType.EaseInOutQuint: f = Easing.EaseInOutQuint; break;
         case EaseType.EaseInSine: f = Easing.EaseInSine; break;
         case EaseType.EaseOutSine: f = Easing.EaseOutSine; break;
         case EaseType.EaseInOutSine: f = Easing.EaseInOutSine; break;
         case EaseType.EaseInExpo: f = Easing.EaseInExpo; break;
         case EaseType.EaseOutExpo: f = Easing.EaseOutExpo; break;
         case EaseType.EaseInOutExpo: f = Easing.EaseInOutExpo; break;
         case EaseType.EaseInCirc: f = Easing.EaseInCirc; break;
         case EaseType.EaseOutCirc: f = Easing.EaseOutCirc; break;
         case EaseType.EaseInOutCirc: f = Easing.EaseInOutCirc; break;
     }
     return f;
 }
开发者ID:crawson7,项目名称:OnyxSidewinder,代码行数:33,代码来源:Easing.cs


示例4: SetTargetData

    public IEnumerator SetTargetData(CameraPosition cp, Transform c, Transform a, EaseType et, float t)
    {
        this.shaking = false;
        this.running = false;
        this.rotating = false;

        this.camPos = cp;
        this.cam = c;
        this.actor = a;
        this.interpolate = Interpolate.Ease(et);
        this.time = 0;
        this.time2 = t;

        Transform tmp = new GameObject().transform;
        this.camPos.Use(tmp, this.actor);
        yield return null;
        this.startPos = this.cam.position;
        this.distancePos = tmp.position - this.startPos;
        this.startRot = this.cam.rotation;
        this.endRot = tmp.rotation;
        this.startFoV = this.cam.camera.fieldOfView;
        this.distanceFov = this.camPos.fieldOfView - this.startFoV;
        GameObject.Destroy(tmp.gameObject);
        this.running = true;
    }
开发者ID:hughrogers,项目名称:RPGQuest,代码行数:25,代码来源:CameraEventMover.cs


示例5: MoveTo

    static void MoveTo(GameObject target, Vector3[] nodes, float time, EaseType easyType, bool firstNode, 
		string updateFuncName, string complateFuncName, GameObject funcTarget, object param)
    {
        if( null != target &&
            firstNode &&
            null != nodes &&
            nodes.Length > 0 )
        {
            target.transform.localPosition = nodes[0];
        }

        Hashtable args = iTween.Hash("path", nodes, "time", time, "easetype", easyType.ToString());
        if(null != updateFuncName)
        {
            args["onupdate"] = updateFuncName;
            if(null != param)
            {
                args["onupdateparams"] = param;
            }
            if(null != funcTarget) args["onupdatetarget"] = funcTarget;
        }
        if(null != complateFuncName)
        {
            args["oncomplete"] = complateFuncName;
            if(null != param)
            {
                args["oncompleteparams"] = param;
            }
            if(null != funcTarget) args["oncompletetarget"] = funcTarget;
        }

        iTween.MoveTo(target, args);
    }
开发者ID:hismile06jf,项目名称:sgqy8,代码行数:33,代码来源:iTweenExt.cs


示例6: draw

    protected override void draw()
    {
        background(bgCol);

        fill(col);
        ellipse(pos.x, pos.y, 40, 40);

        fill(0, 255, 0);
        textSize(20);
        textAlign(LEFT, TOP);

        int fade = (int)fadeTween.Value;
        text("fade : " + fade, 20, 30);
        text("col  : " + col, 20, 60);

        text("ease : " + easeType, 20, 150);
        text("pos  : Vector3" + pos, 20, 180);

        if(button("Prev Ease", 20, 110, 150, 30)) {
            easeType = (EaseType)((int)easeType - 1);
            if((int)easeType < 0) { easeType = (EaseType)(EaseType.Max - 1); }
        } else if(button("Next Ease", 180, 110, 150, 30)) {
            easeType = (EaseType)( ((int)easeType + 1) % (int)EaseType.Max );
        } else if(mouseReleased) {
            removeTween(posTween);
            posTween = tween(this, "pos", pos, new Vector3(mouseX, mouseY, 0.0f), 0.25f, easeFuncs[(int)easeType]);
        }

        if(fade > 0) {
            beginNoRecycle();
            fill(0, 0, 60, fade);
            rect(0, 0, width, height);
            endRecycle();
        }
    }
开发者ID:nryota,项目名称:uProcessing,代码行数:35,代码来源:Tweens.cs


示例7: BlinkCurrent

    public IEnumerator BlinkCurrent(bool fc, bool fa, float ae, bool fr, float re,
			bool fg, float ge, bool fb, float be, EaseType et, float t)
    {
        this.Clear();

        this.fadeChildren = fc;
        this.fadeAlpha = fa;
        this.alphaEnd = ae;
        this.fadeRed = fr;
        this.redEnd = re;
        this.fadeGreen = fg;
        this.greenEnd = ge;
        this.fadeBlue = fb;
        this.blueEnd = be;
        this.interpolate = Interpolate.Ease(et);
        this.time = 0;
        this.time2 = t;

        this.Store();

        yield return null;
        this.useCurrent = true;
        this.fading = true;
        this.flash = true;
        this.blink = true;
    }
开发者ID:hughrogers,项目名称:RPGQuest,代码行数:26,代码来源:EventFader.cs


示例8: AMPlugMaterial

 protected AMPlugMaterial(Material mat, string prop, object end, EaseType p_easeType, bool p_isRelative)
     : base(end, p_easeType, p_isRelative)
 {
     ignoreAccessor = true;
     mMat = mat;
     mPropId = Shader.PropertyToID(prop);
 }
开发者ID:Ryrumeli,项目名称:MateAnimator,代码行数:7,代码来源:AMPlugMaterial.cs


示例9: FadeOut

 public void FadeOut(float t, EaseType type)
 {
     this.fadeIn = false;
     this.time = 0;
     this.time2 = t;
     this.interpolate = Interpolate.Ease(type);
     this.fadeOut = true;
 }
开发者ID:hughrogers,项目名称:RPGQuest,代码行数:8,代码来源:MusicClip.cs


示例10: ColorFade

	public static IEnumerator ColorFade(Renderer renderer, Color start, Color end, float duration, EaseType easeType) {

		float t = 0f;
		while (t < 1f) {
			t += Time.deltaTime * (1f / duration);
			renderer.material.color = Color.Lerp (start, end, Ease (t, easeType));
			yield return null;
		}
	}
开发者ID:oatssss,项目名称:McGill-Once-McGill-Twice,代码行数:9,代码来源:Fade.cs


示例11: Factor

		/// <summary>
		/// Provides an easing factor for the given animation progress.
		/// </summary>
		/// <param name="progress"> The fractional progress of the animation (from 0 to 1). </param>
		/// <param name="type"> The type of easing to perform. </param>
		/// <param name="direction"> The direction of the animation. </param>
		/// <returns> The factor to use in the animation. </returns>
		public static double Factor(double progress, EaseType type, EaseDirection direction)
		{
			if (direction == EaseDirection.In)
				return InFactor(progress, type);
			else if (direction == EaseDirection.Out)
				return OutFactor(progress, type);
			else
				return InOutFactor(progress, type);
		}
开发者ID:erisonliang,项目名称:monoworks,代码行数:16,代码来源:Ease.cs


示例12: MoveTo

    public static IEnumerator MoveTo(this MonoBehaviour v, EaseType easeType, float duration, Vector3 to)
    {
        Vector3 from = v.transform.localPosition;

        var ease = new EaseRunner(easeType, duration);
        while (ease.IsPlaying()) {
            v.transform.localPosition = Vector3.Lerp(from, to, ease.Run());
            yield return new WaitForEndOfFrame();
        }
    }
开发者ID:newkkd,项目名称:unityboot,代码行数:10,代码来源:TweenExtensions.cs


示例13: AlphaTo

    public static IEnumerator AlphaTo(this UIPanel v, EaseType easeType, float duration, float to)
    {
        float from = v.alpha;

        var ease = new EaseRunner(easeType, duration);
        while (ease.IsPlaying()) {
            v.alpha = Mathf.Lerp(from, to, ease.Run());
            yield return new WaitForEndOfFrame();
        }
    }
开发者ID:newkkd,项目名称:unityboot,代码行数:10,代码来源:TweenExtensions.cs


示例14: ColorTo

    public static IEnumerator ColorTo(this UIWidget v, EaseType easeType, float duration, Color to)
    {
        Color from = v.color;

        var ease = new EaseRunner(easeType, duration);
        while (ease.IsPlaying()) {
            v.color = Color.Lerp(from, to, ease.Run());
            yield return new WaitForEndOfFrame();
        }
    }
开发者ID:newkkd,项目名称:unityboot,代码行数:10,代码来源:TweenExtensions.cs


示例15: AlphaFade

	public static IEnumerator AlphaFade (Renderer renderer, float start, float end, float duration, EaseType easeType) {

		float t = 0f;
		while (t < 1f) {
			t += Time.deltaTime * (1f / duration);
			float newAlpha = Mathf.Lerp (start, end, Ease(t, easeType));
			renderer.material.color = new Color (renderer.material.color.r, renderer.material.color.g, renderer.material.color.b, newAlpha);
			yield return null;
		}
	}
开发者ID:oatssss,项目名称:McGill-Once-McGill-Twice,代码行数:10,代码来源:Fade.cs


示例16: SimpleTweener

    public SimpleTweener(float startValue, float endValue, float time, EaseType ease)
    {
        StartValue = startValue;
        EndValue = endValue;
        Time = time;
        Ease = ease;

        invTime = 1/Time;
        CurrentValue = StartValue;

        getEasingFunction();
    }
开发者ID:darktable,项目名称:unite-12,代码行数:12,代码来源:SimpleTweener.cs


示例17: Ease

	public static float Ease (float t, EaseType easeType) {

		switch (easeType) {
			case EaseType.None:
				return t;
			case EaseType.In:
				return Mathf.Lerp(0f, 1f, 1f - Mathf.Cos(t * Mathf.PI * 0.5f));
			case EaseType.Out:
				return Mathf.Lerp(0f, 1f, Mathf.Sin(t * Mathf.PI * 0.5f));
			default:
				return Mathf.SmoothStep(0f, 1f, t);
		}
	}
开发者ID:oatssss,项目名称:McGill-Once-McGill-Twice,代码行数:13,代码来源:Fade.cs


示例18: InFactor

		/// <summary>
		/// Provides an ease-in factor for the given animation progress.
		/// </summary>
		/// <param name="progress"> The fractional progress of the animation (from 0 to 1). </param>
		/// <param name="type"> The type of easing to perform. </param>
		/// <returns> The factor to use in the animation. </returns>
		public static double InFactor(double progress, EaseType type)
		{
			switch (type)
			{
			case EaseType.Linear:
				return progress;
			case EaseType.Quadratic:
				return progress * progress;
			case EaseType.Cubic:
				return progress * progress * progress;
			}
			throw new NotImplementedException("Don't know how to ease in for " + type.ToString());
		}
开发者ID:erisonliang,项目名称:monoworks,代码行数:19,代码来源:Ease.cs


示例19: UIColorFade

    public static IEnumerator UIColorFade(CanvasRenderer renderer, Color start, Color end, float duration, EaseType easeType, Action callback) {

		float t = 0f;
		while (t < 1f) {
			t += Time.deltaTime * (1f / duration);
			renderer.SetColor (Color.Lerp (start, end, Ease (t, easeType)));
			yield return null;
		}

        if (callback != null)
        {
            callback();
        }
	}
开发者ID:oatssss,项目名称:McGill-Once-McGill-Twice,代码行数:14,代码来源:Fade.cs


示例20: GetEasingFunction

	// ease function -----------------------------------------------------
	public static EasingFunction GetEasingFunction(EaseType easeType)
	{
		switch (easeType)
		{
			case EaseType.easeInQuad:		return new EasingFunction(easeInQuad);
			case EaseType.easeOutQuad:		return new EasingFunction(easeOutQuad);
			case EaseType.easeInOutQuad:	return new EasingFunction(easeInOutQuad);
			case EaseType.easeInCubic:		return new EasingFunction(easeInCubic);
			case EaseType.easeOutCubic:		return new EasingFunction(easeOutCubic);
			case EaseType.easeInOutCubic:	return new EasingFunction(easeInOutCubic);
			case EaseType.easeInQuart:		return new EasingFunction(easeInQuart);
			case EaseType.easeOutQuart:		return new EasingFunction(easeOutQuart);
			case EaseType.easeInOutQuart:	return new EasingFunction(easeInOutQuart);
			case EaseType.easeInQuint:		return new EasingFunction(easeInQuint);
			case EaseType.easeOutQuint:		return new EasingFunction(easeOutQuint);
			case EaseType.easeInOutQuint:	return new EasingFunction(easeInOutQuint);
			case EaseType.easeInSine:		return new EasingFunction(easeInSine);
			case EaseType.easeOutSine:		return new EasingFunction(easeOutSine);
			case EaseType.easeInOutSine:	return new EasingFunction(easeInOutSine);
			case EaseType.easeInExpo:		return new EasingFunction(easeInExpo);
			case EaseType.easeOutExpo:		return new EasingFunction(easeOutExpo);
			case EaseType.easeInOutExpo:	return new EasingFunction(easeInOutExpo);
			case EaseType.easeInCirc:		return new EasingFunction(easeInCirc);
			case EaseType.easeOutCirc:		return new EasingFunction(easeOutCirc);
			case EaseType.easeInOutCirc:	return new EasingFunction(easeInOutCirc);
			case EaseType.linear:			return new EasingFunction(linear);
			case EaseType.spring:			return new EasingFunction(spring);
			/* GFX47 MOD START */
			/*case EaseType.bounce:
				return new EasingFunction(bounce);
				break;*/
			case EaseType.easeInBounce:		return new EasingFunction(easeInBounce);
			case EaseType.easeOutBounce:	return new EasingFunction(easeOutBounce);
			case EaseType.easeInOutBounce:	return new EasingFunction(easeInOutBounce);
			/* GFX47 MOD END */
			case EaseType.easeInBack:		return new EasingFunction(easeInBack);
			case EaseType.easeOutBack:		return new EasingFunction(easeOutBack);
			case EaseType.easeInOutBack:	return new EasingFunction(easeInOutBack);
			/* GFX47 MOD START */
			/*case EaseType.elastic:
				return new EasingFunction(elastic);
				break;*/
			case EaseType.easeInElastic:	return new EasingFunction(easeInElastic);
			case EaseType.easeOutElastic:	return new EasingFunction(easeOutElastic);
			case EaseType.easeInOutElastic:	return new EasingFunction(easeInOutElastic);
			/* GFX47 MOD END */
		}
		return null;
	}
开发者ID:Kinderril,项目名称:p3,代码行数:50,代码来源:NgMath.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Easing类代码示例发布时间:2022-05-24
下一篇:
C# Ease类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap