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

C# Easing类代码示例

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

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



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

示例1: TranslateXTo

        public static Task<bool> TranslateXTo(this VisualElement view, double x, 
                                              uint length = 250, Easing easing = null) 
        { 
            easing = easing ?? Easing.Linear; 
 	        TaskCompletionSource<bool> taskCompletionSource = new TaskCompletionSource<bool>();
            WeakReference<VisualElement> weakViewRef = new WeakReference<VisualElement>(view);

            Animation animation = new Animation(
                (value) => 
                    {
                        VisualElement viewRef;
                        if (weakViewRef.TryGetTarget(out viewRef))
                        {
                            viewRef.TranslationX = value;
                        }
                    },              // callback
                view.TranslationX,  // start
                x,                  // end
                easing);            // easing

            animation.Commit(
                view,               // owner
                "TranslateXTo",     // name
                16,                 // rate
                length,             // length
                null,               // easing 
                (finalValue, cancelled) => 
                        taskCompletionSource.SetResult(cancelled)); // finished
 			 
 	        return taskCompletionSource.Task; 
        } 
开发者ID:xia101,项目名称:xamarin-forms-book-samples,代码行数:31,代码来源:MoreViewExtensions.cs


示例2: BuildSpikes

    IEnumerator BuildSpikes()
    {
        Vector3[] verts = GetSpikes();
        int num = verts.Length;

        Easing[] easers = new Easing[num];

        for(int i = 0; i < num; i++)
        {
            easers[i] = new Easing(Easing.EaseType.Back, originalVerts[i], verts[i], 10);
        }

        yield return null;

        while(!easers[0].finished)
        {
            Vector3[] temp = new Vector3[num];

            for(int i = 0; i < num; i++)
            {
                temp[i] = easers[i].Vector3;
            }

            mesh.vertices = temp;
            mesh.RecalculateNormals();
            yield return null;
        }
        yield return null;
    }
开发者ID:GirishBala,项目名称:unity-kickstarter-vis,代码行数:29,代码来源:SpikeBall.cs


