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


C# EasingFunction类代码示例

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


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

示例1: Awake

 void Awake()
 {
     if(tweenTarget == null) tweenTarget = this.gameObject;
     this.m_fStartTime = Time.realtimeSinceStartup;
     this.m_cImage = tweenTarget.GetComponent<Image>();
     this.m_delEase = GetEasingFunction(easeType);
 }
开发者ID:dotlive,项目名称:Unity3DuGUI-Toolkit,代码行数:7,代码来源:UI_TweenColor.cs

示例2: AlphaFunction

 private static IEnumerator<bool> AlphaFunction(MultiAdditionalCoroutineSprite sp, int time, double alpha, EasingFunction easing)
 {
     var sa = sp.Alpha;
     for (int i = 0; i < time; i++)
     {
         sp.Alpha = easing(i, time, sa, alpha - sa);
         yield return true;
     }
     sp.Alpha = alpha;
 }
开发者ID:kb10uy,项目名称:Kbtter4,代码行数:10,代码来源:SpritePatterns.cs

示例3: Awake

 void Awake()
 {
     if(tweenTarget == null) tweenTarget = this.gameObject;
     this.m_fStartTime = Time.realtimeSinceStartup;
     this.m_delEase = GetEasingFunction(easeType);
     if(fromnow)
     {
         from = tweenTarget.transform.localScale;
     }
 }
开发者ID:dotlive,项目名称:Unity3DuGUI-Toolkit,代码行数:10,代码来源:UI_TweenScale.cs

示例4: addCurve

 static void addCurve(object library, EasingFunction easingFunction, int resolution, string name)
 {
     var curvePresetLibraryType = Type.GetType("UnityEditor.CurvePresetLibrary, UnityEditor");
     var addMehtod = curvePresetLibraryType.GetMethod("Add");
     addMehtod.Invoke(library, new object[]
     {
         GenerateCurve(easingFunction, resolution),
         name
     });
 }
开发者ID:aureliendrouet,项目名称:EasingCurvePresets,代码行数:10,代码来源:CurveGenerator.cs

示例5: BlinkFunction

 private static IEnumerator<bool> BlinkFunction(MultiAdditionalCoroutineSprite sp, int time, double duraiton, EasingFunction easing)
 {
     while (true)
     {
         for (int i = 0; i < time; i++)
         {
             sp.Alpha = easing(i, time, 1, -duraiton);
             yield return true;
         }
     }
 }
开发者ID:kb10uy,项目名称:Kbtter4,代码行数:11,代码来源:SpritePatterns.cs

示例6: GetEasingFunctionFor

 private static IEasing GetEasingFunctionFor(EasingFunction easingFunction)
 {
     switch (easingFunction)
     {
         case EasingFunction.Linear:
             return new LinearEasing();
         case EasingFunction.Quadratic:
             return new QuadraticEasing();
         case EasingFunction.Discrete:
             return new DiscreteEasing();
         default:
             throw new ArgumentOutOfRangeException("easingFunction");
     }
 }
开发者ID:enliktjioe,项目名称:LudumDare24,代码行数:14,代码来源:TweenFactory.cs

示例7: AnimateEasingEquation

        public static AnimationClock AnimateEasingEquation(
            DependencyObject element,
            DependencyProperty prop,
            EasingFunction function,            
            double to,
            int durationMS)
        {
            double from = double.IsNaN((double)element.GetValue(prop)) ?
                                0 :
                                (double)element.GetValue(prop);

            AnimationTimeline timeline = GetEasingAnimation(function, EasingMode.EaseIn, from, to, durationMS);
            return Animate(element, prop, timeline, durationMS, null, null, null);
        }
开发者ID:qlestrelin,项目名称:icomierp,代码行数:14,代码来源:WPFAnimationHelper.cs

示例8: SetTransitionOff

        public void SetTransitionOff(double time, Vector2 start, Vector2 end, float dur, EasingFunction funcX, EasingFunction funcY)
        {
            startPos = start;
            targPos = end;
            currPos = startPos;
            currPosX = (double)startPos.X;
            currPosY = (double)startPos.Y;

            easeX = funcX;
            easeY = funcY;

            startTime = time;
            transDuration = dur;

            state = TransState.Off;
        }
开发者ID:NarPar,项目名称:Auction-Boxing-3rd,代码行数:16,代码来源:MenuItem.cs

示例9: customEasing

    private IEnumerator customEasing(Action cb, Vector3 to, float delay, float duration, EasingFunction function) {
        var from = isoObj.Position;
        yield return new WaitForSeconds(delay);
        float currentLerpTime = 0;

        while (currentLerpTime < duration) {
            currentLerpTime += Time.deltaTime;

            float x = (float)function(currentLerpTime);
            isoObj.Position = from + (to - from) * x;
            yield return null;
        }
        currentLerpTime = duration;
        isoObj.Position = to;

        cb();
    }
开发者ID:RuiJieW,项目名称:Spectrum-Game,代码行数:17,代码来源:AbstractIsoObjectController.cs

示例10: SetTransitionOn

        public void SetTransitionOn(double time, Vector2 start, Vector2 end, float dur, EasingFunction funcX, EasingFunction funcY)
        {
            startPos = start;
            targPos = end;
            currPos = startPos;
            currPosX = (double)startPos.X;
            currPosY = (double)startPos.Y;

            easeX = funcX;
            easeY = funcY;

            startTime = time;
            transDuration = dur;

            state = TransState.On;

            Debug.WriteLine("Item Set to transition on!");
        }
