|
@@ -31,6 +31,7 @@ public class ManaAnim : Regist
|
|
|
public static Dictionary<Curve, CurveFunctionV> FunctionDicV;
|
|
|
|
|
|
public static Dictionary<Transform, MoveVec> MoveVecDic;
|
|
|
+ public static Dictionary<Transform, TweenSr> TweenSrDic;
|
|
|
public static Dictionary<Transform, TweenCG> TweenCgDic;
|
|
|
public static Dictionary<Transform, TweenGra> TweenGraDic;
|
|
|
public static Dictionary<Transform, TweenVec> TweenVecDic;
|
|
@@ -79,6 +80,7 @@ public class ManaAnim : Regist
|
|
|
FunctionDicV = new Dictionary<Curve, CurveFunctionV>();
|
|
|
|
|
|
MoveVecDic = new Dictionary<Transform, MoveVec>();
|
|
|
+ TweenSrDic = new Dictionary<Transform, TweenSr>();
|
|
|
TweenCgDic = new Dictionary<Transform, TweenCG>();
|
|
|
TweenGraDic = new Dictionary<Transform, TweenGra>();
|
|
|
TweenVecDic = new Dictionary<Transform, TweenVec>();
|
|
@@ -167,6 +169,20 @@ public class ManaAnim : Regist
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public static void TweenForSr(Transform target)
|
|
|
+ {
|
|
|
+ TweenSr tweenSr;
|
|
|
+
|
|
|
+ if (TweenSrDic.TryGetValue(target, out tweenSr))
|
|
|
+ {
|
|
|
+ tweenSr.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public static void TweenForCG(Transform target)
|
|
|
{
|
|
|
TweenCG tweenCG;
|
|
@@ -252,6 +268,20 @@ public class ManaAnim : Regist
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public static void TweenBacSr(Transform target)
|
|
|
+ {
|
|
|
+ TweenSr tweenSr;
|
|
|
+
|
|
|
+ if (TweenSrDic.TryGetValue(target, out tweenSr))
|
|
|
+ {
|
|
|
+ tweenSr.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public static void TweenBacCG(Transform target)
|
|
|
{
|
|
|
TweenCG tweenCG;
|
|
@@ -336,6 +366,204 @@ public class ManaAnim : Regist
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public static void TweenConForSr(Transform target)
|
|
|
+ {
|
|
|
+ TweenSr tweenSr;
|
|
|
+
|
|
|
+ if (TweenSrDic.TryGetValue(target, out tweenSr))
|
|
|
+ {
|
|
|
+ tweenSr.ConfineForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void TweenConForCG(Transform target)
|
|
|
+ {
|
|
|
+ TweenCG tweenCG;
|
|
|
+
|
|
|
+ if (TweenCgDic.TryGetValue(target, out tweenCG))
|
|
|
+ {
|
|
|
+ tweenCG.ConfineForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void TweenConForGra(Transform target)
|
|
|
+ {
|
|
|
+ TweenGra tweenGra;
|
|
|
+
|
|
|
+ if (TweenGraDic.TryGetValue(target, out tweenGra))
|
|
|
+ {
|
|
|
+ tweenGra.ConfineForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void TweenConForVec(Transform target)
|
|
|
+ {
|
|
|
+ TweenVec tweenVec;
|
|
|
+
|
|
|
+ if (TweenVecDic.TryGetValue(target, out tweenVec))
|
|
|
+ {
|
|
|
+ tweenVec.ConfineForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void TweenConForRect(Transform target)
|
|
|
+ {
|
|
|
+ TweenRect tweenRect;
|
|
|
+
|
|
|
+ if (TweenRectDic.TryGetValue(target, out tweenRect))
|
|
|
+ {
|
|
|
+ tweenRect.ConfineForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void TweenConForScale(Transform target)
|
|
|
+ {
|
|
|
+ TweenScale tweenScale;
|
|
|
+
|
|
|
+ if (TweenScaleDic.TryGetValue(target, out tweenScale))
|
|
|
+ {
|
|
|
+ tweenScale.ConfineForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void TweenConForAudio(Transform target)
|
|
|
+ {
|
|
|
+ TweenAudio tween;
|
|
|
+
|
|
|
+ if (TweenAudioDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ConfineForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static void TweenConBacSr(Transform target)
|
|
|
+ {
|
|
|
+ TweenSr tweenSr;
|
|
|
+
|
|
|
+ if (TweenSrDic.TryGetValue(target, out tweenSr))
|
|
|
+ {
|
|
|
+ tweenSr.ConfineBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void TweenConBacCG(Transform target)
|
|
|
+ {
|
|
|
+ TweenCG tweenCG;
|
|
|
+
|
|
|
+ if (TweenCgDic.TryGetValue(target, out tweenCG))
|
|
|
+ {
|
|
|
+ tweenCG.ConfineBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void TweenConBacGra(Transform target)
|
|
|
+ {
|
|
|
+ TweenGra tweenGra;
|
|
|
+
|
|
|
+ if (TweenGraDic.TryGetValue(target, out tweenGra))
|
|
|
+ {
|
|
|
+ tweenGra.ConfineBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception(target.name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void TweenConBacVec(Transform target)
|
|
|
+ {
|
|
|
+ TweenVec tweenVec;
|
|
|
+
|
|
|
+ if (TweenVecDic.TryGetValue(target, out tweenVec))
|
|
|
+ {
|
|
|
+ tweenVec.ConfineBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception(target.name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void TweenConBacRect(Transform target)
|
|
|
+ {
|
|
|
+ TweenRect tweenRect;
|
|
|
+
|
|
|
+ if (TweenRectDic.TryGetValue(target, out tweenRect))
|
|
|
+ {
|
|
|
+ tweenRect.ConfineBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void TweenConBacScale(Transform target)
|
|
|
+ {
|
|
|
+ TweenScale tweenScale;
|
|
|
+
|
|
|
+ if (TweenScaleDic.TryGetValue(target, out tweenScale))
|
|
|
+ {
|
|
|
+ tweenScale.ConfineBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void TweenConBacAudio(Transform target)
|
|
|
+ {
|
|
|
+ TweenAudio tween;
|
|
|
+
|
|
|
+ if (TweenAudioDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ConfineBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 得到动画
|
|
@@ -355,6 +583,21 @@ public class ManaAnim : Regist
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public static TweenSr GetTweenSr(Transform target)
|
|
|
+ {
|
|
|
+ TweenSr tweenSr;
|
|
|
+
|
|
|
+ if (TweenSrDic.TryGetValue(target, out tweenSr))
|
|
|
+ {
|
|
|
+ return tweenSr;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public static TweenCG GetTweenCG(Transform target)
|
|
|
{
|
|
|
TweenCG tweenCG;
|
|
@@ -464,6 +707,55 @@ public class ManaAnim : Regist
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public static TweenSr CreateTweenSr(Transform target, Color origin, Color destination, float duration, bool originActive, bool destActive, Curve curve)
|
|
|
+ {
|
|
|
+ if (TweenSrDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ SpriteRenderer sr = target.GetComponent<SpriteRenderer>();
|
|
|
+
|
|
|
+ TweenSr tween = TweenSrDic[target];
|
|
|
+
|
|
|
+ tween = new TweenSr(sr, origin, destination, duration, originActive, destActive, curve);
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ SpriteRenderer sr = target.GetComponent<SpriteRenderer>();
|
|
|
+
|
|
|
+ TweenSr tween = new TweenSr(sr, origin, destination, duration, originActive, destActive, curve);
|
|
|
+
|
|
|
+ TweenSrDic.Add(target, tween);
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenSr CreateTweenSr(Transform target, Color destination, float duration, bool originActive, bool destActive, Curve curve)
|
|
|
+ {
|
|
|
+ if (TweenSrDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ SpriteRenderer sr = target.GetComponent<SpriteRenderer>();
|
|
|
+
|
|
|
+ TweenSr tween = TweenSrDic[target];
|
|
|
+
|
|
|
+ tween = new TweenSr(sr, sr.color, destination, duration, originActive, destActive, curve);
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ SpriteRenderer sr = target.GetComponent<SpriteRenderer>();
|
|
|
+
|
|
|
+ TweenSr tween = new TweenSr(sr, sr.color, destination, duration, originActive, destActive, curve);
|
|
|
+
|
|
|
+ TweenSrDic.Add(target, tween);
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public static TweenCG CreateTweenCG(Transform target, float origin, float destination, float duration, bool originActive, bool destActive, Curve curve)
|
|
|
{
|
|
|
if (TweenCgDic.ContainsKey(target))
|