本文整理汇总了C#中EaseType类的典型用法代码示例。如果您正苦于以下问题:C# EaseType类的具体用法?C# EaseType怎么用?C# EaseType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EaseType类属于命名空间,在下文中一共展示了EaseType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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();
}
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
}
示例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);
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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;
}
}