|
@@ -369,7 +369,7 @@ public class ManaAnim : Regist
|
|
|
return start + delta;
|
|
|
}
|
|
|
|
|
|
- if (Math.Abs(duration) < 0.0005f)
|
|
|
+ if (duration.Equal(0))
|
|
|
{
|
|
|
return delta + start;
|
|
|
}
|
|
@@ -397,7 +397,7 @@ public class ManaAnim : Regist
|
|
|
return start + delta;
|
|
|
}
|
|
|
|
|
|
- if (Math.Abs(duration) < 0.0005f)
|
|
|
+ if (duration.Equal(0))
|
|
|
{
|
|
|
return delta + start;
|
|
|
}
|
|
@@ -558,25 +558,25 @@ public class ManaAnim : Regist
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static Zoom2D Zoom2D(Transform target, float origin, float destination, float duration, float stay, Transform targetZoom, Curve curve)
|
|
|
+ public static Zoom2D Zoom2D(Transform target, float origin, float destination, float duration, float stay, Transform zoom, Curve curve)
|
|
|
{
|
|
|
Zoom2D move;
|
|
|
|
|
|
if (ZoomDic2D.TryGetValue(target, out move))
|
|
|
{
|
|
|
- move.StartZoom(origin, destination, duration, stay, targetZoom, curve);
|
|
|
+ move.StartZoom(origin, destination, duration, stay, zoom, curve);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
move = CreateZoom2D(target);
|
|
|
|
|
|
- move.StartZoom(origin, destination, duration, stay, targetZoom, curve);
|
|
|
+ move.StartZoom(origin, destination, duration, stay, zoom, curve);
|
|
|
}
|
|
|
|
|
|
return move;
|
|
|
}
|
|
|
|
|
|
- public static Zoom2D Zoom2D(Transform target, float destination, float duration, float stay, Transform targetZoom, Curve curve)
|
|
|
+ public static Zoom2D Zoom2D(Transform target, float destination, float duration, float stay, Transform zoom, Curve curve)
|
|
|
{
|
|
|
Zoom2D move;
|
|
|
|
|
@@ -584,13 +584,13 @@ public class ManaAnim : Regist
|
|
|
|
|
|
if (ZoomDic2D.TryGetValue(target, out move))
|
|
|
{
|
|
|
- move.StartZoom(camera.orthographicSize, destination, duration, stay, targetZoom, curve);
|
|
|
+ move.StartZoom(camera.orthographicSize, destination, duration, stay, zoom, curve);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
move = CreateZoom2D(target);
|
|
|
|
|
|
- move.StartZoom(camera.orthographicSize, destination, duration, stay, targetZoom, curve);
|
|
|
+ move.StartZoom(camera.orthographicSize, destination, duration, stay, zoom, curve);
|
|
|
}
|
|
|
|
|
|
return move;
|
|
@@ -970,330 +970,6 @@ public class ManaAnim : Regist
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static TweenSr TweenConForSr(Transform target)
|
|
|
- {
|
|
|
- TweenSr tween;
|
|
|
-
|
|
|
- if (TweenSrDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ConfineForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenCG TweenConForCG(Transform target)
|
|
|
- {
|
|
|
- TweenCG tween;
|
|
|
-
|
|
|
- if (TweenCgDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ConfineForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenGra TweenConForGra(Transform target)
|
|
|
- {
|
|
|
- TweenGra tween;
|
|
|
-
|
|
|
- if (TweenGraDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ConfineForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenVec TweenConForVec(Transform target)
|
|
|
- {
|
|
|
- TweenVec tween;
|
|
|
-
|
|
|
- if (TweenVecDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ConfineForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenFont TweenConForFont(Transform target)
|
|
|
- {
|
|
|
- TweenFont tween;
|
|
|
-
|
|
|
- if (TweenFontDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ConfineForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenRect TweenConForRect(Transform target)
|
|
|
- {
|
|
|
- TweenRect tween;
|
|
|
-
|
|
|
- if (TweenRectDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ConfineForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenScale TweenConForScale(Transform target)
|
|
|
- {
|
|
|
- TweenScale tween;
|
|
|
-
|
|
|
- if (TweenScaleDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ConfineForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenAudio TweenConForAudio(Transform target)
|
|
|
- {
|
|
|
- TweenAudio tween;
|
|
|
- AudioSource audioSource = target.GetComponent<AudioSource>();
|
|
|
-
|
|
|
- if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
- {
|
|
|
- tween.ConfineForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenAudio TweenConForAudio(AudioSource audioSource)
|
|
|
- {
|
|
|
- TweenAudio tween;
|
|
|
-
|
|
|
- if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
- {
|
|
|
- tween.ConfineForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenNumber TweenConForNumber(Transform target)
|
|
|
- {
|
|
|
- TweenNumber tween;
|
|
|
-
|
|
|
- if (TweenNumberDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ConfineForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static TweenSr TweenConBacSr(Transform target)
|
|
|
- {
|
|
|
- TweenSr tween;
|
|
|
-
|
|
|
- if (TweenSrDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ConfineBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenCG TweenConBacCG(Transform target)
|
|
|
- {
|
|
|
- TweenCG tween;
|
|
|
-
|
|
|
- if (TweenCgDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ConfineBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenGra TweenConBacGra(Transform target)
|
|
|
- {
|
|
|
- TweenGra tween;
|
|
|
-
|
|
|
- if (TweenGraDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ConfineBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception(target.name);
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenVec TweenConBacVec(Transform target)
|
|
|
- {
|
|
|
- TweenVec tween;
|
|
|
-
|
|
|
- if (TweenVecDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ConfineBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception(target.name);
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenFont TweenConBacFont(Transform target)
|
|
|
- {
|
|
|
- TweenFont tween;
|
|
|
-
|
|
|
- if (TweenFontDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ConfineBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenRect TweenConBacRect(Transform target)
|
|
|
- {
|
|
|
- TweenRect tween;
|
|
|
-
|
|
|
- if (TweenRectDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ConfineBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenScale TweenConBacScale(Transform target)
|
|
|
- {
|
|
|
- TweenScale tween;
|
|
|
-
|
|
|
- if (TweenScaleDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ConfineBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenAudio TweenConBacAudio(Transform target)
|
|
|
- {
|
|
|
- TweenAudio tween;
|
|
|
- AudioSource audioSource = target.GetComponent<AudioSource>();
|
|
|
-
|
|
|
- if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
- {
|
|
|
- tween.ConfineBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenAudio TweenConBacAudio(AudioSource audioSource)
|
|
|
- {
|
|
|
- TweenAudio tween;
|
|
|
-
|
|
|
- if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
- {
|
|
|
- tween.ConfineBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenNumber TweenConBacNumber(Transform target)
|
|
|
- {
|
|
|
- TweenNumber tween;
|
|
|
-
|
|
|
- if (TweenNumberDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ConfineBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
public static TweenSr TweenReForSr(Transform target)
|
|
|
{
|
|
|
TweenSr tween;
|
|
@@ -1653,7 +1329,7 @@ public class ManaAnim : Regist
|
|
|
|
|
|
#region 获取动画
|
|
|
|
|
|
- public static float GetTimerVec3(Vector3 value, float duration, Vector3 start, Vector3 delta, Curve curve)
|
|
|
+ public static float GetTimerVec(Vector3 value, float duration, Vector3 start, Vector3 delta, Curve curve)
|
|
|
{
|
|
|
if (!delta.x.Equal(0))
|
|
|
{
|
|
@@ -1680,19 +1356,19 @@ public class ManaAnim : Regist
|
|
|
|
|
|
public static float GetTimerColor(Color value, float duration, Color start, Color delta, Curve curve)
|
|
|
{
|
|
|
- if (Math.Abs(delta.r) > 0.0005f)
|
|
|
+ if (!delta.r.Equal(0))
|
|
|
{
|
|
|
return TimerFunctionDic[curve](value.r, duration, start.r, delta.r);
|
|
|
}
|
|
|
- else if (Math.Abs(delta.g) > 0.0005f)
|
|
|
+ else if (!delta.g.Equal(0))
|
|
|
{
|
|
|
return TimerFunctionDic[curve](value.g, duration, start.g, delta.g);
|
|
|
}
|
|
|
- else if (Math.Abs(delta.b) > 0.0005f)
|
|
|
+ else if (!delta.b.Equal(0))
|
|
|
{
|
|
|
return TimerFunctionDic[curve](value.b, duration, start.b, delta.b);
|
|
|
}
|
|
|
- else if (Math.Abs(delta.a) > 0.0005f)
|
|
|
+ else if (!delta.a.Equal(0))
|
|
|
{
|
|
|
return TimerFunctionDic[curve](value.a, duration, start.a, delta.a);
|
|
|
}
|
|
@@ -2060,7 +1736,7 @@ public class ManaAnim : Regist
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static TweenSr CreateTweenSr(Transform target, float originAlpha, float destinationAlpha, float duration, bool originActive, bool destActive, Curve curve, bool cg = false, bool group = false)
|
|
|
+ public static TweenSr CreateTweenSr(Transform target, float originAlpha, float destAlpha, float duration, bool originActive, bool destActive, Curve curve, bool cg = false, bool group = false)
|
|
|
{
|
|
|
TweenSr tweenSr;
|
|
|
SpriteRenderer sr = target.GetComponent<SpriteRenderer>();
|
|
@@ -2069,7 +1745,7 @@ public class ManaAnim : Regist
|
|
|
Color destination = sr.color;
|
|
|
|
|
|
origin.a = originAlpha;
|
|
|
- destination.a = destinationAlpha;
|
|
|
+ destination.a = destAlpha;
|
|
|
|
|
|
if (TweenSrDic.ContainsKey(target))
|
|
|
{
|
|
@@ -2089,14 +1765,14 @@ public class ManaAnim : Regist
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static TweenSr CreateTweenSr(Transform target, float destinationAlpha, float duration, bool originActive, bool destActive, Curve curve, bool cg = false, bool group = false)
|
|
|
+ public static TweenSr CreateTweenSr(Transform target, float destAlpha, float duration, bool originActive, bool destActive, Curve curve, bool cg = false, bool group = false)
|
|
|
{
|
|
|
TweenSr tweenSr;
|
|
|
SpriteRenderer sr = target.GetComponent<SpriteRenderer>();
|
|
|
|
|
|
Color destination = sr.color;
|
|
|
|
|
|
- destination.a = destinationAlpha;
|
|
|
+ destination.a = destAlpha;
|
|
|
|
|
|
if (TweenSrDic.ContainsKey(target))
|
|
|
{
|
|
@@ -2210,7 +1886,7 @@ public class ManaAnim : Regist
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static TweenGra CreateTweenGra(Transform target, float originAlpha, float destinationAlpha, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ public static TweenGra CreateTweenGra(Transform target, float originAlpha, float destAlpha, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
{
|
|
|
Graphic graphic = target.GetComponent<Graphic>();
|
|
|
TweenGra tweenGra;
|
|
@@ -2219,7 +1895,7 @@ public class ManaAnim : Regist
|
|
|
Color destination = graphic.color;
|
|
|
|
|
|
origin.a = originAlpha;
|
|
|
- destination.a = destinationAlpha;
|
|
|
+ destination.a = destAlpha;
|
|
|
|
|
|
if (TweenGraDic.ContainsKey(target))
|
|
|
{
|
|
@@ -2239,14 +1915,14 @@ public class ManaAnim : Regist
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static TweenGra CreateTweenGra(Transform target, float destinationAlpha, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ public static TweenGra CreateTweenGra(Transform target, float destAlpha, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
{
|
|
|
Graphic graphic = target.GetComponent<Graphic>();
|
|
|
TweenGra tweenGra;
|
|
|
|
|
|
Color destination = graphic.color;
|
|
|
|
|
|
- destination.a = destinationAlpha;
|
|
|
+ destination.a = destAlpha;
|
|
|
|
|
|
if (TweenGraDic.ContainsKey(target))
|
|
|
{
|
|
@@ -2611,6 +2287,57 @@ public class ManaAnim : Regist
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public static TweenScale CreateTweenScale(Transform target, float origin, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ Vector3 destScale = new Vector3(destination, destination, destination);
|
|
|
+ Vector3 originScale = new Vector3(origin, origin, origin);
|
|
|
+
|
|
|
+
|
|
|
+ TweenScale tweenScale;
|
|
|
+
|
|
|
+ if (TweenScaleDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenScale = TweenScaleDic[target];
|
|
|
+
|
|
|
+ TweenScaleDic[target] = new TweenScale(target, originScale, destScale, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return tweenScale;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenScale = new TweenScale(target, originScale, destScale, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenScaleDic.Add(target, tweenScale);
|
|
|
+
|
|
|
+ return tweenScale;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenScale CreateTweenScale(Transform target, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ Vector3 destScale = new Vector3(destination, destination, destination);
|
|
|
+
|
|
|
+
|
|
|
+ TweenScale tweenScale;
|
|
|
+
|
|
|
+ if (TweenScaleDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenScale = TweenScaleDic[target];
|
|
|
+
|
|
|
+ TweenScaleDic[target] = new TweenScale(target, target.localScale, destScale, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return tweenScale;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenScale = new TweenScale(target, target.localScale, destScale, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenScaleDic.Add(target, tweenScale);
|
|
|
+
|
|
|
+ return tweenScale;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public static TweenScale CreateTweenScale(Transform target, Vector3 origin, Vector3 destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
{
|
|
|
TweenScale tweenScale;
|
|
@@ -2747,7 +2474,7 @@ public class ManaAnim : Regist
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static TweenOutline CreateTweenOutline(Transform target, float originAlpha, float destinationAlpha, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ public static TweenOutline CreateTweenOutline(Transform target, float originAlpha, float destAlpha, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
{
|
|
|
Outline outline = target.GetComponent<Outline>();
|
|
|
TweenOutline tweenOutline;
|
|
@@ -2756,7 +2483,7 @@ public class ManaAnim : Regist
|
|
|
Color destination = outline.effectColor;
|
|
|
|
|
|
origin.a = originAlpha;
|
|
|
- destination.a = destinationAlpha;
|
|
|
+ destination.a = destAlpha;
|
|
|
|
|
|
if (TweenOutlineDic.ContainsKey(target))
|
|
|
{
|
|
@@ -2776,14 +2503,14 @@ public class ManaAnim : Regist
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static TweenOutline CreateTweenOutline(Transform target, float destinationAlpha, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ public static TweenOutline CreateTweenOutline(Transform target, float destAlpha, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
{
|
|
|
Outline graphic = target.GetComponent<Outline>();
|
|
|
TweenOutline tweenOutline;
|
|
|
|
|
|
Color destination = graphic.effectColor;
|
|
|
|
|
|
- destination.a = destinationAlpha;
|
|
|
+ destination.a = destAlpha;
|
|
|
|
|
|
if (TweenOutlineDic.ContainsKey(target))
|
|
|
{
|