示例3: LayoutTo

		public static Task<bool> LayoutTo(this VisualElement view, Rectangle bounds, uint length = 250, Easing easing = null)
		{
			if (view == null)
				throw new ArgumentNullException("view");
			if (easing == null)
				easing = Easing.Linear;

			var tcs = new TaskCompletionSource<bool>();
			Rectangle start = view.Bounds;
			Func<double, Rectangle> computeBounds = progress =>
			{
				double x = start.X + (bounds.X - start.X) * progress;
				double y = start.Y + (bounds.Y - start.Y) * progress;
				double w = start.Width + (bounds.Width - start.Width) * progress;
				double h = start.Height + (bounds.Height - start.Height) * progress;

				return new Rectangle(x, y, w, h);
			};
			var weakView = new WeakReference<VisualElement>(view);
			Action<double> layout = f =>
			{
				VisualElement v;
				if (weakView.TryGetTarget(out v))
					v.Layout(computeBounds(f));
			};
			new Animation(layout, 0, 1, easing).Commit(view, "LayoutTo", 16, length, finished: (f, a) => tcs.SetResult(a));

			return tcs.Task;
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:29,代码来源:ViewExtensions.cs


示例4: Awake

	// Use this for initialization
	void Awake () {

		_Easing = GameObject.FindObjectOfType<Easing> ();



	}
开发者ID:wem-wem,项目名称:WonderfulShopping,代码行数:8,代码来源:ChangeFatBob.cs


示例5: _TestComposeRange

 private void _TestComposeRange (int [] values, Easing easing)
 {
     for (double i = 0, n = 100, p = 0, j = 0; i <= n; i += 5, p = i / n, j++) {
         int value = Choreographer.PixelCompose (p, (int)n, easing);
         Assert.AreEqual (values[(int)j], value);
     }
 }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:7,代码来源:ChoreographerTests.cs


示例6: TweenCreationSettings_old

 public TweenCreationSettings_old( Type type, Easing easing, float from, float to, TimeSpan duration )
 {
     From = @from ;
     To = to ;
     Type = type ;
     Easing = easing ;
     Duration = duration ;
 }
开发者ID:mtgattie,项目名称:Gleed2D,代码行数:8,代码来源:TweenCreationSettings.cs


示例7: Start

	// Use this for initialization
	void Start () {
		timer = 0;
		_easing = GameObject.FindObjectOfType<Easing>();
		_camera = GameObject.FindObjectOfType<ChangeCamera> ();
		//StartCoroutine (RandomShake(_camera.CurrentCamera));
		//StartCoroutine(SlideIn(5.0f,_camera.CurrentCamera,true));
		//StartCoroutine (R_HighFromCameraToTaget(3.0f,_camera.CurrentCamera));
	}
开发者ID:wem-wem,项目名称:WonderfulShopping,代码行数:9,代码来源:CameraAnimator.cs


示例8: ProgressTo

		public Task<bool> ProgressTo(double value, uint length, Easing easing)
		{
			var tcs = new TaskCompletionSource<bool>();

			this.Animate("Progress", d => Progress = d, Progress, value, length: length, easing: easing, finished: (d, finished) => tcs.SetResult(finished));

			return tcs.Task;
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:8,代码来源:ProgressBar.cs


示例9: Animation

		public Animation (IAnimationDrawer drawer, uint duration, Easing easing, Blocking blocking)
		{
			this.Drawer = drawer;
			this.Duration = duration;
			this.Easing = easing;
			this.Blocking = blocking;
			this.AnimationState = AnimationState.Coming;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:8,代码来源:Animation.cs


示例10: Action

 public static LNEase Action(Easing e, LNAction act)
 {
     LNEase action = new LNEase();
     action._duration = act._duration;
     action._action = act;
     act._easing = e;
     return action;
 }
开发者ID:keppelcao,项目名称:LGame,代码行数:8,代码来源:LNEase.cs


示例11: ColorAnimation

		static Task<bool> ColorAnimation(VisualElement element, string name, Func<double, Color> transform, Action<Color> callback, uint length, Easing easing)
		{
			easing = easing ?? Easing.Linear;
			var taskCompletionSource = new TaskCompletionSource<bool>();

			element.Animate<Color>(name, transform, callback, 16, length, easing, (v, c) => taskCompletionSource.SetResult(c));
			return taskCompletionSource.Task;
		}
开发者ID:RickySan65,项目名称:xamarin-forms-samples,代码行数:8,代码来源:ViewExtensions.cs


示例12: Animate

        public static ContextOperation<TimeSpan> Animate(this IGameContext context, TimeSpan duration, float startValue, float endValue, Action<float> valueStep, CancellationToken cancellationToken = default(CancellationToken), Easing easing = null)
        {
            var info = new FloatAnimation(duration, startValue, endValue, valueStep, easing);

            if (cancellationToken != default(CancellationToken))
                cancellationToken.Register(info.Cancel);

            return context.Run(info);
        }
开发者ID:powerdude,项目名称:xamarin-forms-xna,代码行数:9,代码来源:AnimationExtensions.cs


示例13: ColorTo

		public static Task<bool> ColorTo(this VisualElement self, Color fromColor, Color toColor, Action<Color> callback, uint length = 250, Easing easing = null)
		{
			Func<double, Color> transform = (t) =>
				Color.FromRgba(fromColor.R + t * (toColor.R - fromColor.R),
							   fromColor.G + t * (toColor.G - fromColor.G),
							   fromColor.B + t * (toColor.B - fromColor.B),
							   fromColor.A + t * (toColor.A - fromColor.A));
			return ColorAnimation(self, "ColorTo", transform, callback, length, easing);
		}
开发者ID:RickySan65,项目名称:xamarin-forms-samples,代码行数:9,代码来源:ViewExtensions.cs


示例14: Start

	// Use this for initialization
	void Start () {

		//どれかしらにアタッチしてある場合
		easing = GameObject.FindObjectOfType<Easing> ();
		//このスクリプトがアタッチされてるオブジェクトに
		//Easing.csがアタッチされている場合
		//easing = GetComponent<Easing>();


	}
开发者ID:wem-wem,项目名称:WonderfulShopping,代码行数:11,代码来源:EasinSample.cs


示例15: XTween

 //Tween Constructor Not Set FromValue
 public XTween(object target, string property = null, double to = 0, double duration = 0, Easing easing = Easing.EaseNoneInOut, double delay = 0)
 {
     target_ = target;
     SetProperties(property);
     ClearFrom();
     SetTo(to);
     SetDuration(duration);
     SetEasingFunction(easing);
     SetDelay(delay);
 }
开发者ID:xlune,项目名称:XTween,代码行数:11,代码来源:XTween.cs


示例16: Start

 // Use this for initialization
 void Start()
 {
     _easing = GameObject.FindObjectOfType<Easing>();
     _fade_sprite = GetComponent<SpriteRenderer>();
     doFadeIn = true;
     doFadeOut = false;
     _fade_count = 0.0f;
     _alfa_value = 0;
     _sprite_color = Color.white;
     _fade_sprite.color = _sprite_color;
 }
开发者ID:NishimakiKohei,项目名称:TVShoping,代码行数:12,代码来源:FadeInOut.cs


示例17: AnimatedWidget

        public AnimatedWidget (Widget widget, uint duration, Easing easing, Blocking blocking, bool horizontal)
        {
            this.horizontal = horizontal;
            Widget = widget;
            Duration = duration;
            Easing = easing;
            Blocking = blocking;
            AnimationState = AnimationState.Coming;

            Widget.Parent = this;
            Widget.Destroyed += OnWidgetDestroyed;
            ShowAll ();
        }
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:13,代码来源:AnimatedWidget.cs


示例18: Start

	// Use this for initialization
	void Start () {

		//アルファ値を0にして、見えない状態にしておく.
		_image_alfa = 0.0f;
		_Easing = GameObject.FindObjectOfType<Easing> ();
		foreach (var image in _fade_images) {
			image.enabled = true;
			image.color = new Color (1,1,1,_image_alfa);
		}
		_text.enabled = true;
		_text.color =  new Color (1,1,1,_image_alfa);

	}
开发者ID:wem-wem,项目名称:WonderfulShopping,代码行数:14,代码来源:WaitFade.cs


示例19: ChangeWaypoints

 public void ChangeWaypoints()
 {
     if (this.m_waypointIndex < this.m_cameraPosList.Count)
     {
         object arg_91_0 = this.Player.AttachedLevel.Camera;
         float arg_91_1 = 1.5f;
         Easing arg_91_2 = new Easing(Quad.EaseInOut);
         string[] array = new string[4];
         array[0] = "X";
         string[] arg_66_0 = array;
         int arg_66_1 = 1;
         float x = this.m_cameraPosList[this.m_waypointIndex].X;
         arg_66_0[arg_66_1] = x.ToString();
         array[2] = "Y";
         string[] arg_8F_0 = array;
         int arg_8F_1 = 3;
         float y = this.m_cameraPosList[this.m_waypointIndex].Y;
         arg_8F_0[arg_8F_1] = y.ToString();
         Tween.To(arg_91_0, arg_91_1, arg_91_2, array);
         object arg_10A_0 = this.Player;
         float arg_10A_1 = 1.5f;
         Easing arg_10A_2 = new Easing(Quad.EaseInOut);
         string[] array2 = new string[4];
         array2[0] = "X";
         string[] arg_DE_0 = array2;
         int arg_DE_1 = 1;
         float x2 = this.m_cameraPosList[this.m_waypointIndex].X;
         arg_DE_0[arg_DE_1] = x2.ToString();
         array2[2] = "Y";
         string[] arg_108_0 = array2;
         int arg_108_1 = 3;
         float y2 = this.m_cameraPosList[this.m_waypointIndex].Y;
         arg_108_0[arg_108_1] = y2.ToString();
         Tween.To(arg_10A_0, arg_10A_1, arg_10A_2, array2);
         this.m_waypointIndex++;
         if (this.m_waypointIndex > this.m_cameraPosList.Count - 1)
         {
             this.m_waypointIndex = 0;
             Tween.RunFunction(0f, this.Player.AttachedLevel.ScreenManager, "DisplayScreen", new object[]
             {
                 18,
                 true,
                 typeof(List<object>)
             });
             return;
         }
         Tween.RunFunction(this.m_waypointSpeed, this, "ChangeWaypoints", new object[0]);
     }
 }
开发者ID:Neojin9,项目名称:RLRedux,代码行数:49,代码来源:EndingRoomObj.cs


示例20: AnimatedWidget

		public AnimatedWidget (Widget widget, uint duration, Easing easing, Blocking blocking, bool horizontal)
		{
			Mono.TextEditor.GtkWorkarounds.FixContainerLeak (this);
			
			this.horizontal = horizontal;
			Widget = widget;
			Duration = duration;
			Easing = easing;
			Blocking = blocking;
			AnimationState = AnimationState.Coming;
			
			Widget.Parent = this;
			Widget.Destroyed += OnWidgetDestroyed;
			ShowAll ();
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:15,代码来源:AnimatedWidget.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# EasingFunction类代码示例发布时间:2022-05-24
下一篇:
C# EaseType类代码示例发布时间: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