本文整理汇总了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);
}
示例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;
}
示例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;
}
}
示例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
});
}
示例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;
}
}
}
示例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");
}
}
示例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);
}
示例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;
}
示例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();
}
示例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!");
}
示例11: VerticalMove
public static CoroutineFunction<MultiAdditionalCoroutineSprite> VerticalMove(int time, double y, EasingFunction easing)
{
return sp => CursorVerticalMoveFunction(sp, time, y, easing);
}
示例12: VerticalFadeOut
public static CoroutineFunction<MultiAdditionalCoroutineSprite> VerticalFadeOut(int time, double moving, EasingFunction moveEasing, EasingFunction fadeEasing)
{
return sp => VerticalFadeOutFunction(sp, time, moving, moveEasing, fadeEasing);
}
示例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;
}
}
示例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;
}
示例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;
}