开发者ID:NarPar,项目名称:Auction-Boxing-3rd,代码行数:18,代码来源:MenuItem.cs

示例11: VerticalMove

 public static CoroutineFunction<MultiAdditionalCoroutineSprite> VerticalMove(int time, double y, EasingFunction easing)
 {
     return sp => CursorVerticalMoveFunction(sp, time, y, easing);
 }
开发者ID:kb10uy,项目名称:Kbtter4,代码行数:4,代码来源:SpritePatterns.cs

示例12: VerticalFadeOut

 public static CoroutineFunction<MultiAdditionalCoroutineSprite> VerticalFadeOut(int time, double moving, EasingFunction moveEasing, EasingFunction fadeEasing)
 {
     return sp => VerticalFadeOutFunction(sp, time, moving, moveEasing, fadeEasing);
 }
开发者ID:kb10uy,项目名称:Kbtter4,代码行数:4,代码来源:SpritePatterns.cs

示例13: SetEasingFunction

		//instantiates a cached ease equation refrence:
		protected void SetEasingFunction(){
			switch (easeType){
			case EaseType.easeInQuad:
				ease  = new EasingFunction(easeInQuad);
				break;
			case EaseType.easeOutQuad:
				ease = new EasingFunction(easeOutQuad);
				break;
			case EaseType.easeInOutQuad:
				ease = new EasingFunction(easeInOutQuad);
				break;
			case EaseType.easeInCubic:
				ease = new EasingFunction(easeInCubic);
				break;
			case EaseType.easeOutCubic:
				ease = new EasingFunction(easeOutCubic);
				break;
			case EaseType.easeInOutCubic:
				ease = new EasingFunction(easeInOutCubic);
				break;
			case EaseType.easeInQuart:
				ease = new EasingFunction(easeInQuart);
				break;
			case EaseType.easeOutQuart:
				ease = new EasingFunction(easeOutQuart);
				break;
			case EaseType.easeInOutQuart:
				ease = new EasingFunction(easeInOutQuart);
				break;
			case EaseType.easeInQuint:
				ease = new EasingFunction(easeInQuint);
				break;
			case EaseType.easeOutQuint:
				ease = new EasingFunction(easeOutQuint);
				break;
			case EaseType.easeInOutQuint:
				ease = new EasingFunction(easeInOutQuint);
				break;
			case EaseType.easeInSine:
				ease = new EasingFunction(easeInSine);
				break;
			case EaseType.easeOutSine:
				ease = new EasingFunction(easeOutSine);
				break;
			case EaseType.easeInOutSine:
				ease = new EasingFunction(easeInOutSine);
				break;
			case EaseType.easeInExpo:
				ease = new EasingFunction(easeInExpo);
				break;
			case EaseType.easeOutExpo:
				ease = new EasingFunction(easeOutExpo);
				break;
			case EaseType.easeInOutExpo:
				ease = new EasingFunction(easeInOutExpo);
				break;
			case EaseType.easeInCirc:
				ease = new EasingFunction(easeInCirc);
				break;
			case EaseType.easeOutCirc:
				ease = new EasingFunction(easeOutCirc);
				break;
			case EaseType.easeInOutCirc:
				ease = new EasingFunction(easeInOutCirc);
				break;
			case EaseType.linear:
				ease = new EasingFunction(linear);
				break;
			case EaseType.spring:
				ease = new EasingFunction(spring);
				break;
			case EaseType.bounce:
				ease = new EasingFunction(bounce);
				break;
			case EaseType.easeInBack:
				ease = new EasingFunction(easeInBack);
				break;
			case EaseType.easeOutBack:
				ease = new EasingFunction(easeOutBack);
				break;
			case EaseType.easeInOutBack:
				ease = new EasingFunction(easeInOutBack);
				break;
			case EaseType.elastic:
				ease = new EasingFunction(elastic);
				break;
			}
		}
开发者ID:shaunus84,项目名称:through-shadows,代码行数:89,代码来源:SpeechBubble.cs

示例14: AnimationKeyframeBase

 /// <summary>
 /// Initializes a new instance of the <see cref="AnimationKeyframeBase"/> class.
 /// </summary>
 /// <param name="time">The keyframe time.</param>
 /// <param name="easingFunction">The keyframe's easing function.</param>
 public AnimationKeyframeBase(TimeSpan time, EasingFunction easingFunction = null)
 {
     this.time           = time;
     this.easingFunction = easingFunction;
 }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:10,代码来源:AnimationKeyframeBase.cs

示例15: CursorMoveFunction

 private static IEnumerator<bool> CursorMoveFunction(MultiAdditionalCoroutineSprite sp, int time, double x, double y, EasingFunction easing)
 {
     var sy = sp.Y;
     var sx = sp.X;
     for (int i = 0; i < time; i++)
     {
         sp.Y = easing(i, time, sy, y - sy);
         sp.X = easing(i, time, sx, x - sx);
         yield return true;
     }
     sp.Y = y;
     sp.X = x;
 }
开发者ID:kb10uy,项目名称:Kbtter4,代码行数:13,代码来源:SpritePatterns.cs


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