|
@@ -61,10 +61,23 @@ public class MaterialUnit
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void SetColor(Color value)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < PropertyList.Count; i++)
|
|
|
+ {
|
|
|
+ Material.SetColor(PropertyList[i], value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public float GetFloat()
|
|
|
{
|
|
|
return Material.GetFloat(PropertyList[0]);
|
|
|
}
|
|
|
+
|
|
|
+ public Color GetColor()
|
|
|
+ {
|
|
|
+ return Material.GetColor(PropertyList[0]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public class ManaAnim : Regist
|
|
@@ -99,8 +112,10 @@ public class ManaAnim : Regist
|
|
|
public static Dictionary<Transform, TweenScale> TweenScaleDic = new Dictionary<Transform, TweenScale>();
|
|
|
public static Dictionary<Transform, TweenOutline> TweenOutlineDic = new Dictionary<Transform, TweenOutline>();
|
|
|
public static Dictionary<Transform, TweenNumber> TweenNumberDic = new Dictionary<Transform, TweenNumber>();
|
|
|
+ public static Dictionary<Renderer, TweenRenderer> TweenRendererDic = new Dictionary<Renderer, TweenRenderer>();
|
|
|
public static Dictionary<AudioSource, TweenAudio> TweenAudioDic = new Dictionary<AudioSource, TweenAudio>();
|
|
|
|
|
|
+ public static Dictionary<MaterialUnit, TweenMatColor> TweenMatColorDic = new Dictionary<MaterialUnit, TweenMatColor>();
|
|
|
public static Dictionary<MaterialUnit, TweenMatFloat> TweenMatFloatDic = new Dictionary<MaterialUnit, TweenMatFloat>();
|
|
|
|
|
|
public static Dictionary<Transform, StreamScale> StreamScaleDic = new Dictionary<Transform, StreamScale>();
|
|
@@ -704,6 +719,22 @@ public class ManaAnim : Regist
|
|
|
return tween;
|
|
|
}
|
|
|
|
|
|
+ public static TweenRenderer TweenForRenderer(Renderer target)
|
|
|
+ {
|
|
|
+ TweenRenderer tween;
|
|
|
+
|
|
|
+ if (TweenRendererDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
public static TweenCG TweenForCG(Transform target)
|
|
|
{
|
|
|
TweenCG tween;
|
|
@@ -897,6 +928,22 @@ public class ManaAnim : Regist
|
|
|
return tween;
|
|
|
}
|
|
|
|
|
|
+ public static TweenMatColor TweenForMatColor(MaterialUnit target)
|
|
|
+ {
|
|
|
+ TweenMatColor tween;
|
|
|
+
|
|
|
+ if (TweenMatColorDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public static TweenSr TweenBacSr(Transform target)
|
|
|
{
|
|
@@ -914,6 +961,22 @@ public class ManaAnim : Regist
|
|
|
return tween;
|
|
|
}
|
|
|
|
|
|
+ public static TweenRenderer TweenBacRenderer(Renderer target)
|
|
|
+ {
|
|
|
+ TweenRenderer tween;
|
|
|
+
|
|
|
+ if (TweenRendererDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
public static TweenCG TweenBacCG(Transform target)
|
|
|
{
|
|
|
TweenCG tween;
|
|
@@ -1107,6 +1170,22 @@ public class ManaAnim : Regist
|
|
|
return tween;
|
|
|
}
|
|
|
|
|
|
+ public static TweenMatColor TweenBacMatColor(MaterialUnit target)
|
|
|
+ {
|
|
|
+ TweenMatColor tween;
|
|
|
+
|
|
|
+ if (TweenMatColorDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public static TweenSr TweenReForSr(Transform target)
|
|
|
{
|
|
@@ -1124,6 +1203,22 @@ public class ManaAnim : Regist
|
|
|
return tween;
|
|
|
}
|
|
|
|
|
|
+ public static TweenRenderer TweenReForRenderer(Renderer target)
|
|
|
+ {
|
|
|
+ TweenRenderer tween;
|
|
|
+
|
|
|
+ if (TweenRendererDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
public static TweenCG TweenReForCG(Transform target)
|
|
|
{
|
|
|
TweenCG tween;
|
|
@@ -1317,6 +1412,22 @@ public class ManaAnim : Regist
|
|
|
return tween;
|
|
|
}
|
|
|
|
|
|
+ public static TweenMatColor TweenReForMatColor(MaterialUnit target)
|
|
|
+ {
|
|
|
+ TweenMatColor tween;
|
|
|
+
|
|
|
+ if (TweenMatColorDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public static TweenSr TweenReBacSr(Transform target)
|
|
|
{
|
|
@@ -1334,6 +1445,22 @@ public class ManaAnim : Regist
|
|
|
return tween;
|
|
|
}
|
|
|
|
|
|
+ public static TweenRenderer TweenReBacRenderer(Renderer target)
|
|
|
+ {
|
|
|
+ TweenRenderer tween;
|
|
|
+
|
|
|
+ if (TweenRendererDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
public static TweenCG TweenReBacCG(Transform target)
|
|
|
{
|
|
|
TweenCG tween;
|
|
@@ -1527,6 +1654,22 @@ public class ManaAnim : Regist
|
|
|
return tween;
|
|
|
}
|
|
|
|
|
|
+ public static TweenMatColor TweenReBacMatColor(MaterialUnit target)
|
|
|
+ {
|
|
|
+ TweenMatColor tween;
|
|
|
+
|
|
|
+ if (TweenMatColorDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 获取动画
|
|
@@ -1667,6 +1810,20 @@ public class ManaAnim : Regist
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public static TweenRenderer GetTweenRenderer(Renderer target)
|
|
|
+ {
|
|
|
+ TweenRenderer tween;
|
|
|
+
|
|
|
+ if (TweenRendererDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public static TweenCG GetTweenCG(Transform target)
|
|
|
{
|
|
|
TweenCG tween;
|
|
@@ -1836,6 +1993,20 @@ public class ManaAnim : Regist
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public static TweenMatColor GetTweenMatColor(MaterialUnit target)
|
|
|
+ {
|
|
|
+ TweenMatColor tween;
|
|
|
+
|
|
|
+ if (TweenMatColorDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 创建动画
|
|
@@ -2087,7 +2258,118 @@ public class ManaAnim : Regist
|
|
|
return tweenSr;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ public static TweenRenderer CreateTweenRenderer(Renderer target, float originAlpha, float destAlpha, float duration, bool originActive, bool destActive, Curve curve, bool cg = false, bool group = false)
|
|
|
+ {
|
|
|
+ TweenRenderer tweenSr;
|
|
|
+ Renderer sr = target.GetComponent<Renderer>();
|
|
|
+
|
|
|
+ Color origin = sr.material.GetColor("_Color");
|
|
|
+ Color destination = sr.material.GetColor("_Color");
|
|
|
+
|
|
|
+ origin.a = originAlpha;
|
|
|
+ destination.a = destAlpha;
|
|
|
+
|
|
|
+ if (TweenRendererDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenSr = TweenRendererDic[target];
|
|
|
+
|
|
|
+ tweenSr.Pause();
|
|
|
+
|
|
|
+ TweenRendererDic[target] = new TweenRenderer(sr, origin, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+
|
|
|
+ return TweenRendererDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenSr = new TweenRenderer(sr, origin, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+
|
|
|
+ TweenRendererDic.Add(target, tweenSr);
|
|
|
+
|
|
|
+ return tweenSr;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenRenderer CreateTweenRenderer(Renderer target, float destAlpha, float duration, bool originActive, bool destActive, Curve curve, bool cg = false, bool group = false)
|
|
|
+ {
|
|
|
+ TweenRenderer tweenSr;
|
|
|
+ Renderer sr = target.GetComponent<Renderer>();
|
|
|
+
|
|
|
+ Color destination = sr.material.GetColor("_Color");
|
|
|
+
|
|
|
+ destination.a = destAlpha;
|
|
|
+
|
|
|
+ if (TweenRendererDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenSr = TweenRendererDic[target];
|
|
|
+
|
|
|
+ tweenSr.Pause();
|
|
|
+
|
|
|
+ TweenRendererDic[target] = new TweenRenderer(sr, sr.material.GetColor("_Color"), destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+
|
|
|
+ return TweenRendererDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenSr = new TweenRenderer(sr, sr.material.GetColor("_Color"), destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+
|
|
|
+ TweenRendererDic.Add(target, tweenSr);
|
|
|
+
|
|
|
+ return tweenSr;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenRenderer CreateTweenRenderer(Renderer target, Color origin, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false, bool group = false)
|
|
|
+ {
|
|
|
+ TweenRenderer tweenSr;
|
|
|
+ Renderer sr = target.GetComponent<Renderer>();
|
|
|
+
|
|
|
+ if (TweenRendererDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenSr = TweenRendererDic[target];
|
|
|
+
|
|
|
+ tweenSr.Pause();
|
|
|
+
|
|
|
+ TweenRendererDic[target] = new TweenRenderer(sr, origin, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+
|
|
|
+ return TweenRendererDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenSr = new TweenRenderer(sr, origin, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+
|
|
|
+ TweenRendererDic.Add(target, tweenSr);
|
|
|
+
|
|
|
+ return tweenSr;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenRenderer CreateTweenRenderer(Renderer target, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false, bool group = false)
|
|
|
+ {
|
|
|
+ TweenRenderer tweenSr;
|
|
|
+ Renderer sr = target.GetComponent<Renderer>();
|
|
|
+
|
|
|
+ if (TweenRendererDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenSr = TweenRendererDic[target];
|
|
|
+
|
|
|
+ tweenSr.Pause();
|
|
|
+
|
|
|
+ TweenRendererDic[target] = new TweenRenderer(sr, sr.material.GetColor("_Color"), destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+
|
|
|
+ return TweenRendererDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenSr = new TweenRenderer(sr, sr.material.GetColor("_Color"), destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+
|
|
|
+ TweenRendererDic.Add(target, tweenSr);
|
|
|
+
|
|
|
+ return tweenSr;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public static TweenCG CreateTweenCG(Transform target, float origin, float destination, float duration, bool originActive, bool destActive, Curve curve)
|
|
|
{
|
|
@@ -2994,6 +3276,54 @@ public class ManaAnim : Regist
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public static TweenMatColor CreateTweenMatColor(MaterialUnit target, Color origin, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenMatColor tweenMatColor;
|
|
|
+
|
|
|
+ if (TweenMatColorDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenMatColor = TweenMatColorDic[target];
|
|
|
+
|
|
|
+ tweenMatColor.Pause();
|
|
|
+
|
|
|
+ TweenMatColorDic[target] = new TweenMatColor(target, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenMatColorDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenMatColor = new TweenMatColor(target, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenMatColorDic.Add(target, tweenMatColor);
|
|
|
+
|
|
|
+ return tweenMatColor;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenMatColor CreateTweenMatColor(MaterialUnit target, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenMatColor tweenMatColor;
|
|
|
+
|
|
|
+ if (TweenMatColorDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenMatColor = TweenMatColorDic[target];
|
|
|
+
|
|
|
+ tweenMatColor.Pause();
|
|
|
+
|
|
|
+ TweenMatColorDic[target] = new TweenMatColor(target, target.GetColor(), destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenMatColorDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenMatColor = new TweenMatColor(target, target.GetColor(), destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenMatColorDic.Add(target, tweenMatColor);
|
|
|
+
|
|
|
+ return tweenMatColor;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public static TweenMatFloat CreateTweenMatFloat(MaterialUnit target, float origin, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
{
|
|
|
TweenMatFloat tweenMatFloat;
|