|
@@ -1,3448 +1,3448 @@
|
|
|
-using UnityEngine;
|
|
|
-using UnityEngine.UI;
|
|
|
-using UnityEngine.Events;
|
|
|
-
|
|
|
-using System;
|
|
|
-using System.Collections;
|
|
|
-using System.Collections.Generic;
|
|
|
-
|
|
|
-public enum Curve
|
|
|
-{
|
|
|
- Linear,
|
|
|
- EaseOutQuad,
|
|
|
-}
|
|
|
-
|
|
|
-public enum EventType
|
|
|
-{
|
|
|
- ForwardStart,
|
|
|
- BackwardStart,
|
|
|
- ForwardFinish,
|
|
|
- BackwardFinish,
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-public delegate float TimerFunction(float value, float duration, float start, float delta);
|
|
|
-
|
|
|
-
|
|
|
-public delegate float ShakeFunctionF(float timer, float duration, int repeat, float start, float strength);
|
|
|
-
|
|
|
-public delegate Color ShakeFunctionC(float timer, float duration, int repeat, Color start, Color strength);
|
|
|
-
|
|
|
-public delegate Vector3 ShakeFunctionV(float timer, float duration, int repeat, Vector3 start, Vector3 strength);
|
|
|
-
|
|
|
-
|
|
|
-public delegate float CurveFunctionF(float timer, float duration, float start, float delta);
|
|
|
-
|
|
|
-public delegate Color CurveFunctionC(float timer, float duration, Color start, Color delta);
|
|
|
-
|
|
|
-public delegate Vector3 CurveFunctionV(float timer, float duration, Vector3 start, Vector3 delta);
|
|
|
-
|
|
|
-
|
|
|
-public class MaterialUnit
|
|
|
-{
|
|
|
- public Material Material;
|
|
|
- public Transform Transform;
|
|
|
-
|
|
|
- public List<string> PropertyList;
|
|
|
-
|
|
|
- public MaterialUnit(Material material, Transform transform, List<string> propertyList)
|
|
|
- {
|
|
|
- Material = material;
|
|
|
- Transform = transform;
|
|
|
- PropertyList = propertyList;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public void SetFloat(float value)
|
|
|
- {
|
|
|
- for (int i = 0; i < PropertyList.Count; i++)
|
|
|
- {
|
|
|
- Material.SetFloat(PropertyList[i], value);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- 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 AnimManager : Regist
|
|
|
-{
|
|
|
- #region 变量
|
|
|
-
|
|
|
- public static List<MoveRoot> MoveForList = new List<MoveRoot>();
|
|
|
- public static List<MoveRoot> MoveBacList = new List<MoveRoot>();
|
|
|
-
|
|
|
- public static Dictionary<Curve, TimerFunction> TimerFunctionDic = new Dictionary<Curve, TimerFunction>();
|
|
|
-
|
|
|
- public static Dictionary<Curve, ShakeFunctionF> ShakeFuncDicF = new Dictionary<Curve, ShakeFunctionF>();
|
|
|
- public static Dictionary<Curve, ShakeFunctionC> ShakeFuncDicC = new Dictionary<Curve, ShakeFunctionC>();
|
|
|
- public static Dictionary<Curve, ShakeFunctionV> ShakeFuncDicV = new Dictionary<Curve, ShakeFunctionV>();
|
|
|
-
|
|
|
- public static Dictionary<Curve, CurveFunctionF> CurveFuncDicF = new Dictionary<Curve, CurveFunctionF>();
|
|
|
- public static Dictionary<Curve, CurveFunctionC> CurveFuncDicC = new Dictionary<Curve, CurveFunctionC>();
|
|
|
- public static Dictionary<Curve, CurveFunctionV> CurveFuncDicV = new Dictionary<Curve, CurveFunctionV>();
|
|
|
-
|
|
|
- public static Dictionary<Transform, Shake> ShakeDic = new Dictionary<Transform, Shake>();
|
|
|
- public static Dictionary<Transform, Move2D> MoveDic2D = new Dictionary<Transform, Move2D>();
|
|
|
- public static Dictionary<Transform, Move3D> MoveDic3D = new Dictionary<Transform, Move3D>();
|
|
|
- public static Dictionary<Transform, Zoom2D> ZoomDic2D = new Dictionary<Transform, Zoom2D>();
|
|
|
-
|
|
|
- public static Dictionary<Transform, TweenSr> TweenSrDic = new Dictionary<Transform, TweenSr>();
|
|
|
- public static Dictionary<Transform, TweenCG> TweenCgDic = new Dictionary<Transform, TweenCG>();
|
|
|
- public static Dictionary<Transform, TweenGra> TweenGraDic = new Dictionary<Transform, TweenGra>();
|
|
|
- public static Dictionary<Transform, TweenVec> TweenVecDic = new Dictionary<Transform, TweenVec>();
|
|
|
- public static Dictionary<Transform, TweenEuler> TweenEulerDic = new Dictionary<Transform, TweenEuler>();
|
|
|
- public static Dictionary<Transform, TweenFont> TweenFontDic = new Dictionary<Transform, TweenFont>();
|
|
|
- public static Dictionary<Transform, TweenRect> TweenRectDic = new Dictionary<Transform, TweenRect>();
|
|
|
- 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<MeshFilter, TweenGrayMesh> TweenGrayMeshDic = new Dictionary<MeshFilter, TweenGrayMesh>();
|
|
|
-
|
|
|
- public static Dictionary<Transform, StreamScale> StreamScaleDic = new Dictionary<Transform, StreamScale>();
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
- public void Update()
|
|
|
- {
|
|
|
- for (int i = 0; i < MoveForList.Count; i++)
|
|
|
- {
|
|
|
- MoveRoot move = MoveForList[i];
|
|
|
-
|
|
|
- if (move.DoForward())
|
|
|
- {
|
|
|
- if (MoveForList.Remove(move))
|
|
|
- {
|
|
|
- i--;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- for (int i = 0; i < MoveBacList.Count; i++)
|
|
|
- {
|
|
|
- MoveRoot move = MoveBacList[i];
|
|
|
-
|
|
|
- if (move.DoBackward())
|
|
|
- {
|
|
|
- if (MoveBacList.Remove(move))
|
|
|
- {
|
|
|
- i--;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public override bool InitAtOnce()
|
|
|
- {
|
|
|
- if (base.InitAtOnce())
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- TimerFunctionDic.Add(Curve.Linear, LinearTimer);
|
|
|
- TimerFunctionDic.Add(Curve.EaseOutQuad, EaseOutQuadTimer);
|
|
|
-
|
|
|
- ShakeFuncDicF.Add(Curve.Linear, ShakeLinear);
|
|
|
- ShakeFuncDicF.Add(Curve.EaseOutQuad, ShakeEaseOutQuad);
|
|
|
-
|
|
|
- ShakeFuncDicC.Add(Curve.Linear, ShakeLinear);
|
|
|
- ShakeFuncDicC.Add(Curve.EaseOutQuad, ShakeEaseOutQuad);
|
|
|
-
|
|
|
- ShakeFuncDicV.Add(Curve.Linear, ShakeLinear);
|
|
|
- ShakeFuncDicV.Add(Curve.EaseOutQuad, ShakeEaseOutQuad);
|
|
|
-
|
|
|
- CurveFuncDicF.Add(Curve.Linear, Linear);
|
|
|
- CurveFuncDicF.Add(Curve.EaseOutQuad, EaseOutQuad);
|
|
|
-
|
|
|
- CurveFuncDicC.Add(Curve.Linear, Linear);
|
|
|
- CurveFuncDicC.Add(Curve.EaseOutQuad, EaseOutQuad);
|
|
|
-
|
|
|
- CurveFuncDicV.Add(Curve.Linear, Linear);
|
|
|
- CurveFuncDicV.Add(Curve.EaseOutQuad, EaseOutQuad);
|
|
|
-
|
|
|
- enabled = true;
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- #region 曲线
|
|
|
-
|
|
|
- public static float LinearTimer(float value, float duration, float start, float delta)
|
|
|
- {
|
|
|
- return (value - start)*duration/delta;
|
|
|
- }
|
|
|
-
|
|
|
- public static float EaseOutQuadTimer(float value, float duration, float start, float delta)
|
|
|
- {
|
|
|
- return ((2 - Mathf.Sqrt(4 - 4*(value - start)/delta))/2)*duration;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static float ShakeLinear(float timer, float duration, int repeat, float start, float strength)
|
|
|
- {
|
|
|
- float sliceTime = duration/(4*repeat);
|
|
|
-
|
|
|
- for (int i = 0; i < repeat*4; i += 4)
|
|
|
- {
|
|
|
- if (timer > duration)
|
|
|
- {
|
|
|
- return start;
|
|
|
- }
|
|
|
-
|
|
|
- if (timer <= (i + 1)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i)*sliceTime;
|
|
|
-
|
|
|
- return Linear(timer, sliceTime, start, strength/(i/4 + 1));
|
|
|
- }
|
|
|
- else if (timer <= (i + 3)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i + 1)*sliceTime;
|
|
|
-
|
|
|
- return Linear(timer, 2*sliceTime, start + strength/(i/4 + 1), -2*strength/(i/4 + 1));
|
|
|
- }
|
|
|
- else if (timer <= (i + 4)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i + 3)*sliceTime;
|
|
|
-
|
|
|
- return Linear(timer, sliceTime, start - strength/(i/4 + 1), strength/(i/4 + 1));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- public static Color ShakeLinear(float timer, float duration, int repeat, Color start, Color strength)
|
|
|
- {
|
|
|
- float sliceTime = duration/(4*repeat);
|
|
|
-
|
|
|
- for (int i = 0; i < repeat*4; i += 4)
|
|
|
- {
|
|
|
- if (timer > duration)
|
|
|
- {
|
|
|
- return start;
|
|
|
- }
|
|
|
-
|
|
|
- if (timer <= (i + 1)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i)*sliceTime;
|
|
|
-
|
|
|
- return Linear(timer, sliceTime, start, strength/(i/4 + 1));
|
|
|
- }
|
|
|
- else if (timer <= (i + 3)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i + 1)*sliceTime;
|
|
|
-
|
|
|
- return Linear(timer, 2*sliceTime, start + strength/(i/4 + 1), -2*strength/(i/4 + 1));
|
|
|
- }
|
|
|
- else if (timer <= (i + 4)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i + 3)*sliceTime;
|
|
|
-
|
|
|
- return Linear(timer, sliceTime, start - strength/(i/4 + 1), strength/(i/4 + 1));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- public static Vector3 ShakeLinear(float timer, float duration, int repeat, Vector3 start, Vector3 strength)
|
|
|
- {
|
|
|
- float sliceTime = duration/(4*repeat);
|
|
|
-
|
|
|
- for (int i = 0; i < repeat*4; i += 4)
|
|
|
- {
|
|
|
- if (timer > duration)
|
|
|
- {
|
|
|
- return start;
|
|
|
- }
|
|
|
-
|
|
|
- if (timer <= (i + 1)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i)*sliceTime;
|
|
|
-
|
|
|
- return Linear(timer, sliceTime, start, strength/(i/4 + 1));
|
|
|
- }
|
|
|
- else if (timer <= (i + 3)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i + 1)*sliceTime;
|
|
|
-
|
|
|
- return Linear(timer, 2*sliceTime, start + strength/(i/4 + 1), -2*strength/(i/4 + 1));
|
|
|
- }
|
|
|
- else if (timer <= (i + 4)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i + 3)*sliceTime;
|
|
|
-
|
|
|
- return Linear(timer, sliceTime, start - strength/(i/4 + 1), strength/(i/4 + 1));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static float ShakeEaseOutQuad(float timer, float duration, int repeat, float start, float strength)
|
|
|
- {
|
|
|
- float sliceTime = duration/(4*repeat);
|
|
|
-
|
|
|
- for (int i = 0; i < repeat*4; i += 4)
|
|
|
- {
|
|
|
- if (timer > duration)
|
|
|
- {
|
|
|
- return start;
|
|
|
- }
|
|
|
-
|
|
|
- if (timer <= (i + 1)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i)*sliceTime;
|
|
|
-
|
|
|
- return EaseOutQuad(timer, sliceTime, start, strength/(i/4 + 1));
|
|
|
- }
|
|
|
- else if (timer <= (i + 3)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i + 1)*sliceTime;
|
|
|
-
|
|
|
- return EaseOutQuad(timer, 2*sliceTime, start + strength/(i/4 + 1), -2*strength/(i/4 + 1));
|
|
|
- }
|
|
|
- else if (timer <= (i + 4)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i + 3)*sliceTime;
|
|
|
-
|
|
|
- return EaseOutQuad(timer, sliceTime, start - strength/(i/4 + 1), strength/(i/4 + 1));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- public static Color ShakeEaseOutQuad(float timer, float duration, int repeat, Color start, Color strength)
|
|
|
- {
|
|
|
- float sliceTime = duration/(4*repeat);
|
|
|
-
|
|
|
- for (int i = 0; i < repeat*4; i += 4)
|
|
|
- {
|
|
|
- if (timer > duration)
|
|
|
- {
|
|
|
- return start;
|
|
|
- }
|
|
|
-
|
|
|
- if (timer <= (i + 1)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i)*sliceTime;
|
|
|
-
|
|
|
- return EaseOutQuad(timer, sliceTime, start, strength/(i/4 + 1));
|
|
|
- }
|
|
|
- else if (timer <= (i + 3)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i + 1)*sliceTime;
|
|
|
-
|
|
|
- return EaseOutQuad(timer, 2*sliceTime, start + strength/(i/4 + 1), -2*strength/(i/4 + 1));
|
|
|
- }
|
|
|
- else if (timer <= (i + 4)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i + 3)*sliceTime;
|
|
|
-
|
|
|
- return EaseOutQuad(timer, sliceTime, start - strength/(i/4 + 1), strength/(i/4 + 1));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- public static Vector3 ShakeEaseOutQuad(float timer, float duration, int repeat, Vector3 start, Vector3 strength)
|
|
|
- {
|
|
|
- float sliceTime = duration/(4*repeat);
|
|
|
-
|
|
|
- for (int i = 0; i < repeat*4; i += 4)
|
|
|
- {
|
|
|
- if (timer > duration)
|
|
|
- {
|
|
|
- return start;
|
|
|
- }
|
|
|
-
|
|
|
- if (timer <= (i + 1)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i)*sliceTime;
|
|
|
-
|
|
|
- return EaseOutQuad(timer, sliceTime, start, strength/(i/4 + 1));
|
|
|
- }
|
|
|
- else if (timer <= (i + 3)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i + 1)*sliceTime;
|
|
|
-
|
|
|
- return EaseOutQuad(timer, 2*sliceTime, start + strength/(i/4 + 1), -2*strength/(i/4 + 1));
|
|
|
- }
|
|
|
- else if (timer <= (i + 4)*sliceTime)
|
|
|
- {
|
|
|
- timer -= (i + 3)*sliceTime;
|
|
|
-
|
|
|
- return EaseOutQuad(timer, sliceTime, start - strength/(i/4 + 1), strength/(i/4 + 1));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static float Linear(float timer, float duration, float start, float delta)
|
|
|
- {
|
|
|
- if (timer >= duration)
|
|
|
- {
|
|
|
- return start + delta;
|
|
|
- }
|
|
|
-
|
|
|
- if (duration.Equal(0))
|
|
|
- {
|
|
|
- return delta + start;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return delta*timer/duration + start;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static Color Linear(float timer, float duration, Color start, Color delta)
|
|
|
- {
|
|
|
- return new Color(Linear(timer, duration, start.r, delta.r), Linear(timer, duration, start.g, delta.g), Linear(timer, duration, start.b, delta.b), Linear(timer, duration, start.a, delta.a));
|
|
|
- }
|
|
|
-
|
|
|
- public static Vector3 Linear(float timer, float duration, Vector3 start, Vector3 delta)
|
|
|
- {
|
|
|
- return new Vector3(Linear(timer, duration, start.x, delta.x), Linear(timer, duration, start.y, delta.y), Linear(timer, duration, start.z, delta.z));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static float EaseOutQuad(float timer, float duration, float start, float delta)
|
|
|
- {
|
|
|
- if (timer >= duration)
|
|
|
- {
|
|
|
- return start + delta;
|
|
|
- }
|
|
|
-
|
|
|
- if (duration.Equal(0))
|
|
|
- {
|
|
|
- return delta + start;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- timer /= duration;
|
|
|
-
|
|
|
- return -delta*timer*(timer - 2) + start;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static Color EaseOutQuad(float timer, float duration, Color start, Color delta)
|
|
|
- {
|
|
|
- return new Color(EaseOutQuad(timer, duration, start.r, delta.r), EaseOutQuad(timer, duration, start.g, delta.g), EaseOutQuad(timer, duration, start.b, delta.b), EaseOutQuad(timer, duration, start.a, delta.a));
|
|
|
- }
|
|
|
-
|
|
|
- public static Vector3 EaseOutQuad(float timer, float duration, Vector3 start, Vector3 delta)
|
|
|
- {
|
|
|
- return new Vector3(EaseOutQuad(timer, duration, start.x, delta.x), EaseOutQuad(timer, duration, start.y, delta.y), EaseOutQuad(timer, duration, start.z, delta.z));
|
|
|
- }
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 播放动画
|
|
|
-
|
|
|
- public static Shake Shake(Transform target, float duration, int repeat, Vector3 strength, Curve curve)
|
|
|
- {
|
|
|
- Shake move;
|
|
|
-
|
|
|
- if (ShakeDic.TryGetValue(target, out move))
|
|
|
- {
|
|
|
- move.StartShake(repeat, duration, strength, curve);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- move = CreateShake(target);
|
|
|
-
|
|
|
- move.StartShake(repeat, duration, strength, curve);
|
|
|
- }
|
|
|
-
|
|
|
- return move;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static Move2D Move2D(Transform target, Vector3 destination, float duration, bool local, Curve curve)
|
|
|
- {
|
|
|
- Move2D move;
|
|
|
-
|
|
|
- if (local)
|
|
|
- {
|
|
|
- destination.z = target.localPosition.z;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- destination.z = target.position.z;
|
|
|
- }
|
|
|
-
|
|
|
- if (MoveDic2D.TryGetValue(target, out move))
|
|
|
- {
|
|
|
- move.StartMove(destination, duration, local, curve);
|
|
|
-
|
|
|
- return move;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- move = CreateMove2D(target);
|
|
|
-
|
|
|
- move.StartMove(destination, duration, local, curve);
|
|
|
-
|
|
|
- return move;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static Move3D Move3D(Transform target, Vector3 destination, float duration, bool local, Curve curve)
|
|
|
- {
|
|
|
- Move3D move;
|
|
|
-
|
|
|
- if (MoveDic3D.TryGetValue(target, out move))
|
|
|
- {
|
|
|
- move.StartMove(destination, duration, local, curve);
|
|
|
-
|
|
|
- return move;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- move = CreateMove3D(target);
|
|
|
-
|
|
|
- move.StartMove(destination, duration, local, curve);
|
|
|
-
|
|
|
- return move;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static Move2D MoveOffset2D(Transform target, Vector3 offset, float duration, bool local, Curve curve)
|
|
|
- {
|
|
|
- Move2D move;
|
|
|
-
|
|
|
- Vector3 destination;
|
|
|
-
|
|
|
- if (local)
|
|
|
- {
|
|
|
- destination = target.localPosition + offset;
|
|
|
-
|
|
|
- destination.z = target.localPosition.z;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- destination = target.position + offset;
|
|
|
-
|
|
|
- destination.z = target.position.z;
|
|
|
- }
|
|
|
-
|
|
|
- if (MoveDic2D.TryGetValue(target, out move))
|
|
|
- {
|
|
|
- move.StartMove(destination, duration, local, curve);
|
|
|
-
|
|
|
- return move;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- move = CreateMove2D(target);
|
|
|
-
|
|
|
- move.StartMove(destination, duration, local, curve);
|
|
|
-
|
|
|
- return move;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static Move3D MoveOffset3D(Transform target, Vector3 offset, float duration, bool local, Curve curve)
|
|
|
- {
|
|
|
- Move3D move;
|
|
|
-
|
|
|
- Vector3 destination;
|
|
|
-
|
|
|
- if (local)
|
|
|
- {
|
|
|
- destination = target.localPosition + offset;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- destination = target.position + offset;
|
|
|
- }
|
|
|
-
|
|
|
- if (MoveDic3D.TryGetValue(target, out move))
|
|
|
- {
|
|
|
- move.StartMove(destination, duration, local, curve);
|
|
|
-
|
|
|
- return move;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- move = CreateMove3D(target);
|
|
|
-
|
|
|
- move.StartMove(destination, duration, local, curve);
|
|
|
-
|
|
|
- return move;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- 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, zoom, curve);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- move = CreateZoom2D(target);
|
|
|
-
|
|
|
- move.StartZoom(origin, destination, duration, stay, zoom, curve);
|
|
|
- }
|
|
|
-
|
|
|
- return move;
|
|
|
- }
|
|
|
-
|
|
|
- public static Zoom2D Zoom2D(Transform target, float destination, float duration, float stay, Transform zoom, Curve curve)
|
|
|
- {
|
|
|
- Zoom2D move;
|
|
|
-
|
|
|
- Camera camera = target.GetComponent<Camera>();
|
|
|
-
|
|
|
- if (ZoomDic2D.TryGetValue(target, out move))
|
|
|
- {
|
|
|
- move.StartZoom(camera.orthographicSize, destination, duration, stay, zoom, curve);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- move = CreateZoom2D(target);
|
|
|
-
|
|
|
- move.StartZoom(camera.orthographicSize, destination, duration, stay, zoom, curve);
|
|
|
- }
|
|
|
-
|
|
|
- return move;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static StreamScale StreamForScale(Transform target)
|
|
|
- {
|
|
|
- StreamScale stream;
|
|
|
-
|
|
|
- if (StreamScaleDic.TryGetValue(target, out stream))
|
|
|
- {
|
|
|
- stream.StartForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return stream;
|
|
|
- }
|
|
|
-
|
|
|
- public static StreamScale StreamBacScale(Transform target)
|
|
|
- {
|
|
|
- StreamScale stream;
|
|
|
-
|
|
|
- if (StreamScaleDic.TryGetValue(target, out stream))
|
|
|
- {
|
|
|
- stream.StartBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return stream;
|
|
|
- }
|
|
|
-
|
|
|
- public static StreamScale StreamReForScale(Transform target)
|
|
|
- {
|
|
|
- StreamScale stream;
|
|
|
-
|
|
|
- if (StreamScaleDic.TryGetValue(target, out stream))
|
|
|
- {
|
|
|
- stream.ReForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return stream;
|
|
|
- }
|
|
|
-
|
|
|
- public static StreamScale StreamReBacScale(Transform target)
|
|
|
- {
|
|
|
- StreamScale stream;
|
|
|
-
|
|
|
- if (StreamScaleDic.TryGetValue(target, out stream))
|
|
|
- {
|
|
|
- stream.ReBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return stream;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static TweenSr TweenForSr(Transform target)
|
|
|
- {
|
|
|
- TweenSr tween;
|
|
|
-
|
|
|
- if (TweenSrDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- 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;
|
|
|
-
|
|
|
- if (TweenCgDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenGra TweenForGra(Transform target)
|
|
|
- {
|
|
|
- TweenGra tween;
|
|
|
-
|
|
|
- if (TweenGraDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenEuler TweenForEuler(Transform target)
|
|
|
- {
|
|
|
- TweenEuler tween;
|
|
|
-
|
|
|
- if (TweenEulerDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenVec TweenForVec(Transform target)
|
|
|
- {
|
|
|
- TweenVec tween;
|
|
|
-
|
|
|
- if (TweenVecDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenFont TweenForFont(Transform target)
|
|
|
- {
|
|
|
- TweenFont tween;
|
|
|
-
|
|
|
- if (TweenFontDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenRect TweenForRect(Transform target)
|
|
|
- {
|
|
|
- TweenRect tween;
|
|
|
-
|
|
|
- if (TweenRectDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenScale TweenForScale(Transform target)
|
|
|
- {
|
|
|
- TweenScale tween;
|
|
|
-
|
|
|
- if (TweenScaleDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenAudio TweenForAudio(Transform target)
|
|
|
- {
|
|
|
- TweenAudio tween;
|
|
|
- AudioSource audioSource = target.GetComponent<AudioSource>();
|
|
|
-
|
|
|
- if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
- {
|
|
|
- tween.StartForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenAudio TweenForAudio(AudioSource audioSource)
|
|
|
- {
|
|
|
- TweenAudio tween;
|
|
|
-
|
|
|
- if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
- {
|
|
|
- tween.StartForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenOutline TweenForOutline(Transform target)
|
|
|
- {
|
|
|
- TweenOutline tween;
|
|
|
-
|
|
|
- if (TweenOutlineDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenNumber TweenForNumber(Transform target)
|
|
|
- {
|
|
|
- TweenNumber tween;
|
|
|
-
|
|
|
- if (TweenNumberDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenMatFloat TweenForMatFloat(MaterialUnit target)
|
|
|
- {
|
|
|
- TweenMatFloat tween;
|
|
|
-
|
|
|
- if (TweenMatFloatDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- 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 TweenGrayMesh TweenForGrayMesh(MeshFilter target)
|
|
|
- {
|
|
|
- TweenGrayMesh tween;
|
|
|
-
|
|
|
- if (TweenGrayMeshDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static TweenSr TweenBacSr(Transform target)
|
|
|
- {
|
|
|
- TweenSr tween;
|
|
|
-
|
|
|
- if (TweenSrDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- 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;
|
|
|
-
|
|
|
- if (TweenCgDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenGra TweenBacGra(Transform target)
|
|
|
- {
|
|
|
- TweenGra tween;
|
|
|
-
|
|
|
- if (TweenGraDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception(target.name);
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenVec TweenBacVec(Transform target)
|
|
|
- {
|
|
|
- TweenVec tween;
|
|
|
-
|
|
|
- if (TweenVecDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception(target.name);
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenEuler TweenBacEuler(Transform target)
|
|
|
- {
|
|
|
- TweenEuler tween;
|
|
|
-
|
|
|
- if (TweenEulerDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception(target.name);
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenFont TweenBacFont(Transform target)
|
|
|
- {
|
|
|
- TweenFont tween;
|
|
|
-
|
|
|
- if (TweenFontDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenRect TweenBacRect(Transform target)
|
|
|
- {
|
|
|
- TweenRect tween;
|
|
|
-
|
|
|
- if (TweenRectDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenScale TweenBacScale(Transform target)
|
|
|
- {
|
|
|
- TweenScale tween;
|
|
|
-
|
|
|
- if (TweenScaleDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenAudio TweenBacAudio(Transform target)
|
|
|
- {
|
|
|
- TweenAudio tween;
|
|
|
- AudioSource audioSource = target.GetComponent<AudioSource>();
|
|
|
-
|
|
|
- if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
- {
|
|
|
- tween.StartBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenAudio TweenBacAudio(AudioSource audioSource)
|
|
|
- {
|
|
|
- TweenAudio tween;
|
|
|
-
|
|
|
- if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
- {
|
|
|
- tween.StartBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenOutline TweenBacOutline(Transform target)
|
|
|
- {
|
|
|
- TweenOutline tween;
|
|
|
-
|
|
|
- if (TweenOutlineDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenNumber TweenBacNumber(Transform target)
|
|
|
- {
|
|
|
- TweenNumber tween;
|
|
|
-
|
|
|
- if (TweenNumberDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenMatFloat TweenBacMatFloat(MaterialUnit target)
|
|
|
- {
|
|
|
- TweenMatFloat tween;
|
|
|
-
|
|
|
- if (TweenMatFloatDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- 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 TweenGrayMesh TweenBacGrayMesh(MeshFilter target)
|
|
|
- {
|
|
|
- TweenGrayMesh tween;
|
|
|
-
|
|
|
- if (TweenGrayMeshDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.StartBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static TweenSr TweenReForSr(Transform target)
|
|
|
- {
|
|
|
- TweenSr tween;
|
|
|
-
|
|
|
- if (TweenSrDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- 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;
|
|
|
-
|
|
|
- if (TweenCgDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenGra TweenReForGra(Transform target)
|
|
|
- {
|
|
|
- TweenGra tween;
|
|
|
-
|
|
|
- if (TweenGraDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenVec TweenReForVec(Transform target)
|
|
|
- {
|
|
|
- TweenVec tween;
|
|
|
-
|
|
|
- if (TweenVecDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenEuler TweenReForEuler(Transform target)
|
|
|
- {
|
|
|
- TweenEuler tween;
|
|
|
-
|
|
|
- if (TweenEulerDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenFont TweenReForFont(Transform target)
|
|
|
- {
|
|
|
- TweenFont tween;
|
|
|
-
|
|
|
- if (TweenFontDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenRect TweenReForRect(Transform target)
|
|
|
- {
|
|
|
- TweenRect tween;
|
|
|
-
|
|
|
- if (TweenRectDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenScale TweenReForScale(Transform target)
|
|
|
- {
|
|
|
- TweenScale tween;
|
|
|
-
|
|
|
- if (TweenScaleDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenAudio TweenReForAudio(Transform target)
|
|
|
- {
|
|
|
- TweenAudio tween;
|
|
|
- AudioSource audioSource = target.GetComponent<AudioSource>();
|
|
|
-
|
|
|
- if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
- {
|
|
|
- tween.ReForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenAudio TweenReForAudio(AudioSource audioSource)
|
|
|
- {
|
|
|
- TweenAudio tween;
|
|
|
-
|
|
|
- if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
- {
|
|
|
- tween.ReForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenOutline TweenReForOutline(Transform target)
|
|
|
- {
|
|
|
- TweenOutline tween;
|
|
|
-
|
|
|
- if (TweenOutlineDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenNumber TweenReForNumber(Transform target)
|
|
|
- {
|
|
|
- TweenNumber tween;
|
|
|
-
|
|
|
- if (TweenNumberDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenMatFloat TweenReForMatFloat(MaterialUnit target)
|
|
|
- {
|
|
|
- TweenMatFloat tween;
|
|
|
-
|
|
|
- if (TweenMatFloatDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReForward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- 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)
|
|
|
- {
|
|
|
- TweenSr tween;
|
|
|
-
|
|
|
- if (TweenSrDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- 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;
|
|
|
-
|
|
|
- if (TweenCgDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenGra TweenReBacGra(Transform target)
|
|
|
- {
|
|
|
- TweenGra tween;
|
|
|
-
|
|
|
- if (TweenGraDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception(target.name);
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenVec TweenReBacVec(Transform target)
|
|
|
- {
|
|
|
- TweenVec tween;
|
|
|
-
|
|
|
- if (TweenVecDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception(target.name);
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenEuler TweenReBacEuler(Transform target)
|
|
|
- {
|
|
|
- TweenEuler tween;
|
|
|
-
|
|
|
- if (TweenEulerDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception(target.name);
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenFont TweenReBacFont(Transform target)
|
|
|
- {
|
|
|
- TweenFont tween;
|
|
|
-
|
|
|
- if (TweenFontDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenRect TweenReBacRect(Transform target)
|
|
|
- {
|
|
|
- TweenRect tween;
|
|
|
-
|
|
|
- if (TweenRectDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenScale TweenReBacScale(Transform target)
|
|
|
- {
|
|
|
- TweenScale tween;
|
|
|
-
|
|
|
- if (TweenScaleDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenAudio TweenReBacAudio(Transform target)
|
|
|
- {
|
|
|
- TweenAudio tween;
|
|
|
- AudioSource audioSource = target.GetComponent<AudioSource>();
|
|
|
-
|
|
|
- if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
- {
|
|
|
- tween.ReBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenAudio TweenReBacAudio(AudioSource audioSource)
|
|
|
- {
|
|
|
- TweenAudio tween;
|
|
|
-
|
|
|
- if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
- {
|
|
|
- tween.ReBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenOutline TweenReBacOutline(Transform target)
|
|
|
- {
|
|
|
- TweenOutline tween;
|
|
|
-
|
|
|
- if (TweenOutlineDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenNumber TweenReBacNumber(Transform target)
|
|
|
- {
|
|
|
- TweenNumber tween;
|
|
|
-
|
|
|
- if (TweenNumberDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- return tween;
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenMatFloat TweenReBacMatFloat(MaterialUnit target)
|
|
|
- {
|
|
|
- TweenMatFloat tween;
|
|
|
-
|
|
|
- if (TweenMatFloatDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- tween.ReBackward();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
-
|
|
|
- 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 获取动画
|
|
|
-
|
|
|
- public static float GetTimerVec(Vector3 value, float duration, Vector3 start, Vector3 delta, Curve curve)
|
|
|
- {
|
|
|
- if (!delta.x.Equal(0))
|
|
|
- {
|
|
|
- return TimerFunctionDic[curve](value.x, duration, start.x, delta.x);
|
|
|
- }
|
|
|
- else if (!delta.y.Equal(0))
|
|
|
- {
|
|
|
- return TimerFunctionDic[curve](value.y, duration, start.y, delta.y);
|
|
|
- }
|
|
|
- else if (!delta.z.Equal(0))
|
|
|
- {
|
|
|
- return TimerFunctionDic[curve](value.z, duration, start.z, delta.z);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static float GetTimerFloat(float value, float duration, float start, float delta, Curve curve)
|
|
|
- {
|
|
|
- return TimerFunctionDic[curve](value, duration, start, delta);
|
|
|
- }
|
|
|
-
|
|
|
- public static float GetTimerColor(Color value, float duration, Color start, Color delta, Curve curve)
|
|
|
- {
|
|
|
- if (!delta.r.Equal(0))
|
|
|
- {
|
|
|
- return TimerFunctionDic[curve](value.r, duration, start.r, delta.r);
|
|
|
- }
|
|
|
- else if (!delta.g.Equal(0))
|
|
|
- {
|
|
|
- return TimerFunctionDic[curve](value.g, duration, start.g, delta.g);
|
|
|
- }
|
|
|
- else if (!delta.b.Equal(0))
|
|
|
- {
|
|
|
- return TimerFunctionDic[curve](value.b, duration, start.b, delta.b);
|
|
|
- }
|
|
|
- else if (!delta.a.Equal(0))
|
|
|
- {
|
|
|
- return TimerFunctionDic[curve](value.a, duration, start.a, delta.a);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static Shake GetShake(Transform target)
|
|
|
- {
|
|
|
- Shake move;
|
|
|
-
|
|
|
- if (ShakeDic.TryGetValue(target, out move))
|
|
|
- {
|
|
|
- return move;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static Move2D GetMove2D(Transform target)
|
|
|
- {
|
|
|
- Move2D move;
|
|
|
-
|
|
|
- if (MoveDic2D.TryGetValue(target, out move))
|
|
|
- {
|
|
|
- return move;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static Move3D GetMove3D(Transform target)
|
|
|
- {
|
|
|
- Move3D move;
|
|
|
-
|
|
|
- if (MoveDic3D.TryGetValue(target, out move))
|
|
|
- {
|
|
|
- return move;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static Zoom2D GetZoom2D(Transform target)
|
|
|
- {
|
|
|
- Zoom2D move;
|
|
|
-
|
|
|
- if (ZoomDic2D.TryGetValue(target, out move))
|
|
|
- {
|
|
|
- return move;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static StreamScale GetStreamScale(Transform target)
|
|
|
- {
|
|
|
- StreamScale stream;
|
|
|
-
|
|
|
- if (StreamScaleDic.TryGetValue(target, out stream))
|
|
|
- {
|
|
|
- return stream;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static TweenSr GetTweenSr(Transform target)
|
|
|
- {
|
|
|
- TweenSr tween;
|
|
|
-
|
|
|
- if (TweenSrDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- return tween;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- 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;
|
|
|
-
|
|
|
- if (TweenCgDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- return tween;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenGra GetTweenGra(Transform target)
|
|
|
- {
|
|
|
- TweenGra tween;
|
|
|
-
|
|
|
- if (TweenGraDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- return tween;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenVec GetTweenVec(Transform target)
|
|
|
- {
|
|
|
- TweenVec tween;
|
|
|
-
|
|
|
- if (TweenVecDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- return tween;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenEuler GetTweenEuler(Transform target)
|
|
|
- {
|
|
|
- TweenEuler tween;
|
|
|
-
|
|
|
- if (TweenEulerDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- return tween;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenFont GetTweenFont(Transform target)
|
|
|
- {
|
|
|
- TweenFont tween;
|
|
|
-
|
|
|
- if (TweenFontDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- return tween;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenRect GetTweenRect(Transform target)
|
|
|
- {
|
|
|
- TweenRect tween;
|
|
|
-
|
|
|
- if (TweenRectDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- return tween;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenScale GetTweenScale(Transform target)
|
|
|
- {
|
|
|
- TweenScale tween;
|
|
|
-
|
|
|
- if (TweenScaleDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- return tween;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenAudio GetTweenAudio(Transform target)
|
|
|
- {
|
|
|
- TweenAudio tween;
|
|
|
- AudioSource audioSource = target.GetComponent<AudioSource>();
|
|
|
-
|
|
|
- if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
- {
|
|
|
- return tween;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenAudio GetTweenAudio(AudioSource audioSource)
|
|
|
- {
|
|
|
- TweenAudio tween;
|
|
|
-
|
|
|
- if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
- {
|
|
|
- return tween;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenOutline GetTweenOutline(Transform target)
|
|
|
- {
|
|
|
- TweenOutline tween;
|
|
|
-
|
|
|
- if (TweenOutlineDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- return tween;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenNumber GetTweenNumber(Transform target)
|
|
|
- {
|
|
|
- TweenNumber tween;
|
|
|
-
|
|
|
- if (TweenNumberDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- return tween;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenMatFloat GetTweenMatFloat(MaterialUnit target)
|
|
|
- {
|
|
|
- TweenMatFloat tween;
|
|
|
-
|
|
|
- if (TweenMatFloatDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- return tween;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenMatColor GetTweenMatColor(MaterialUnit target)
|
|
|
- {
|
|
|
- TweenMatColor tween;
|
|
|
-
|
|
|
- if (TweenMatColorDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- return tween;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenGrayMesh GetTweenGrayMesh(MeshFilter target)
|
|
|
- {
|
|
|
- TweenGrayMesh tween;
|
|
|
-
|
|
|
- if (TweenGrayMeshDic.TryGetValue(target, out tween))
|
|
|
- {
|
|
|
- return tween;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 创建动画
|
|
|
-
|
|
|
- public static Shake CreateShake(Transform target)
|
|
|
- {
|
|
|
- if (ShakeDic.ContainsKey(target))
|
|
|
- {
|
|
|
- Shake shake = ShakeDic[target];
|
|
|
-
|
|
|
- shake.Pause();
|
|
|
-
|
|
|
- ShakeDic[target] = new Shake(target);
|
|
|
-
|
|
|
- return ShakeDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Shake shake = new Shake(target);
|
|
|
-
|
|
|
- ShakeDic.Add(target, shake);
|
|
|
-
|
|
|
- return shake;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static Move2D CreateMove2D(Transform target)
|
|
|
- {
|
|
|
- if (MoveDic2D.ContainsKey(target))
|
|
|
- {
|
|
|
- Move2D move2D = MoveDic2D[target];
|
|
|
-
|
|
|
- move2D.Pause();
|
|
|
-
|
|
|
- MoveDic2D[target] = new Move2D(target);
|
|
|
-
|
|
|
- return MoveDic2D[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Move2D move2D = new Move2D(target);
|
|
|
-
|
|
|
- MoveDic2D.Add(target, move2D);
|
|
|
-
|
|
|
- return move2D;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static Move3D CreateMove3D(Transform target)
|
|
|
- {
|
|
|
- if (MoveDic3D.ContainsKey(target))
|
|
|
- {
|
|
|
- Move3D move3D = MoveDic3D[target];
|
|
|
-
|
|
|
- move3D.Pause();
|
|
|
-
|
|
|
- MoveDic3D[target] = new Move3D(target);
|
|
|
-
|
|
|
- return MoveDic3D[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Move3D move3D = new Move3D(target);
|
|
|
-
|
|
|
- MoveDic3D.Add(target, move3D);
|
|
|
-
|
|
|
- return move3D;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static Zoom2D CreateZoom2D(Transform target)
|
|
|
- {
|
|
|
- if (ZoomDic2D.ContainsKey(target))
|
|
|
- {
|
|
|
- Zoom2D zoom2D = ZoomDic2D[target];
|
|
|
-
|
|
|
- zoom2D.Pause();
|
|
|
-
|
|
|
- ZoomDic2D[target] = new Zoom2D(target.GetComponent<Camera>());
|
|
|
-
|
|
|
- return ZoomDic2D[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Zoom2D zoom2D = new Zoom2D(target.GetComponent<Camera>());
|
|
|
-
|
|
|
- ZoomDic2D.Add(target, zoom2D);
|
|
|
-
|
|
|
- return zoom2D;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static StreamScale CreateStreamScale(Transform target, List<float> delayList, List<float> durationList, List<VecPair> destKvList, bool originActive, bool destActive, Curve curve, bool cg = false, List<UnityAction> startActionList = null, List<UnityAction> finishActionList = null)
|
|
|
- {
|
|
|
- StreamScale streamScale;
|
|
|
-
|
|
|
- if (StreamScaleDic.ContainsKey(target))
|
|
|
- {
|
|
|
- streamScale = StreamScaleDic[target];
|
|
|
-
|
|
|
- streamScale.Pause();
|
|
|
-
|
|
|
- StreamScaleDic[target] = new StreamScale(target, delayList, durationList, destKvList, originActive, destActive, curve, cg, startActionList, finishActionList);
|
|
|
-
|
|
|
- return StreamScaleDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- streamScale = new StreamScale(target, delayList, durationList, destKvList, originActive, destActive, curve, cg, startActionList, finishActionList);
|
|
|
-
|
|
|
- StreamScaleDic.Add(target, streamScale);
|
|
|
-
|
|
|
- return streamScale;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static StreamScale CreateStreamScale(Transform target, List<float> delayList, List<float> durationList, List<Vector3> destList, bool originActive, bool destActive, Curve curve, bool cg = false, List<UnityAction> startActionList = null, List<UnityAction> finishActionList = null)
|
|
|
- {
|
|
|
- StreamScale streamScale;
|
|
|
-
|
|
|
- if (StreamScaleDic.ContainsKey(target))
|
|
|
- {
|
|
|
- streamScale = StreamScaleDic[target];
|
|
|
-
|
|
|
- streamScale.Pause();
|
|
|
-
|
|
|
- StreamScaleDic[target] = new StreamScale(target, delayList, durationList, destList, originActive, destActive, curve, cg, startActionList, finishActionList);
|
|
|
-
|
|
|
- return StreamScaleDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- streamScale = new StreamScale(target, delayList, durationList, destList, originActive, destActive, curve, cg, startActionList, finishActionList);
|
|
|
-
|
|
|
- StreamScaleDic.Add(target, streamScale);
|
|
|
-
|
|
|
- return streamScale;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- 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>();
|
|
|
-
|
|
|
- Color origin = sr.color;
|
|
|
- Color destination = sr.color;
|
|
|
-
|
|
|
- origin.a = originAlpha;
|
|
|
- destination.a = destAlpha;
|
|
|
-
|
|
|
- if (TweenSrDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenSr = TweenSrDic[target];
|
|
|
-
|
|
|
- tweenSr.Pause();
|
|
|
-
|
|
|
- TweenSrDic[target] = new TweenSr(sr, origin, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
-
|
|
|
- return TweenSrDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenSr = new TweenSr(sr, origin, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
-
|
|
|
- TweenSrDic.Add(target, tweenSr);
|
|
|
-
|
|
|
- return tweenSr;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- 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 = destAlpha;
|
|
|
-
|
|
|
- if (TweenSrDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenSr = TweenSrDic[target];
|
|
|
-
|
|
|
- tweenSr.Pause();
|
|
|
-
|
|
|
- TweenSrDic[target] = new TweenSr(sr, sr.color, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
-
|
|
|
- return TweenSrDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenSr = new TweenSr(sr, sr.color, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
-
|
|
|
- TweenSrDic.Add(target, tweenSr);
|
|
|
-
|
|
|
- return tweenSr;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenSr CreateTweenSr(Transform target, Color origin, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false, bool group = false)
|
|
|
- {
|
|
|
- TweenSr tweenSr;
|
|
|
- SpriteRenderer sr = target.GetComponent<SpriteRenderer>();
|
|
|
-
|
|
|
- if (TweenSrDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenSr = TweenSrDic[target];
|
|
|
-
|
|
|
- tweenSr.Pause();
|
|
|
-
|
|
|
- TweenSrDic[target] = new TweenSr(sr, origin, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
-
|
|
|
- return TweenSrDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenSr = new TweenSr(sr, origin, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
-
|
|
|
- TweenSrDic.Add(target, tweenSr);
|
|
|
-
|
|
|
- return tweenSr;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenSr CreateTweenSr(Transform target, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false, bool group = false)
|
|
|
- {
|
|
|
- TweenSr tweenSr;
|
|
|
- SpriteRenderer sr = target.GetComponent<SpriteRenderer>();
|
|
|
-
|
|
|
- if (TweenSrDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenSr = TweenSrDic[target];
|
|
|
-
|
|
|
- tweenSr.Pause();
|
|
|
-
|
|
|
- TweenSrDic[target] = new TweenSr(sr, sr.color, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
-
|
|
|
- return TweenSrDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenSr = new TweenSr(sr, sr.color, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
-
|
|
|
- TweenSrDic.Add(target, tweenSr);
|
|
|
-
|
|
|
- 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;
|
|
|
- Color origin = target.sharedMaterial.GetColor("_Color");
|
|
|
- Color destination = target.sharedMaterial.GetColor("_Color");
|
|
|
-
|
|
|
- origin.a = originAlpha;
|
|
|
- destination.a = destAlpha;
|
|
|
-
|
|
|
- if (TweenRendererDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenSr = TweenRendererDic[target];
|
|
|
-
|
|
|
- tweenSr.Pause();
|
|
|
-
|
|
|
- TweenRendererDic[target] = new TweenRenderer(target, origin, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
- tweenSr.AlphaOnly = true;
|
|
|
- return TweenRendererDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenSr = new TweenRenderer(target, origin, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
-
|
|
|
- TweenRendererDic.Add(target, tweenSr);
|
|
|
- tweenSr.AlphaOnly = true;
|
|
|
- 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)
|
|
|
- {
|
|
|
- TweenCG tweenCg;
|
|
|
- CanvasGroup cg = target.GetComponent<CanvasGroup>();
|
|
|
-
|
|
|
- if (TweenCgDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenCg = TweenCgDic[target];
|
|
|
-
|
|
|
- tweenCg.Pause();
|
|
|
-
|
|
|
- TweenCgDic[target] = new TweenCG(cg, origin, destination, duration, originActive, destActive, curve);
|
|
|
-
|
|
|
- return TweenCgDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenCg = new TweenCG(cg, origin, destination, duration, originActive, destActive, curve);
|
|
|
-
|
|
|
- TweenCgDic.Add(target, tweenCg);
|
|
|
-
|
|
|
- return tweenCg;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenCG CreateTweenCG(Transform target, float destination, float duration, bool originActive, bool destActive, Curve curve)
|
|
|
- {
|
|
|
- TweenCG tweenCg;
|
|
|
- CanvasGroup cg = target.GetComponent<CanvasGroup>();
|
|
|
-
|
|
|
- if (TweenCgDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenCg = TweenCgDic[target];
|
|
|
-
|
|
|
- tweenCg.Pause();
|
|
|
-
|
|
|
- TweenCgDic[target] = new TweenCG(cg, cg.alpha, destination, duration, originActive, destActive, curve);
|
|
|
-
|
|
|
- return TweenCgDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenCg = new TweenCG(cg, cg.alpha, destination, duration, originActive, destActive, curve);
|
|
|
-
|
|
|
- TweenCgDic.Add(target, tweenCg);
|
|
|
-
|
|
|
- return tweenCg;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- 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;
|
|
|
-
|
|
|
- Color origin = graphic.color;
|
|
|
- Color destination = graphic.color;
|
|
|
-
|
|
|
- origin.a = originAlpha;
|
|
|
- destination.a = destAlpha;
|
|
|
-
|
|
|
- if (TweenGraDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenGra = TweenGraDic[target];
|
|
|
-
|
|
|
- tweenGra.Pause();
|
|
|
-
|
|
|
- TweenGraDic[target] = new TweenGra(graphic, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenGraDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenGra = new TweenGra(graphic, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenGraDic.Add(target, tweenGra);
|
|
|
-
|
|
|
- return tweenGra;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- 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 = destAlpha;
|
|
|
-
|
|
|
- if (TweenGraDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenGra = TweenGraDic[target];
|
|
|
-
|
|
|
- tweenGra.Pause();
|
|
|
-
|
|
|
- TweenGraDic[target] = new TweenGra(graphic, graphic.color, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenGraDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenGra = new TweenGra(graphic, graphic.color, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenGraDic.Add(target, tweenGra);
|
|
|
-
|
|
|
- return tweenGra;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenGra CreateTweenGra(Transform target, Color origin, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- Graphic graphic = target.GetComponent<Graphic>();
|
|
|
- TweenGra tweenGra;
|
|
|
-
|
|
|
- if (TweenGraDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenGra = TweenGraDic[target];
|
|
|
-
|
|
|
- tweenGra.Pause();
|
|
|
-
|
|
|
- TweenGraDic[target] = new TweenGra(graphic, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenGraDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenGra = new TweenGra(graphic, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenGraDic.Add(target, tweenGra);
|
|
|
-
|
|
|
- return tweenGra;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenGra CreateTweenGra(Transform target, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- Graphic graphic = target.GetComponent<Graphic>();
|
|
|
- TweenGra tweenGra;
|
|
|
-
|
|
|
- if (TweenGraDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenGra = TweenGraDic[target];
|
|
|
-
|
|
|
- tweenGra.Pause();
|
|
|
-
|
|
|
- TweenGraDic[target] = new TweenGra(graphic, graphic.color, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenGraDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenGra = new TweenGra(graphic, graphic.color, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenGraDic.Add(target, tweenGra);
|
|
|
-
|
|
|
- return tweenGra;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static TweenVec CreateTweenVec2D(Transform target, Vector3 origin, Vector3 destination, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- TweenVec tweenVec2D;
|
|
|
-
|
|
|
- if (local)
|
|
|
- {
|
|
|
- origin.z = target.localPosition.z;
|
|
|
- destination.z = target.localPosition.z;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- origin.z = target.position.z;
|
|
|
- destination.z = target.position.z;
|
|
|
- }
|
|
|
-
|
|
|
- if (TweenVecDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenVec2D = TweenVecDic[target];
|
|
|
-
|
|
|
- tweenVec2D.Pause();
|
|
|
-
|
|
|
- TweenVecDic[target] = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenVecDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenVec2D = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenVecDic.Add(target, tweenVec2D);
|
|
|
-
|
|
|
- return tweenVec2D;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenVec CreateTweenVec2D(Transform target, Vector3 destination, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- TweenVec tweenVec2D;
|
|
|
-
|
|
|
- Vector3 origin;
|
|
|
-
|
|
|
- if (local)
|
|
|
- {
|
|
|
- origin = target.localPosition;
|
|
|
-
|
|
|
- destination.z = target.localPosition.z;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- origin = target.position;
|
|
|
-
|
|
|
- destination.z = target.position.z;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if (TweenVecDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenVec2D = TweenVecDic[target];
|
|
|
-
|
|
|
- tweenVec2D.Pause();
|
|
|
-
|
|
|
- TweenVecDic[target] = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenVecDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenVec2D = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenVecDic.Add(target, tweenVec2D);
|
|
|
-
|
|
|
- return tweenVec2D;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenVec CreateTweenVecOffset2D(Transform target, Vector3 offset, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- TweenVec tweenVec2D;
|
|
|
-
|
|
|
- Vector3 origin;
|
|
|
- Vector3 destination;
|
|
|
-
|
|
|
- if (local)
|
|
|
- {
|
|
|
- origin = target.localPosition;
|
|
|
- destination = target.localPosition + offset;
|
|
|
-
|
|
|
- destination.z = target.localPosition.z;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- origin = target.position;
|
|
|
- destination = target.position + offset;
|
|
|
-
|
|
|
- destination.z = target.position.z;
|
|
|
- }
|
|
|
-
|
|
|
- if (TweenVecDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenVec2D = TweenVecDic[target];
|
|
|
-
|
|
|
- tweenVec2D.Pause();
|
|
|
-
|
|
|
- TweenVecDic[target] = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenVecDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenVec2D = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenVecDic.Add(target, tweenVec2D);
|
|
|
-
|
|
|
- return tweenVec2D;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static TweenVec CreateTweenVec3D(Transform target, Vector3 origin, Vector3 destination, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- TweenVec tweenVec3D;
|
|
|
-
|
|
|
- if (TweenVecDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenVec3D = TweenVecDic[target];
|
|
|
-
|
|
|
- tweenVec3D.Pause();
|
|
|
-
|
|
|
- TweenVecDic[target] = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenVecDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenVec3D = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenVecDic.Add(target, tweenVec3D);
|
|
|
-
|
|
|
- return tweenVec3D;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenVec CreateTweenVec3D(Transform target, Vector3 destination, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- TweenVec tweenVec3D;
|
|
|
-
|
|
|
- Vector3 origin;
|
|
|
-
|
|
|
- if (local)
|
|
|
- {
|
|
|
- origin = target.localPosition;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- origin = target.position;
|
|
|
- }
|
|
|
-
|
|
|
- if (TweenVecDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenVec3D = TweenVecDic[target];
|
|
|
-
|
|
|
- tweenVec3D.Pause();
|
|
|
-
|
|
|
- TweenVecDic[target] = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenVecDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenVec3D = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenVecDic.Add(target, tweenVec3D);
|
|
|
-
|
|
|
- return tweenVec3D;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenVec CreateTweenVecOffset3D(Transform target, Vector3 offset, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- TweenVec tweenVec3D;
|
|
|
-
|
|
|
- Vector3 origin;
|
|
|
- Vector3 destination;
|
|
|
-
|
|
|
- if (local)
|
|
|
- {
|
|
|
- origin = target.localPosition;
|
|
|
- destination = target.localPosition + offset;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- origin = target.position;
|
|
|
- destination = target.position + offset;
|
|
|
- }
|
|
|
-
|
|
|
- if (TweenVecDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenVec3D = TweenVecDic[target];
|
|
|
-
|
|
|
- tweenVec3D.Pause();
|
|
|
-
|
|
|
- TweenVecDic[target] = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenVecDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenVec3D = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenVecDic.Add(target, tweenVec3D);
|
|
|
-
|
|
|
- return tweenVec3D;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static TweenEuler CreateTweenEuler(Transform target, Vector3 origin, Vector3 destination, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- TweenEuler tweenEuler;
|
|
|
-
|
|
|
- if (TweenEulerDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenEuler = TweenEulerDic[target];
|
|
|
-
|
|
|
- tweenEuler.Pause();
|
|
|
-
|
|
|
- TweenEulerDic[target] = new TweenEuler(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenEulerDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenEuler = new TweenEuler(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenEulerDic.Add(target, tweenEuler);
|
|
|
-
|
|
|
- return tweenEuler;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenEuler CreateTweenEuler(Transform target, Vector3 destination, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- TweenEuler tweenEuler;
|
|
|
-
|
|
|
- Vector3 origin;
|
|
|
-
|
|
|
- if (local)
|
|
|
- {
|
|
|
- origin = target.localEulerAngles;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- origin = target.eulerAngles;
|
|
|
- }
|
|
|
-
|
|
|
- if (TweenEulerDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenEuler = TweenEulerDic[target];
|
|
|
-
|
|
|
- tweenEuler.Pause();
|
|
|
-
|
|
|
- TweenEulerDic[target] = new TweenEuler(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenEulerDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenEuler = new TweenEuler(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenEulerDic.Add(target, tweenEuler);
|
|
|
-
|
|
|
- return tweenEuler;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static TweenFont CreateTweenFont(Transform target, int origin, int destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- Text text = target.GetComponent<Text>();
|
|
|
- TweenFont tweenFont;
|
|
|
-
|
|
|
- if (TweenRectDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenFont = TweenFontDic[target];
|
|
|
-
|
|
|
- tweenFont.Pause();
|
|
|
-
|
|
|
- TweenFontDic[target] = new TweenFont(text, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenFontDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenFont = new TweenFont(text, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenFontDic.Add(target, tweenFont);
|
|
|
-
|
|
|
- return tweenFont;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenFont CreateTweenFont(Transform target, int destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- Text text = target.GetComponent<Text>();
|
|
|
- TweenFont tweenFont;
|
|
|
-
|
|
|
- if (TweenRectDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenFont = TweenFontDic[target];
|
|
|
-
|
|
|
- tweenFont.Pause();
|
|
|
-
|
|
|
- TweenFontDic[target] = new TweenFont(text, text.fontSize, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenFontDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenFont = new TweenFont(text, text.fontSize, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenFontDic.Add(target, tweenFont);
|
|
|
-
|
|
|
- return tweenFont;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static TweenRect CreateTweenRect(Transform target, Vector2 origin, Vector2 destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- TweenRect tweenRect;
|
|
|
- RectTransform rectTra = target.GetComponent<RectTransform>();
|
|
|
-
|
|
|
- if (TweenRectDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenRect = TweenRectDic[target];
|
|
|
-
|
|
|
- tweenRect.Pause();
|
|
|
-
|
|
|
- TweenRectDic[target] = new TweenRect(rectTra, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenRectDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenRect = new TweenRect(rectTra, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenRectDic.Add(target, tweenRect);
|
|
|
-
|
|
|
- return tweenRect;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenRect CreateTweenRect(Transform target, Vector2 destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- TweenRect tweenRect;
|
|
|
- RectTransform rectTra = target.GetComponent<RectTransform>();
|
|
|
-
|
|
|
- if (TweenRectDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenRect = TweenRectDic[target];
|
|
|
-
|
|
|
- tweenRect.Pause();
|
|
|
-
|
|
|
- TweenRectDic[target] = new TweenRect(rectTra, rectTra.rect.size, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenRectDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenRect = new TweenRect(rectTra, rectTra.rect.size, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenRectDic.Add(target, tweenRect);
|
|
|
-
|
|
|
- return tweenRect;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- 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];
|
|
|
-
|
|
|
- tweenScale.Pause();
|
|
|
-
|
|
|
- TweenScaleDic[target] = new TweenScale(target, originScale, destScale, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenScaleDic[target];
|
|
|
- }
|
|
|
- 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];
|
|
|
-
|
|
|
- tweenScale.Pause();
|
|
|
-
|
|
|
- TweenScaleDic[target] = new TweenScale(target, target.localScale, destScale, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenScaleDic[target];
|
|
|
- }
|
|
|
- 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;
|
|
|
-
|
|
|
- if (TweenScaleDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenScale = TweenScaleDic[target];
|
|
|
-
|
|
|
- tweenScale.Pause();
|
|
|
-
|
|
|
- TweenScaleDic[target] = new TweenScale(target, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenScaleDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenScale = new TweenScale(target, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenScaleDic.Add(target, tweenScale);
|
|
|
-
|
|
|
- return tweenScale;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenScale CreateTweenScale(Transform target, Vector3 destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- TweenScale tweenScale;
|
|
|
-
|
|
|
- if (TweenScaleDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenScale = TweenScaleDic[target];
|
|
|
-
|
|
|
- tweenScale.Pause();
|
|
|
-
|
|
|
- TweenScaleDic[target] = new TweenScale(target, target.localScale, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenScaleDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenScale = new TweenScale(target, target.localScale, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenScaleDic.Add(target, tweenScale);
|
|
|
-
|
|
|
- return tweenScale;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static TweenAudio CreateTweenAudio(Transform target, float origin, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- TweenAudio tweenAudio;
|
|
|
- AudioSource audio = target.GetComponent<AudioSource>();
|
|
|
-
|
|
|
- if (TweenAudioDic.ContainsKey(audio))
|
|
|
- {
|
|
|
- tweenAudio = TweenAudioDic[audio];
|
|
|
-
|
|
|
- tweenAudio.Pause();
|
|
|
-
|
|
|
- TweenAudioDic[audio] = new TweenAudio(audio, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenAudioDic[audio];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenAudio = new TweenAudio(audio, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenAudioDic.Add(audio, tweenAudio);
|
|
|
-
|
|
|
- return tweenAudio;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenAudio CreateTweenAudio(Transform target, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- TweenAudio tweenAudio;
|
|
|
- AudioSource audio = target.GetComponent<AudioSource>();
|
|
|
-
|
|
|
- if (TweenAudioDic.ContainsKey(audio))
|
|
|
- {
|
|
|
- tweenAudio = TweenAudioDic[audio];
|
|
|
-
|
|
|
- tweenAudio.Pause();
|
|
|
-
|
|
|
- TweenAudioDic[audio] = new TweenAudio(audio, audio.volume, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenAudioDic[audio];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenAudio = new TweenAudio(audio, audio.volume, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenAudioDic.Add(audio, tweenAudio);
|
|
|
-
|
|
|
- return tweenAudio;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenAudio CreateTweenAudio(AudioSource audioSource, float origin, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- TweenAudio tweenAudio;
|
|
|
-
|
|
|
- if (TweenAudioDic.ContainsKey(audioSource))
|
|
|
- {
|
|
|
- tweenAudio = TweenAudioDic[audioSource];
|
|
|
-
|
|
|
- tweenAudio.Pause();
|
|
|
-
|
|
|
- TweenAudioDic[audioSource] = new TweenAudio(audioSource, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenAudioDic[audioSource];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenAudio = new TweenAudio(audioSource, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenAudioDic.Add(audioSource, tweenAudio);
|
|
|
-
|
|
|
- return tweenAudio;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenAudio CreateTweenAudio(AudioSource audioSource, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- TweenAudio tweenAudio;
|
|
|
-
|
|
|
- if (TweenAudioDic.ContainsKey(audioSource))
|
|
|
- {
|
|
|
- tweenAudio = TweenAudioDic[audioSource];
|
|
|
-
|
|
|
- tweenAudio.Pause();
|
|
|
-
|
|
|
- TweenAudioDic[audioSource] = new TweenAudio(audioSource, audioSource.volume, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenAudioDic[audioSource];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenAudio = new TweenAudio(audioSource, audioSource.volume, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenAudioDic.Add(audioSource, tweenAudio);
|
|
|
-
|
|
|
- return tweenAudio;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- 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;
|
|
|
-
|
|
|
- Color origin = outline.effectColor;
|
|
|
- Color destination = outline.effectColor;
|
|
|
-
|
|
|
- origin.a = originAlpha;
|
|
|
- destination.a = destAlpha;
|
|
|
-
|
|
|
- if (TweenOutlineDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenOutline = TweenOutlineDic[target];
|
|
|
-
|
|
|
- tweenOutline.Pause();
|
|
|
-
|
|
|
- TweenOutlineDic[target] = new TweenOutline(outline, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenOutlineDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenOutline = new TweenOutline(outline, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenOutlineDic.Add(target, tweenOutline);
|
|
|
-
|
|
|
- return tweenOutline;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- 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 = destAlpha;
|
|
|
-
|
|
|
- if (TweenOutlineDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenOutline = TweenOutlineDic[target];
|
|
|
-
|
|
|
- tweenOutline.Pause();
|
|
|
-
|
|
|
- TweenOutlineDic[target] = new TweenOutline(graphic, graphic.effectColor, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenOutlineDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenOutline = new TweenOutline(graphic, graphic.effectColor, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenOutlineDic.Add(target, tweenOutline);
|
|
|
-
|
|
|
- return tweenOutline;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenOutline CreateTweenOutline(Transform target, Color origin, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- Outline outline = target.GetComponent<Outline>();
|
|
|
- TweenOutline tweenOutline;
|
|
|
-
|
|
|
- if (TweenOutlineDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenOutline = TweenOutlineDic[target];
|
|
|
-
|
|
|
- tweenOutline.Pause();
|
|
|
-
|
|
|
- TweenOutlineDic[target] = new TweenOutline(outline, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenOutlineDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenOutline = new TweenOutline(outline, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenOutlineDic.Add(target, tweenOutline);
|
|
|
-
|
|
|
- return tweenOutline;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenOutline CreateTweenOutline(Transform target, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- Outline graphic = target.GetComponent<Outline>();
|
|
|
- TweenOutline tweenOutline;
|
|
|
-
|
|
|
- if (TweenOutlineDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenOutline = TweenOutlineDic[target];
|
|
|
-
|
|
|
- tweenOutline.Pause();
|
|
|
-
|
|
|
- TweenOutlineDic[target] = new TweenOutline(graphic, graphic.effectColor, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenOutlineDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenOutline = new TweenOutline(graphic, graphic.effectColor, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenOutlineDic.Add(target, tweenOutline);
|
|
|
-
|
|
|
- return tweenOutline;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static TweenNumber CreateTweenNumber(Transform target, int origin, int destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- Text text = target.GetComponent<Text>();
|
|
|
- TweenNumber tweenNumber;
|
|
|
-
|
|
|
- if (TweenNumberDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenNumber = TweenNumberDic[target];
|
|
|
-
|
|
|
- tweenNumber.Pause();
|
|
|
-
|
|
|
- TweenNumberDic[target] = new TweenNumber(text, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenNumberDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenNumber = new TweenNumber(text, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenNumberDic.Add(target, tweenNumber);
|
|
|
-
|
|
|
- return tweenNumber;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenNumber CreateTweenNumber(Transform target, int destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- Text text = target.GetComponent<Text>();
|
|
|
- TweenNumber tweenNumber;
|
|
|
-
|
|
|
- if (TweenNumberDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenNumber = TweenNumberDic[target];
|
|
|
-
|
|
|
- tweenNumber.Pause();
|
|
|
-
|
|
|
- TweenNumberDic[target] = new TweenNumber(text, int.Parse(text.text), destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenNumberDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenNumber = new TweenNumber(text, int.Parse(text.text), destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenNumberDic.Add(target, tweenNumber);
|
|
|
-
|
|
|
- return tweenNumber;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- 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;
|
|
|
-
|
|
|
- if (TweenMatFloatDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenMatFloat = TweenMatFloatDic[target];
|
|
|
-
|
|
|
- tweenMatFloat.Pause();
|
|
|
-
|
|
|
- TweenMatFloatDic[target] = new TweenMatFloat(target, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenMatFloatDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenMatFloat = new TweenMatFloat(target, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenMatFloatDic.Add(target, tweenMatFloat);
|
|
|
-
|
|
|
- return tweenMatFloat;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static TweenMatFloat CreateTweenMatFloat(MaterialUnit target, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
- {
|
|
|
- TweenMatFloat tweenMatFloat;
|
|
|
-
|
|
|
- if (TweenMatFloatDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenMatFloat = TweenMatFloatDic[target];
|
|
|
-
|
|
|
- tweenMatFloat.Pause();
|
|
|
-
|
|
|
- TweenMatFloatDic[target] = new TweenMatFloat(target, target.GetFloat(), destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- return TweenMatFloatDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenMatFloat = new TweenMatFloat(target, target.GetFloat(), destination, duration, originActive, destActive, curve, cg);
|
|
|
-
|
|
|
- TweenMatFloatDic.Add(target, tweenMatFloat);
|
|
|
-
|
|
|
- return tweenMatFloat;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public static TweenGrayMesh CreateTweenGrayMesh(MeshFilter target, float origin, float destination, float duration, bool originActive, bool destActive, Curve curve)
|
|
|
- {
|
|
|
- TweenGrayMesh tweenGrayMesh;
|
|
|
-
|
|
|
- if (TweenGrayMeshDic.ContainsKey(target))
|
|
|
- {
|
|
|
- tweenGrayMesh = TweenGrayMeshDic[target];
|
|
|
-
|
|
|
- tweenGrayMesh.Pause();
|
|
|
-
|
|
|
- TweenGrayMeshDic[target] = new TweenGrayMesh(target, origin, destination, duration, originActive, destActive, curve);
|
|
|
-
|
|
|
- return TweenGrayMeshDic[target];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- tweenGrayMesh = new TweenGrayMesh(target, origin, destination, duration, originActive, destActive, curve);
|
|
|
-
|
|
|
- TweenGrayMeshDic.Add(target, tweenGrayMesh);
|
|
|
-
|
|
|
- return tweenGrayMesh;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- #endregion
|
|
|
+using UnityEngine;
|
|
|
+using UnityEngine.UI;
|
|
|
+using UnityEngine.Events;
|
|
|
+
|
|
|
+using System;
|
|
|
+using System.Collections;
|
|
|
+using System.Collections.Generic;
|
|
|
+
|
|
|
+public enum Curve
|
|
|
+{
|
|
|
+ Linear,
|
|
|
+ EaseOutQuad,
|
|
|
+}
|
|
|
+
|
|
|
+public enum EventType
|
|
|
+{
|
|
|
+ ForwardStart,
|
|
|
+ BackwardStart,
|
|
|
+ ForwardFinish,
|
|
|
+ BackwardFinish,
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+public delegate float TimerFunction(float value, float duration, float start, float delta);
|
|
|
+
|
|
|
+
|
|
|
+public delegate float ShakeFunctionF(float timer, float duration, int repeat, float start, float strength);
|
|
|
+
|
|
|
+public delegate Color ShakeFunctionC(float timer, float duration, int repeat, Color start, Color strength);
|
|
|
+
|
|
|
+public delegate Vector3 ShakeFunctionV(float timer, float duration, int repeat, Vector3 start, Vector3 strength);
|
|
|
+
|
|
|
+
|
|
|
+public delegate float CurveFunctionF(float timer, float duration, float start, float delta);
|
|
|
+
|
|
|
+public delegate Color CurveFunctionC(float timer, float duration, Color start, Color delta);
|
|
|
+
|
|
|
+public delegate Vector3 CurveFunctionV(float timer, float duration, Vector3 start, Vector3 delta);
|
|
|
+
|
|
|
+
|
|
|
+public class MaterialUnit
|
|
|
+{
|
|
|
+ public Material Material;
|
|
|
+ public Transform Transform;
|
|
|
+
|
|
|
+ public List<string> PropertyList;
|
|
|
+
|
|
|
+ public MaterialUnit(Material material, Transform transform, List<string> propertyList)
|
|
|
+ {
|
|
|
+ Material = material;
|
|
|
+ Transform = transform;
|
|
|
+ PropertyList = propertyList;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public void SetFloat(float value)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < PropertyList.Count; i++)
|
|
|
+ {
|
|
|
+ Material.SetFloat(PropertyList[i], value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 AnimManager : Regist
|
|
|
+{
|
|
|
+ #region 变量
|
|
|
+
|
|
|
+ public static List<MoveRoot> MoveForList = new List<MoveRoot>();
|
|
|
+ public static List<MoveRoot> MoveBacList = new List<MoveRoot>();
|
|
|
+
|
|
|
+ public static Dictionary<Curve, TimerFunction> TimerFunctionDic = new Dictionary<Curve, TimerFunction>();
|
|
|
+
|
|
|
+ public static Dictionary<Curve, ShakeFunctionF> ShakeFuncDicF = new Dictionary<Curve, ShakeFunctionF>();
|
|
|
+ public static Dictionary<Curve, ShakeFunctionC> ShakeFuncDicC = new Dictionary<Curve, ShakeFunctionC>();
|
|
|
+ public static Dictionary<Curve, ShakeFunctionV> ShakeFuncDicV = new Dictionary<Curve, ShakeFunctionV>();
|
|
|
+
|
|
|
+ public static Dictionary<Curve, CurveFunctionF> CurveFuncDicF = new Dictionary<Curve, CurveFunctionF>();
|
|
|
+ public static Dictionary<Curve, CurveFunctionC> CurveFuncDicC = new Dictionary<Curve, CurveFunctionC>();
|
|
|
+ public static Dictionary<Curve, CurveFunctionV> CurveFuncDicV = new Dictionary<Curve, CurveFunctionV>();
|
|
|
+
|
|
|
+ public static Dictionary<Transform, Shake> ShakeDic = new Dictionary<Transform, Shake>();
|
|
|
+ public static Dictionary<Transform, Move2D> MoveDic2D = new Dictionary<Transform, Move2D>();
|
|
|
+ public static Dictionary<Transform, Move3D> MoveDic3D = new Dictionary<Transform, Move3D>();
|
|
|
+ public static Dictionary<Transform, Zoom2D> ZoomDic2D = new Dictionary<Transform, Zoom2D>();
|
|
|
+
|
|
|
+ public static Dictionary<Transform, TweenSr> TweenSrDic = new Dictionary<Transform, TweenSr>();
|
|
|
+ public static Dictionary<Transform, TweenCG> TweenCgDic = new Dictionary<Transform, TweenCG>();
|
|
|
+ public static Dictionary<Transform, TweenGra> TweenGraDic = new Dictionary<Transform, TweenGra>();
|
|
|
+ public static Dictionary<Transform, TweenVec> TweenVecDic = new Dictionary<Transform, TweenVec>();
|
|
|
+ public static Dictionary<Transform, TweenEuler> TweenEulerDic = new Dictionary<Transform, TweenEuler>();
|
|
|
+ public static Dictionary<Transform, TweenFont> TweenFontDic = new Dictionary<Transform, TweenFont>();
|
|
|
+ public static Dictionary<Transform, TweenRect> TweenRectDic = new Dictionary<Transform, TweenRect>();
|
|
|
+ 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<MeshFilter, TweenGrayMesh> TweenGrayMeshDic = new Dictionary<MeshFilter, TweenGrayMesh>();
|
|
|
+
|
|
|
+ public static Dictionary<Transform, StreamScale> StreamScaleDic = new Dictionary<Transform, StreamScale>();
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ public void Update()
|
|
|
+ {
|
|
|
+ for (int i = 0; i < MoveForList.Count; i++)
|
|
|
+ {
|
|
|
+ MoveRoot move = MoveForList[i];
|
|
|
+
|
|
|
+ if (move.DoForward())
|
|
|
+ {
|
|
|
+ if (MoveForList.Remove(move))
|
|
|
+ {
|
|
|
+ i--;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < MoveBacList.Count; i++)
|
|
|
+ {
|
|
|
+ MoveRoot move = MoveBacList[i];
|
|
|
+
|
|
|
+ if (move.DoBackward())
|
|
|
+ {
|
|
|
+ if (MoveBacList.Remove(move))
|
|
|
+ {
|
|
|
+ i--;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public override bool InitAtOnce()
|
|
|
+ {
|
|
|
+ if (base.InitAtOnce())
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ TimerFunctionDic.Add(Curve.Linear, LinearTimer);
|
|
|
+ TimerFunctionDic.Add(Curve.EaseOutQuad, EaseOutQuadTimer);
|
|
|
+
|
|
|
+ ShakeFuncDicF.Add(Curve.Linear, ShakeLinear);
|
|
|
+ ShakeFuncDicF.Add(Curve.EaseOutQuad, ShakeEaseOutQuad);
|
|
|
+
|
|
|
+ ShakeFuncDicC.Add(Curve.Linear, ShakeLinear);
|
|
|
+ ShakeFuncDicC.Add(Curve.EaseOutQuad, ShakeEaseOutQuad);
|
|
|
+
|
|
|
+ ShakeFuncDicV.Add(Curve.Linear, ShakeLinear);
|
|
|
+ ShakeFuncDicV.Add(Curve.EaseOutQuad, ShakeEaseOutQuad);
|
|
|
+
|
|
|
+ CurveFuncDicF.Add(Curve.Linear, Linear);
|
|
|
+ CurveFuncDicF.Add(Curve.EaseOutQuad, EaseOutQuad);
|
|
|
+
|
|
|
+ CurveFuncDicC.Add(Curve.Linear, Linear);
|
|
|
+ CurveFuncDicC.Add(Curve.EaseOutQuad, EaseOutQuad);
|
|
|
+
|
|
|
+ CurveFuncDicV.Add(Curve.Linear, Linear);
|
|
|
+ CurveFuncDicV.Add(Curve.EaseOutQuad, EaseOutQuad);
|
|
|
+
|
|
|
+ enabled = true;
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ #region 曲线
|
|
|
+
|
|
|
+ public static float LinearTimer(float value, float duration, float start, float delta)
|
|
|
+ {
|
|
|
+ return (value - start)*duration/delta;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static float EaseOutQuadTimer(float value, float duration, float start, float delta)
|
|
|
+ {
|
|
|
+ return ((2 - Mathf.Sqrt(4 - 4*(value - start)/delta))/2)*duration;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static float ShakeLinear(float timer, float duration, int repeat, float start, float strength)
|
|
|
+ {
|
|
|
+ float sliceTime = duration/(4*repeat);
|
|
|
+
|
|
|
+ for (int i = 0; i < repeat*4; i += 4)
|
|
|
+ {
|
|
|
+ if (timer > duration)
|
|
|
+ {
|
|
|
+ return start;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (timer <= (i + 1)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i)*sliceTime;
|
|
|
+
|
|
|
+ return Linear(timer, sliceTime, start, strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ else if (timer <= (i + 3)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i + 1)*sliceTime;
|
|
|
+
|
|
|
+ return Linear(timer, 2*sliceTime, start + strength/(i/4 + 1), -2*strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ else if (timer <= (i + 4)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i + 3)*sliceTime;
|
|
|
+
|
|
|
+ return Linear(timer, sliceTime, start - strength/(i/4 + 1), strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Color ShakeLinear(float timer, float duration, int repeat, Color start, Color strength)
|
|
|
+ {
|
|
|
+ float sliceTime = duration/(4*repeat);
|
|
|
+
|
|
|
+ for (int i = 0; i < repeat*4; i += 4)
|
|
|
+ {
|
|
|
+ if (timer > duration)
|
|
|
+ {
|
|
|
+ return start;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (timer <= (i + 1)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i)*sliceTime;
|
|
|
+
|
|
|
+ return Linear(timer, sliceTime, start, strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ else if (timer <= (i + 3)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i + 1)*sliceTime;
|
|
|
+
|
|
|
+ return Linear(timer, 2*sliceTime, start + strength/(i/4 + 1), -2*strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ else if (timer <= (i + 4)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i + 3)*sliceTime;
|
|
|
+
|
|
|
+ return Linear(timer, sliceTime, start - strength/(i/4 + 1), strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Vector3 ShakeLinear(float timer, float duration, int repeat, Vector3 start, Vector3 strength)
|
|
|
+ {
|
|
|
+ float sliceTime = duration/(4*repeat);
|
|
|
+
|
|
|
+ for (int i = 0; i < repeat*4; i += 4)
|
|
|
+ {
|
|
|
+ if (timer > duration)
|
|
|
+ {
|
|
|
+ return start;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (timer <= (i + 1)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i)*sliceTime;
|
|
|
+
|
|
|
+ return Linear(timer, sliceTime, start, strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ else if (timer <= (i + 3)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i + 1)*sliceTime;
|
|
|
+
|
|
|
+ return Linear(timer, 2*sliceTime, start + strength/(i/4 + 1), -2*strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ else if (timer <= (i + 4)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i + 3)*sliceTime;
|
|
|
+
|
|
|
+ return Linear(timer, sliceTime, start - strength/(i/4 + 1), strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static float ShakeEaseOutQuad(float timer, float duration, int repeat, float start, float strength)
|
|
|
+ {
|
|
|
+ float sliceTime = duration/(4*repeat);
|
|
|
+
|
|
|
+ for (int i = 0; i < repeat*4; i += 4)
|
|
|
+ {
|
|
|
+ if (timer > duration)
|
|
|
+ {
|
|
|
+ return start;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (timer <= (i + 1)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i)*sliceTime;
|
|
|
+
|
|
|
+ return EaseOutQuad(timer, sliceTime, start, strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ else if (timer <= (i + 3)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i + 1)*sliceTime;
|
|
|
+
|
|
|
+ return EaseOutQuad(timer, 2*sliceTime, start + strength/(i/4 + 1), -2*strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ else if (timer <= (i + 4)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i + 3)*sliceTime;
|
|
|
+
|
|
|
+ return EaseOutQuad(timer, sliceTime, start - strength/(i/4 + 1), strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Color ShakeEaseOutQuad(float timer, float duration, int repeat, Color start, Color strength)
|
|
|
+ {
|
|
|
+ float sliceTime = duration/(4*repeat);
|
|
|
+
|
|
|
+ for (int i = 0; i < repeat*4; i += 4)
|
|
|
+ {
|
|
|
+ if (timer > duration)
|
|
|
+ {
|
|
|
+ return start;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (timer <= (i + 1)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i)*sliceTime;
|
|
|
+
|
|
|
+ return EaseOutQuad(timer, sliceTime, start, strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ else if (timer <= (i + 3)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i + 1)*sliceTime;
|
|
|
+
|
|
|
+ return EaseOutQuad(timer, 2*sliceTime, start + strength/(i/4 + 1), -2*strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ else if (timer <= (i + 4)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i + 3)*sliceTime;
|
|
|
+
|
|
|
+ return EaseOutQuad(timer, sliceTime, start - strength/(i/4 + 1), strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Vector3 ShakeEaseOutQuad(float timer, float duration, int repeat, Vector3 start, Vector3 strength)
|
|
|
+ {
|
|
|
+ float sliceTime = duration/(4*repeat);
|
|
|
+
|
|
|
+ for (int i = 0; i < repeat*4; i += 4)
|
|
|
+ {
|
|
|
+ if (timer > duration)
|
|
|
+ {
|
|
|
+ return start;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (timer <= (i + 1)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i)*sliceTime;
|
|
|
+
|
|
|
+ return EaseOutQuad(timer, sliceTime, start, strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ else if (timer <= (i + 3)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i + 1)*sliceTime;
|
|
|
+
|
|
|
+ return EaseOutQuad(timer, 2*sliceTime, start + strength/(i/4 + 1), -2*strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ else if (timer <= (i + 4)*sliceTime)
|
|
|
+ {
|
|
|
+ timer -= (i + 3)*sliceTime;
|
|
|
+
|
|
|
+ return EaseOutQuad(timer, sliceTime, start - strength/(i/4 + 1), strength/(i/4 + 1));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static float Linear(float timer, float duration, float start, float delta)
|
|
|
+ {
|
|
|
+ if (timer >= duration)
|
|
|
+ {
|
|
|
+ return start + delta;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (duration.Equal(0))
|
|
|
+ {
|
|
|
+ return delta + start;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return delta*timer/duration + start;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Color Linear(float timer, float duration, Color start, Color delta)
|
|
|
+ {
|
|
|
+ return new Color(Linear(timer, duration, start.r, delta.r), Linear(timer, duration, start.g, delta.g), Linear(timer, duration, start.b, delta.b), Linear(timer, duration, start.a, delta.a));
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Vector3 Linear(float timer, float duration, Vector3 start, Vector3 delta)
|
|
|
+ {
|
|
|
+ return new Vector3(Linear(timer, duration, start.x, delta.x), Linear(timer, duration, start.y, delta.y), Linear(timer, duration, start.z, delta.z));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static float EaseOutQuad(float timer, float duration, float start, float delta)
|
|
|
+ {
|
|
|
+ if (timer >= duration)
|
|
|
+ {
|
|
|
+ return start + delta;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (duration.Equal(0))
|
|
|
+ {
|
|
|
+ return delta + start;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ timer /= duration;
|
|
|
+
|
|
|
+ return -delta*timer*(timer - 2) + start;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Color EaseOutQuad(float timer, float duration, Color start, Color delta)
|
|
|
+ {
|
|
|
+ return new Color(EaseOutQuad(timer, duration, start.r, delta.r), EaseOutQuad(timer, duration, start.g, delta.g), EaseOutQuad(timer, duration, start.b, delta.b), EaseOutQuad(timer, duration, start.a, delta.a));
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Vector3 EaseOutQuad(float timer, float duration, Vector3 start, Vector3 delta)
|
|
|
+ {
|
|
|
+ return new Vector3(EaseOutQuad(timer, duration, start.x, delta.x), EaseOutQuad(timer, duration, start.y, delta.y), EaseOutQuad(timer, duration, start.z, delta.z));
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 播放动画
|
|
|
+
|
|
|
+ public static Shake Shake(Transform target, float duration, int repeat, Vector3 strength, Curve curve)
|
|
|
+ {
|
|
|
+ Shake move;
|
|
|
+
|
|
|
+ if (ShakeDic.TryGetValue(target, out move))
|
|
|
+ {
|
|
|
+ move.StartShake(repeat, duration, strength, curve);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ move = CreateShake(target);
|
|
|
+
|
|
|
+ move.StartShake(repeat, duration, strength, curve);
|
|
|
+ }
|
|
|
+
|
|
|
+ return move;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static Move2D Move2D(Transform target, Vector3 destination, float duration, bool local, Curve curve)
|
|
|
+ {
|
|
|
+ Move2D move;
|
|
|
+
|
|
|
+ if (local)
|
|
|
+ {
|
|
|
+ destination.z = target.localPosition.z;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ destination.z = target.position.z;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (MoveDic2D.TryGetValue(target, out move))
|
|
|
+ {
|
|
|
+ move.StartMove(destination, duration, local, curve);
|
|
|
+
|
|
|
+ return move;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ move = CreateMove2D(target);
|
|
|
+
|
|
|
+ move.StartMove(destination, duration, local, curve);
|
|
|
+
|
|
|
+ return move;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Move3D Move3D(Transform target, Vector3 destination, float duration, bool local, Curve curve)
|
|
|
+ {
|
|
|
+ Move3D move;
|
|
|
+
|
|
|
+ if (MoveDic3D.TryGetValue(target, out move))
|
|
|
+ {
|
|
|
+ move.StartMove(destination, duration, local, curve);
|
|
|
+
|
|
|
+ return move;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ move = CreateMove3D(target);
|
|
|
+
|
|
|
+ move.StartMove(destination, duration, local, curve);
|
|
|
+
|
|
|
+ return move;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Move2D MoveOffset2D(Transform target, Vector3 offset, float duration, bool local, Curve curve)
|
|
|
+ {
|
|
|
+ Move2D move;
|
|
|
+
|
|
|
+ Vector3 destination;
|
|
|
+
|
|
|
+ if (local)
|
|
|
+ {
|
|
|
+ destination = target.localPosition + offset;
|
|
|
+
|
|
|
+ destination.z = target.localPosition.z;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ destination = target.position + offset;
|
|
|
+
|
|
|
+ destination.z = target.position.z;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (MoveDic2D.TryGetValue(target, out move))
|
|
|
+ {
|
|
|
+ move.StartMove(destination, duration, local, curve);
|
|
|
+
|
|
|
+ return move;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ move = CreateMove2D(target);
|
|
|
+
|
|
|
+ move.StartMove(destination, duration, local, curve);
|
|
|
+
|
|
|
+ return move;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Move3D MoveOffset3D(Transform target, Vector3 offset, float duration, bool local, Curve curve)
|
|
|
+ {
|
|
|
+ Move3D move;
|
|
|
+
|
|
|
+ Vector3 destination;
|
|
|
+
|
|
|
+ if (local)
|
|
|
+ {
|
|
|
+ destination = target.localPosition + offset;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ destination = target.position + offset;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (MoveDic3D.TryGetValue(target, out move))
|
|
|
+ {
|
|
|
+ move.StartMove(destination, duration, local, curve);
|
|
|
+
|
|
|
+ return move;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ move = CreateMove3D(target);
|
|
|
+
|
|
|
+ move.StartMove(destination, duration, local, curve);
|
|
|
+
|
|
|
+ return move;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ 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, zoom, curve);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ move = CreateZoom2D(target);
|
|
|
+
|
|
|
+ move.StartZoom(origin, destination, duration, stay, zoom, curve);
|
|
|
+ }
|
|
|
+
|
|
|
+ return move;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Zoom2D Zoom2D(Transform target, float destination, float duration, float stay, Transform zoom, Curve curve)
|
|
|
+ {
|
|
|
+ Zoom2D move;
|
|
|
+
|
|
|
+ Camera camera = target.GetComponent<Camera>();
|
|
|
+
|
|
|
+ if (ZoomDic2D.TryGetValue(target, out move))
|
|
|
+ {
|
|
|
+ move.StartZoom(camera.orthographicSize, destination, duration, stay, zoom, curve);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ move = CreateZoom2D(target);
|
|
|
+
|
|
|
+ move.StartZoom(camera.orthographicSize, destination, duration, stay, zoom, curve);
|
|
|
+ }
|
|
|
+
|
|
|
+ return move;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static StreamScale StreamForScale(Transform target)
|
|
|
+ {
|
|
|
+ StreamScale stream;
|
|
|
+
|
|
|
+ if (StreamScaleDic.TryGetValue(target, out stream))
|
|
|
+ {
|
|
|
+ stream.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return stream;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static StreamScale StreamBacScale(Transform target)
|
|
|
+ {
|
|
|
+ StreamScale stream;
|
|
|
+
|
|
|
+ if (StreamScaleDic.TryGetValue(target, out stream))
|
|
|
+ {
|
|
|
+ stream.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return stream;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static StreamScale StreamReForScale(Transform target)
|
|
|
+ {
|
|
|
+ StreamScale stream;
|
|
|
+
|
|
|
+ if (StreamScaleDic.TryGetValue(target, out stream))
|
|
|
+ {
|
|
|
+ stream.ReForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return stream;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static StreamScale StreamReBacScale(Transform target)
|
|
|
+ {
|
|
|
+ StreamScale stream;
|
|
|
+
|
|
|
+ if (StreamScaleDic.TryGetValue(target, out stream))
|
|
|
+ {
|
|
|
+ stream.ReBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return stream;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static TweenSr TweenForSr(Transform target)
|
|
|
+ {
|
|
|
+ TweenSr tween;
|
|
|
+
|
|
|
+ if (TweenSrDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ 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;
|
|
|
+
|
|
|
+ if (TweenCgDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenGra TweenForGra(Transform target)
|
|
|
+ {
|
|
|
+ TweenGra tween;
|
|
|
+
|
|
|
+ if (TweenGraDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenEuler TweenForEuler(Transform target)
|
|
|
+ {
|
|
|
+ TweenEuler tween;
|
|
|
+
|
|
|
+ if (TweenEulerDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenVec TweenForVec(Transform target)
|
|
|
+ {
|
|
|
+ TweenVec tween;
|
|
|
+
|
|
|
+ if (TweenVecDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenFont TweenForFont(Transform target)
|
|
|
+ {
|
|
|
+ TweenFont tween;
|
|
|
+
|
|
|
+ if (TweenFontDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenRect TweenForRect(Transform target)
|
|
|
+ {
|
|
|
+ TweenRect tween;
|
|
|
+
|
|
|
+ if (TweenRectDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenScale TweenForScale(Transform target)
|
|
|
+ {
|
|
|
+ TweenScale tween;
|
|
|
+
|
|
|
+ if (TweenScaleDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenAudio TweenForAudio(Transform target)
|
|
|
+ {
|
|
|
+ TweenAudio tween;
|
|
|
+ AudioSource audioSource = target.GetComponent<AudioSource>();
|
|
|
+
|
|
|
+ if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
+ {
|
|
|
+ tween.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenAudio TweenForAudio(AudioSource audioSource)
|
|
|
+ {
|
|
|
+ TweenAudio tween;
|
|
|
+
|
|
|
+ if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
+ {
|
|
|
+ tween.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenOutline TweenForOutline(Transform target)
|
|
|
+ {
|
|
|
+ TweenOutline tween;
|
|
|
+
|
|
|
+ if (TweenOutlineDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenNumber TweenForNumber(Transform target)
|
|
|
+ {
|
|
|
+ TweenNumber tween;
|
|
|
+
|
|
|
+ if (TweenNumberDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenMatFloat TweenForMatFloat(MaterialUnit target)
|
|
|
+ {
|
|
|
+ TweenMatFloat tween;
|
|
|
+
|
|
|
+ if (TweenMatFloatDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 TweenGrayMesh TweenForGrayMesh(MeshFilter target)
|
|
|
+ {
|
|
|
+ TweenGrayMesh tween;
|
|
|
+
|
|
|
+ if (TweenGrayMeshDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static TweenSr TweenBacSr(Transform target)
|
|
|
+ {
|
|
|
+ TweenSr tween;
|
|
|
+
|
|
|
+ if (TweenSrDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ 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;
|
|
|
+
|
|
|
+ if (TweenCgDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenGra TweenBacGra(Transform target)
|
|
|
+ {
|
|
|
+ TweenGra tween;
|
|
|
+
|
|
|
+ if (TweenGraDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception(target.name);
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenVec TweenBacVec(Transform target)
|
|
|
+ {
|
|
|
+ TweenVec tween;
|
|
|
+
|
|
|
+ if (TweenVecDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception(target.name);
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenEuler TweenBacEuler(Transform target)
|
|
|
+ {
|
|
|
+ TweenEuler tween;
|
|
|
+
|
|
|
+ if (TweenEulerDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception(target.name);
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenFont TweenBacFont(Transform target)
|
|
|
+ {
|
|
|
+ TweenFont tween;
|
|
|
+
|
|
|
+ if (TweenFontDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenRect TweenBacRect(Transform target)
|
|
|
+ {
|
|
|
+ TweenRect tween;
|
|
|
+
|
|
|
+ if (TweenRectDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenScale TweenBacScale(Transform target)
|
|
|
+ {
|
|
|
+ TweenScale tween;
|
|
|
+
|
|
|
+ if (TweenScaleDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenAudio TweenBacAudio(Transform target)
|
|
|
+ {
|
|
|
+ TweenAudio tween;
|
|
|
+ AudioSource audioSource = target.GetComponent<AudioSource>();
|
|
|
+
|
|
|
+ if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
+ {
|
|
|
+ tween.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenAudio TweenBacAudio(AudioSource audioSource)
|
|
|
+ {
|
|
|
+ TweenAudio tween;
|
|
|
+
|
|
|
+ if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
+ {
|
|
|
+ tween.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenOutline TweenBacOutline(Transform target)
|
|
|
+ {
|
|
|
+ TweenOutline tween;
|
|
|
+
|
|
|
+ if (TweenOutlineDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenNumber TweenBacNumber(Transform target)
|
|
|
+ {
|
|
|
+ TweenNumber tween;
|
|
|
+
|
|
|
+ if (TweenNumberDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenMatFloat TweenBacMatFloat(MaterialUnit target)
|
|
|
+ {
|
|
|
+ TweenMatFloat tween;
|
|
|
+
|
|
|
+ if (TweenMatFloatDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 TweenGrayMesh TweenBacGrayMesh(MeshFilter target)
|
|
|
+ {
|
|
|
+ TweenGrayMesh tween;
|
|
|
+
|
|
|
+ if (TweenGrayMeshDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.StartBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static TweenSr TweenReForSr(Transform target)
|
|
|
+ {
|
|
|
+ TweenSr tween;
|
|
|
+
|
|
|
+ if (TweenSrDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ 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;
|
|
|
+
|
|
|
+ if (TweenCgDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenGra TweenReForGra(Transform target)
|
|
|
+ {
|
|
|
+ TweenGra tween;
|
|
|
+
|
|
|
+ if (TweenGraDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenVec TweenReForVec(Transform target)
|
|
|
+ {
|
|
|
+ TweenVec tween;
|
|
|
+
|
|
|
+ if (TweenVecDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenEuler TweenReForEuler(Transform target)
|
|
|
+ {
|
|
|
+ TweenEuler tween;
|
|
|
+
|
|
|
+ if (TweenEulerDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenFont TweenReForFont(Transform target)
|
|
|
+ {
|
|
|
+ TweenFont tween;
|
|
|
+
|
|
|
+ if (TweenFontDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenRect TweenReForRect(Transform target)
|
|
|
+ {
|
|
|
+ TweenRect tween;
|
|
|
+
|
|
|
+ if (TweenRectDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenScale TweenReForScale(Transform target)
|
|
|
+ {
|
|
|
+ TweenScale tween;
|
|
|
+
|
|
|
+ if (TweenScaleDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenAudio TweenReForAudio(Transform target)
|
|
|
+ {
|
|
|
+ TweenAudio tween;
|
|
|
+ AudioSource audioSource = target.GetComponent<AudioSource>();
|
|
|
+
|
|
|
+ if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
+ {
|
|
|
+ tween.ReForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenAudio TweenReForAudio(AudioSource audioSource)
|
|
|
+ {
|
|
|
+ TweenAudio tween;
|
|
|
+
|
|
|
+ if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
+ {
|
|
|
+ tween.ReForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenOutline TweenReForOutline(Transform target)
|
|
|
+ {
|
|
|
+ TweenOutline tween;
|
|
|
+
|
|
|
+ if (TweenOutlineDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenNumber TweenReForNumber(Transform target)
|
|
|
+ {
|
|
|
+ TweenNumber tween;
|
|
|
+
|
|
|
+ if (TweenNumberDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenMatFloat TweenReForMatFloat(MaterialUnit target)
|
|
|
+ {
|
|
|
+ TweenMatFloat tween;
|
|
|
+
|
|
|
+ if (TweenMatFloatDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReForward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ 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)
|
|
|
+ {
|
|
|
+ TweenSr tween;
|
|
|
+
|
|
|
+ if (TweenSrDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ 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;
|
|
|
+
|
|
|
+ if (TweenCgDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenGra TweenReBacGra(Transform target)
|
|
|
+ {
|
|
|
+ TweenGra tween;
|
|
|
+
|
|
|
+ if (TweenGraDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception(target.name);
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenVec TweenReBacVec(Transform target)
|
|
|
+ {
|
|
|
+ TweenVec tween;
|
|
|
+
|
|
|
+ if (TweenVecDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception(target.name);
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenEuler TweenReBacEuler(Transform target)
|
|
|
+ {
|
|
|
+ TweenEuler tween;
|
|
|
+
|
|
|
+ if (TweenEulerDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception(target.name);
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenFont TweenReBacFont(Transform target)
|
|
|
+ {
|
|
|
+ TweenFont tween;
|
|
|
+
|
|
|
+ if (TweenFontDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenRect TweenReBacRect(Transform target)
|
|
|
+ {
|
|
|
+ TweenRect tween;
|
|
|
+
|
|
|
+ if (TweenRectDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenScale TweenReBacScale(Transform target)
|
|
|
+ {
|
|
|
+ TweenScale tween;
|
|
|
+
|
|
|
+ if (TweenScaleDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenAudio TweenReBacAudio(Transform target)
|
|
|
+ {
|
|
|
+ TweenAudio tween;
|
|
|
+ AudioSource audioSource = target.GetComponent<AudioSource>();
|
|
|
+
|
|
|
+ if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
+ {
|
|
|
+ tween.ReBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenAudio TweenReBacAudio(AudioSource audioSource)
|
|
|
+ {
|
|
|
+ TweenAudio tween;
|
|
|
+
|
|
|
+ if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
+ {
|
|
|
+ tween.ReBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenOutline TweenReBacOutline(Transform target)
|
|
|
+ {
|
|
|
+ TweenOutline tween;
|
|
|
+
|
|
|
+ if (TweenOutlineDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenNumber TweenReBacNumber(Transform target)
|
|
|
+ {
|
|
|
+ TweenNumber tween;
|
|
|
+
|
|
|
+ if (TweenNumberDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenMatFloat TweenReBacMatFloat(MaterialUnit target)
|
|
|
+ {
|
|
|
+ TweenMatFloat tween;
|
|
|
+
|
|
|
+ if (TweenMatFloatDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ tween.ReBackward();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 获取动画
|
|
|
+
|
|
|
+ public static float GetTimerVec(Vector3 value, float duration, Vector3 start, Vector3 delta, Curve curve)
|
|
|
+ {
|
|
|
+ if (!delta.x.Equal(0))
|
|
|
+ {
|
|
|
+ return TimerFunctionDic[curve](value.x, duration, start.x, delta.x);
|
|
|
+ }
|
|
|
+ else if (!delta.y.Equal(0))
|
|
|
+ {
|
|
|
+ return TimerFunctionDic[curve](value.y, duration, start.y, delta.y);
|
|
|
+ }
|
|
|
+ else if (!delta.z.Equal(0))
|
|
|
+ {
|
|
|
+ return TimerFunctionDic[curve](value.z, duration, start.z, delta.z);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static float GetTimerFloat(float value, float duration, float start, float delta, Curve curve)
|
|
|
+ {
|
|
|
+ return TimerFunctionDic[curve](value, duration, start, delta);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static float GetTimerColor(Color value, float duration, Color start, Color delta, Curve curve)
|
|
|
+ {
|
|
|
+ if (!delta.r.Equal(0))
|
|
|
+ {
|
|
|
+ return TimerFunctionDic[curve](value.r, duration, start.r, delta.r);
|
|
|
+ }
|
|
|
+ else if (!delta.g.Equal(0))
|
|
|
+ {
|
|
|
+ return TimerFunctionDic[curve](value.g, duration, start.g, delta.g);
|
|
|
+ }
|
|
|
+ else if (!delta.b.Equal(0))
|
|
|
+ {
|
|
|
+ return TimerFunctionDic[curve](value.b, duration, start.b, delta.b);
|
|
|
+ }
|
|
|
+ else if (!delta.a.Equal(0))
|
|
|
+ {
|
|
|
+ return TimerFunctionDic[curve](value.a, duration, start.a, delta.a);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static Shake GetShake(Transform target)
|
|
|
+ {
|
|
|
+ Shake move;
|
|
|
+
|
|
|
+ if (ShakeDic.TryGetValue(target, out move))
|
|
|
+ {
|
|
|
+ return move;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Move2D GetMove2D(Transform target)
|
|
|
+ {
|
|
|
+ Move2D move;
|
|
|
+
|
|
|
+ if (MoveDic2D.TryGetValue(target, out move))
|
|
|
+ {
|
|
|
+ return move;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Move3D GetMove3D(Transform target)
|
|
|
+ {
|
|
|
+ Move3D move;
|
|
|
+
|
|
|
+ if (MoveDic3D.TryGetValue(target, out move))
|
|
|
+ {
|
|
|
+ return move;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Zoom2D GetZoom2D(Transform target)
|
|
|
+ {
|
|
|
+ Zoom2D move;
|
|
|
+
|
|
|
+ if (ZoomDic2D.TryGetValue(target, out move))
|
|
|
+ {
|
|
|
+ return move;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static StreamScale GetStreamScale(Transform target)
|
|
|
+ {
|
|
|
+ StreamScale stream;
|
|
|
+
|
|
|
+ if (StreamScaleDic.TryGetValue(target, out stream))
|
|
|
+ {
|
|
|
+ return stream;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static TweenSr GetTweenSr(Transform target)
|
|
|
+ {
|
|
|
+ TweenSr tween;
|
|
|
+
|
|
|
+ if (TweenSrDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ 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;
|
|
|
+
|
|
|
+ if (TweenCgDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenGra GetTweenGra(Transform target)
|
|
|
+ {
|
|
|
+ TweenGra tween;
|
|
|
+
|
|
|
+ if (TweenGraDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenVec GetTweenVec(Transform target)
|
|
|
+ {
|
|
|
+ TweenVec tween;
|
|
|
+
|
|
|
+ if (TweenVecDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenEuler GetTweenEuler(Transform target)
|
|
|
+ {
|
|
|
+ TweenEuler tween;
|
|
|
+
|
|
|
+ if (TweenEulerDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenFont GetTweenFont(Transform target)
|
|
|
+ {
|
|
|
+ TweenFont tween;
|
|
|
+
|
|
|
+ if (TweenFontDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenRect GetTweenRect(Transform target)
|
|
|
+ {
|
|
|
+ TweenRect tween;
|
|
|
+
|
|
|
+ if (TweenRectDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenScale GetTweenScale(Transform target)
|
|
|
+ {
|
|
|
+ TweenScale tween;
|
|
|
+
|
|
|
+ if (TweenScaleDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenAudio GetTweenAudio(Transform target)
|
|
|
+ {
|
|
|
+ TweenAudio tween;
|
|
|
+ AudioSource audioSource = target.GetComponent<AudioSource>();
|
|
|
+
|
|
|
+ if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
+ {
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenAudio GetTweenAudio(AudioSource audioSource)
|
|
|
+ {
|
|
|
+ TweenAudio tween;
|
|
|
+
|
|
|
+ if (TweenAudioDic.TryGetValue(audioSource, out tween))
|
|
|
+ {
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenOutline GetTweenOutline(Transform target)
|
|
|
+ {
|
|
|
+ TweenOutline tween;
|
|
|
+
|
|
|
+ if (TweenOutlineDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenNumber GetTweenNumber(Transform target)
|
|
|
+ {
|
|
|
+ TweenNumber tween;
|
|
|
+
|
|
|
+ if (TweenNumberDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenMatFloat GetTweenMatFloat(MaterialUnit target)
|
|
|
+ {
|
|
|
+ TweenMatFloat tween;
|
|
|
+
|
|
|
+ if (TweenMatFloatDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenMatColor GetTweenMatColor(MaterialUnit target)
|
|
|
+ {
|
|
|
+ TweenMatColor tween;
|
|
|
+
|
|
|
+ if (TweenMatColorDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenGrayMesh GetTweenGrayMesh(MeshFilter target)
|
|
|
+ {
|
|
|
+ TweenGrayMesh tween;
|
|
|
+
|
|
|
+ if (TweenGrayMeshDic.TryGetValue(target, out tween))
|
|
|
+ {
|
|
|
+ return tween;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 创建动画
|
|
|
+
|
|
|
+ public static Shake CreateShake(Transform target)
|
|
|
+ {
|
|
|
+ if (ShakeDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ Shake shake = ShakeDic[target];
|
|
|
+
|
|
|
+ shake.Pause();
|
|
|
+
|
|
|
+ ShakeDic[target] = new Shake(target);
|
|
|
+
|
|
|
+ return ShakeDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Shake shake = new Shake(target);
|
|
|
+
|
|
|
+ ShakeDic.Add(target, shake);
|
|
|
+
|
|
|
+ return shake;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Move2D CreateMove2D(Transform target)
|
|
|
+ {
|
|
|
+ if (MoveDic2D.ContainsKey(target))
|
|
|
+ {
|
|
|
+ Move2D move2D = MoveDic2D[target];
|
|
|
+
|
|
|
+ move2D.Pause();
|
|
|
+
|
|
|
+ MoveDic2D[target] = new Move2D(target);
|
|
|
+
|
|
|
+ return MoveDic2D[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Move2D move2D = new Move2D(target);
|
|
|
+
|
|
|
+ MoveDic2D.Add(target, move2D);
|
|
|
+
|
|
|
+ return move2D;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Move3D CreateMove3D(Transform target)
|
|
|
+ {
|
|
|
+ if (MoveDic3D.ContainsKey(target))
|
|
|
+ {
|
|
|
+ Move3D move3D = MoveDic3D[target];
|
|
|
+
|
|
|
+ move3D.Pause();
|
|
|
+
|
|
|
+ MoveDic3D[target] = new Move3D(target);
|
|
|
+
|
|
|
+ return MoveDic3D[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Move3D move3D = new Move3D(target);
|
|
|
+
|
|
|
+ MoveDic3D.Add(target, move3D);
|
|
|
+
|
|
|
+ return move3D;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Zoom2D CreateZoom2D(Transform target)
|
|
|
+ {
|
|
|
+ if (ZoomDic2D.ContainsKey(target))
|
|
|
+ {
|
|
|
+ Zoom2D zoom2D = ZoomDic2D[target];
|
|
|
+
|
|
|
+ zoom2D.Pause();
|
|
|
+
|
|
|
+ ZoomDic2D[target] = new Zoom2D(target.GetComponent<Camera>());
|
|
|
+
|
|
|
+ return ZoomDic2D[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Zoom2D zoom2D = new Zoom2D(target.GetComponent<Camera>());
|
|
|
+
|
|
|
+ ZoomDic2D.Add(target, zoom2D);
|
|
|
+
|
|
|
+ return zoom2D;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static StreamScale CreateStreamScale(Transform target, List<float> delayList, List<float> durationList, List<VecPair> destKvList, bool originActive, bool destActive, Curve curve, bool cg = false, List<UnityAction> startActionList = null, List<UnityAction> finishActionList = null)
|
|
|
+ {
|
|
|
+ StreamScale streamScale;
|
|
|
+
|
|
|
+ if (StreamScaleDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ streamScale = StreamScaleDic[target];
|
|
|
+
|
|
|
+ streamScale.Pause();
|
|
|
+
|
|
|
+ StreamScaleDic[target] = new StreamScale(target, delayList, durationList, destKvList, originActive, destActive, curve, cg, startActionList, finishActionList);
|
|
|
+
|
|
|
+ return StreamScaleDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ streamScale = new StreamScale(target, delayList, durationList, destKvList, originActive, destActive, curve, cg, startActionList, finishActionList);
|
|
|
+
|
|
|
+ StreamScaleDic.Add(target, streamScale);
|
|
|
+
|
|
|
+ return streamScale;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static StreamScale CreateStreamScale(Transform target, List<float> delayList, List<float> durationList, List<Vector3> destList, bool originActive, bool destActive, Curve curve, bool cg = false, List<UnityAction> startActionList = null, List<UnityAction> finishActionList = null)
|
|
|
+ {
|
|
|
+ StreamScale streamScale;
|
|
|
+
|
|
|
+ if (StreamScaleDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ streamScale = StreamScaleDic[target];
|
|
|
+
|
|
|
+ streamScale.Pause();
|
|
|
+
|
|
|
+ StreamScaleDic[target] = new StreamScale(target, delayList, durationList, destList, originActive, destActive, curve, cg, startActionList, finishActionList);
|
|
|
+
|
|
|
+ return StreamScaleDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ streamScale = new StreamScale(target, delayList, durationList, destList, originActive, destActive, curve, cg, startActionList, finishActionList);
|
|
|
+
|
|
|
+ StreamScaleDic.Add(target, streamScale);
|
|
|
+
|
|
|
+ return streamScale;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ 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>();
|
|
|
+
|
|
|
+ Color origin = sr.color;
|
|
|
+ Color destination = sr.color;
|
|
|
+
|
|
|
+ origin.a = originAlpha;
|
|
|
+ destination.a = destAlpha;
|
|
|
+
|
|
|
+ if (TweenSrDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenSr = TweenSrDic[target];
|
|
|
+
|
|
|
+ tweenSr.Pause();
|
|
|
+
|
|
|
+ TweenSrDic[target] = new TweenSr(sr, origin, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+
|
|
|
+ return TweenSrDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenSr = new TweenSr(sr, origin, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+
|
|
|
+ TweenSrDic.Add(target, tweenSr);
|
|
|
+
|
|
|
+ return tweenSr;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 = destAlpha;
|
|
|
+
|
|
|
+ if (TweenSrDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenSr = TweenSrDic[target];
|
|
|
+
|
|
|
+ tweenSr.Pause();
|
|
|
+
|
|
|
+ TweenSrDic[target] = new TweenSr(sr, sr.color, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+
|
|
|
+ return TweenSrDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenSr = new TweenSr(sr, sr.color, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+
|
|
|
+ TweenSrDic.Add(target, tweenSr);
|
|
|
+
|
|
|
+ return tweenSr;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenSr CreateTweenSr(Transform target, Color origin, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false, bool group = false)
|
|
|
+ {
|
|
|
+ TweenSr tweenSr;
|
|
|
+ SpriteRenderer sr = target.GetComponent<SpriteRenderer>();
|
|
|
+
|
|
|
+ if (TweenSrDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenSr = TweenSrDic[target];
|
|
|
+
|
|
|
+ tweenSr.Pause();
|
|
|
+
|
|
|
+ TweenSrDic[target] = new TweenSr(sr, origin, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+
|
|
|
+ return TweenSrDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenSr = new TweenSr(sr, origin, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+
|
|
|
+ TweenSrDic.Add(target, tweenSr);
|
|
|
+
|
|
|
+ return tweenSr;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenSr CreateTweenSr(Transform target, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false, bool group = false)
|
|
|
+ {
|
|
|
+ TweenSr tweenSr;
|
|
|
+ SpriteRenderer sr = target.GetComponent<SpriteRenderer>();
|
|
|
+
|
|
|
+ if (TweenSrDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenSr = TweenSrDic[target];
|
|
|
+
|
|
|
+ tweenSr.Pause();
|
|
|
+
|
|
|
+ TweenSrDic[target] = new TweenSr(sr, sr.color, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+
|
|
|
+ return TweenSrDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenSr = new TweenSr(sr, sr.color, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+
|
|
|
+ TweenSrDic.Add(target, tweenSr);
|
|
|
+
|
|
|
+ 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;
|
|
|
+ Color origin = target.sharedMaterial.GetColor("_Color");
|
|
|
+ Color destination = target.sharedMaterial.GetColor("_Color");
|
|
|
+
|
|
|
+ origin.a = originAlpha;
|
|
|
+ destination.a = destAlpha;
|
|
|
+
|
|
|
+ if (TweenRendererDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenSr = TweenRendererDic[target];
|
|
|
+
|
|
|
+ tweenSr.Pause();
|
|
|
+
|
|
|
+ TweenRendererDic[target] = new TweenRenderer(target, origin, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+ tweenSr.AlphaOnly = true;
|
|
|
+ return TweenRendererDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenSr = new TweenRenderer(target, origin, destination, duration, originActive, destActive, curve, cg, group);
|
|
|
+
|
|
|
+ TweenRendererDic.Add(target, tweenSr);
|
|
|
+ tweenSr.AlphaOnly = true;
|
|
|
+ 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)
|
|
|
+ {
|
|
|
+ TweenCG tweenCg;
|
|
|
+ CanvasGroup cg = target.GetComponent<CanvasGroup>();
|
|
|
+
|
|
|
+ if (TweenCgDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenCg = TweenCgDic[target];
|
|
|
+
|
|
|
+ tweenCg.Pause();
|
|
|
+
|
|
|
+ TweenCgDic[target] = new TweenCG(cg, origin, destination, duration, originActive, destActive, curve);
|
|
|
+
|
|
|
+ return TweenCgDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenCg = new TweenCG(cg, origin, destination, duration, originActive, destActive, curve);
|
|
|
+
|
|
|
+ TweenCgDic.Add(target, tweenCg);
|
|
|
+
|
|
|
+ return tweenCg;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenCG CreateTweenCG(Transform target, float destination, float duration, bool originActive, bool destActive, Curve curve)
|
|
|
+ {
|
|
|
+ TweenCG tweenCg;
|
|
|
+ CanvasGroup cg = target.GetComponent<CanvasGroup>();
|
|
|
+
|
|
|
+ if (TweenCgDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenCg = TweenCgDic[target];
|
|
|
+
|
|
|
+ tweenCg.Pause();
|
|
|
+
|
|
|
+ TweenCgDic[target] = new TweenCG(cg, cg.alpha, destination, duration, originActive, destActive, curve);
|
|
|
+
|
|
|
+ return TweenCgDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenCg = new TweenCG(cg, cg.alpha, destination, duration, originActive, destActive, curve);
|
|
|
+
|
|
|
+ TweenCgDic.Add(target, tweenCg);
|
|
|
+
|
|
|
+ return tweenCg;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ 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;
|
|
|
+
|
|
|
+ Color origin = graphic.color;
|
|
|
+ Color destination = graphic.color;
|
|
|
+
|
|
|
+ origin.a = originAlpha;
|
|
|
+ destination.a = destAlpha;
|
|
|
+
|
|
|
+ if (TweenGraDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenGra = TweenGraDic[target];
|
|
|
+
|
|
|
+ tweenGra.Pause();
|
|
|
+
|
|
|
+ TweenGraDic[target] = new TweenGra(graphic, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenGraDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenGra = new TweenGra(graphic, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenGraDic.Add(target, tweenGra);
|
|
|
+
|
|
|
+ return tweenGra;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 = destAlpha;
|
|
|
+
|
|
|
+ if (TweenGraDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenGra = TweenGraDic[target];
|
|
|
+
|
|
|
+ tweenGra.Pause();
|
|
|
+
|
|
|
+ TweenGraDic[target] = new TweenGra(graphic, graphic.color, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenGraDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenGra = new TweenGra(graphic, graphic.color, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenGraDic.Add(target, tweenGra);
|
|
|
+
|
|
|
+ return tweenGra;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenGra CreateTweenGra(Transform target, Color origin, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ Graphic graphic = target.GetComponent<Graphic>();
|
|
|
+ TweenGra tweenGra;
|
|
|
+
|
|
|
+ if (TweenGraDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenGra = TweenGraDic[target];
|
|
|
+
|
|
|
+ tweenGra.Pause();
|
|
|
+
|
|
|
+ TweenGraDic[target] = new TweenGra(graphic, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenGraDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenGra = new TweenGra(graphic, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenGraDic.Add(target, tweenGra);
|
|
|
+
|
|
|
+ return tweenGra;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenGra CreateTweenGra(Transform target, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ Graphic graphic = target.GetComponent<Graphic>();
|
|
|
+ TweenGra tweenGra;
|
|
|
+
|
|
|
+ if (TweenGraDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenGra = TweenGraDic[target];
|
|
|
+
|
|
|
+ tweenGra.Pause();
|
|
|
+
|
|
|
+ TweenGraDic[target] = new TweenGra(graphic, graphic.color, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenGraDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenGra = new TweenGra(graphic, graphic.color, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenGraDic.Add(target, tweenGra);
|
|
|
+
|
|
|
+ return tweenGra;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static TweenVec CreateTweenVec2D(Transform target, Vector3 origin, Vector3 destination, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenVec tweenVec2D;
|
|
|
+
|
|
|
+ if (local)
|
|
|
+ {
|
|
|
+ origin.z = target.localPosition.z;
|
|
|
+ destination.z = target.localPosition.z;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ origin.z = target.position.z;
|
|
|
+ destination.z = target.position.z;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (TweenVecDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenVec2D = TweenVecDic[target];
|
|
|
+
|
|
|
+ tweenVec2D.Pause();
|
|
|
+
|
|
|
+ TweenVecDic[target] = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenVecDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenVec2D = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenVecDic.Add(target, tweenVec2D);
|
|
|
+
|
|
|
+ return tweenVec2D;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenVec CreateTweenVec2D(Transform target, Vector3 destination, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenVec tweenVec2D;
|
|
|
+
|
|
|
+ Vector3 origin;
|
|
|
+
|
|
|
+ if (local)
|
|
|
+ {
|
|
|
+ origin = target.localPosition;
|
|
|
+
|
|
|
+ destination.z = target.localPosition.z;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ origin = target.position;
|
|
|
+
|
|
|
+ destination.z = target.position.z;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (TweenVecDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenVec2D = TweenVecDic[target];
|
|
|
+
|
|
|
+ tweenVec2D.Pause();
|
|
|
+
|
|
|
+ TweenVecDic[target] = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenVecDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenVec2D = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenVecDic.Add(target, tweenVec2D);
|
|
|
+
|
|
|
+ return tweenVec2D;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenVec CreateTweenVecOffset2D(Transform target, Vector3 offset, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenVec tweenVec2D;
|
|
|
+
|
|
|
+ Vector3 origin;
|
|
|
+ Vector3 destination;
|
|
|
+
|
|
|
+ if (local)
|
|
|
+ {
|
|
|
+ origin = target.localPosition;
|
|
|
+ destination = target.localPosition + offset;
|
|
|
+
|
|
|
+ destination.z = target.localPosition.z;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ origin = target.position;
|
|
|
+ destination = target.position + offset;
|
|
|
+
|
|
|
+ destination.z = target.position.z;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (TweenVecDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenVec2D = TweenVecDic[target];
|
|
|
+
|
|
|
+ tweenVec2D.Pause();
|
|
|
+
|
|
|
+ TweenVecDic[target] = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenVecDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenVec2D = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenVecDic.Add(target, tweenVec2D);
|
|
|
+
|
|
|
+ return tweenVec2D;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static TweenVec CreateTweenVec3D(Transform target, Vector3 origin, Vector3 destination, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenVec tweenVec3D;
|
|
|
+
|
|
|
+ if (TweenVecDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenVec3D = TweenVecDic[target];
|
|
|
+
|
|
|
+ tweenVec3D.Pause();
|
|
|
+
|
|
|
+ TweenVecDic[target] = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenVecDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenVec3D = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenVecDic.Add(target, tweenVec3D);
|
|
|
+
|
|
|
+ return tweenVec3D;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenVec CreateTweenVec3D(Transform target, Vector3 destination, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenVec tweenVec3D;
|
|
|
+
|
|
|
+ Vector3 origin;
|
|
|
+
|
|
|
+ if (local)
|
|
|
+ {
|
|
|
+ origin = target.localPosition;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ origin = target.position;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (TweenVecDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenVec3D = TweenVecDic[target];
|
|
|
+
|
|
|
+ tweenVec3D.Pause();
|
|
|
+
|
|
|
+ TweenVecDic[target] = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenVecDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenVec3D = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenVecDic.Add(target, tweenVec3D);
|
|
|
+
|
|
|
+ return tweenVec3D;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenVec CreateTweenVecOffset3D(Transform target, Vector3 offset, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenVec tweenVec3D;
|
|
|
+
|
|
|
+ Vector3 origin;
|
|
|
+ Vector3 destination;
|
|
|
+
|
|
|
+ if (local)
|
|
|
+ {
|
|
|
+ origin = target.localPosition;
|
|
|
+ destination = target.localPosition + offset;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ origin = target.position;
|
|
|
+ destination = target.position + offset;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (TweenVecDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenVec3D = TweenVecDic[target];
|
|
|
+
|
|
|
+ tweenVec3D.Pause();
|
|
|
+
|
|
|
+ TweenVecDic[target] = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenVecDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenVec3D = new TweenVec(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenVecDic.Add(target, tweenVec3D);
|
|
|
+
|
|
|
+ return tweenVec3D;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static TweenEuler CreateTweenEuler(Transform target, Vector3 origin, Vector3 destination, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenEuler tweenEuler;
|
|
|
+
|
|
|
+ if (TweenEulerDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenEuler = TweenEulerDic[target];
|
|
|
+
|
|
|
+ tweenEuler.Pause();
|
|
|
+
|
|
|
+ TweenEulerDic[target] = new TweenEuler(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenEulerDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenEuler = new TweenEuler(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenEulerDic.Add(target, tweenEuler);
|
|
|
+
|
|
|
+ return tweenEuler;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenEuler CreateTweenEuler(Transform target, Vector3 destination, float duration, bool local, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenEuler tweenEuler;
|
|
|
+
|
|
|
+ Vector3 origin;
|
|
|
+
|
|
|
+ if (local)
|
|
|
+ {
|
|
|
+ origin = target.localEulerAngles;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ origin = target.eulerAngles;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (TweenEulerDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenEuler = TweenEulerDic[target];
|
|
|
+
|
|
|
+ tweenEuler.Pause();
|
|
|
+
|
|
|
+ TweenEulerDic[target] = new TweenEuler(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenEulerDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenEuler = new TweenEuler(target, origin, destination, duration, local, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenEulerDic.Add(target, tweenEuler);
|
|
|
+
|
|
|
+ return tweenEuler;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static TweenFont CreateTweenFont(Transform target, int origin, int destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ Text text = target.GetComponent<Text>();
|
|
|
+ TweenFont tweenFont;
|
|
|
+
|
|
|
+ if (TweenRectDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenFont = TweenFontDic[target];
|
|
|
+
|
|
|
+ tweenFont.Pause();
|
|
|
+
|
|
|
+ TweenFontDic[target] = new TweenFont(text, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenFontDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenFont = new TweenFont(text, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenFontDic.Add(target, tweenFont);
|
|
|
+
|
|
|
+ return tweenFont;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenFont CreateTweenFont(Transform target, int destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ Text text = target.GetComponent<Text>();
|
|
|
+ TweenFont tweenFont;
|
|
|
+
|
|
|
+ if (TweenRectDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenFont = TweenFontDic[target];
|
|
|
+
|
|
|
+ tweenFont.Pause();
|
|
|
+
|
|
|
+ TweenFontDic[target] = new TweenFont(text, text.fontSize, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenFontDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenFont = new TweenFont(text, text.fontSize, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenFontDic.Add(target, tweenFont);
|
|
|
+
|
|
|
+ return tweenFont;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static TweenRect CreateTweenRect(Transform target, Vector2 origin, Vector2 destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenRect tweenRect;
|
|
|
+ RectTransform rectTra = target.GetComponent<RectTransform>();
|
|
|
+
|
|
|
+ if (TweenRectDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenRect = TweenRectDic[target];
|
|
|
+
|
|
|
+ tweenRect.Pause();
|
|
|
+
|
|
|
+ TweenRectDic[target] = new TweenRect(rectTra, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenRectDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenRect = new TweenRect(rectTra, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenRectDic.Add(target, tweenRect);
|
|
|
+
|
|
|
+ return tweenRect;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenRect CreateTweenRect(Transform target, Vector2 destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenRect tweenRect;
|
|
|
+ RectTransform rectTra = target.GetComponent<RectTransform>();
|
|
|
+
|
|
|
+ if (TweenRectDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenRect = TweenRectDic[target];
|
|
|
+
|
|
|
+ tweenRect.Pause();
|
|
|
+
|
|
|
+ TweenRectDic[target] = new TweenRect(rectTra, rectTra.rect.size, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenRectDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenRect = new TweenRect(rectTra, rectTra.rect.size, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenRectDic.Add(target, tweenRect);
|
|
|
+
|
|
|
+ return tweenRect;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ tweenScale.Pause();
|
|
|
+
|
|
|
+ TweenScaleDic[target] = new TweenScale(target, originScale, destScale, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenScaleDic[target];
|
|
|
+ }
|
|
|
+ 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];
|
|
|
+
|
|
|
+ tweenScale.Pause();
|
|
|
+
|
|
|
+ TweenScaleDic[target] = new TweenScale(target, target.localScale, destScale, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenScaleDic[target];
|
|
|
+ }
|
|
|
+ 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;
|
|
|
+
|
|
|
+ if (TweenScaleDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenScale = TweenScaleDic[target];
|
|
|
+
|
|
|
+ tweenScale.Pause();
|
|
|
+
|
|
|
+ TweenScaleDic[target] = new TweenScale(target, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenScaleDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenScale = new TweenScale(target, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenScaleDic.Add(target, tweenScale);
|
|
|
+
|
|
|
+ return tweenScale;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenScale CreateTweenScale(Transform target, Vector3 destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenScale tweenScale;
|
|
|
+
|
|
|
+ if (TweenScaleDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenScale = TweenScaleDic[target];
|
|
|
+
|
|
|
+ tweenScale.Pause();
|
|
|
+
|
|
|
+ TweenScaleDic[target] = new TweenScale(target, target.localScale, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenScaleDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenScale = new TweenScale(target, target.localScale, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenScaleDic.Add(target, tweenScale);
|
|
|
+
|
|
|
+ return tweenScale;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static TweenAudio CreateTweenAudio(Transform target, float origin, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenAudio tweenAudio;
|
|
|
+ AudioSource audio = target.GetComponent<AudioSource>();
|
|
|
+
|
|
|
+ if (TweenAudioDic.ContainsKey(audio))
|
|
|
+ {
|
|
|
+ tweenAudio = TweenAudioDic[audio];
|
|
|
+
|
|
|
+ tweenAudio.Pause();
|
|
|
+
|
|
|
+ TweenAudioDic[audio] = new TweenAudio(audio, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenAudioDic[audio];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenAudio = new TweenAudio(audio, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenAudioDic.Add(audio, tweenAudio);
|
|
|
+
|
|
|
+ return tweenAudio;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenAudio CreateTweenAudio(Transform target, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenAudio tweenAudio;
|
|
|
+ AudioSource audio = target.GetComponent<AudioSource>();
|
|
|
+
|
|
|
+ if (TweenAudioDic.ContainsKey(audio))
|
|
|
+ {
|
|
|
+ tweenAudio = TweenAudioDic[audio];
|
|
|
+
|
|
|
+ tweenAudio.Pause();
|
|
|
+
|
|
|
+ TweenAudioDic[audio] = new TweenAudio(audio, audio.volume, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenAudioDic[audio];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenAudio = new TweenAudio(audio, audio.volume, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenAudioDic.Add(audio, tweenAudio);
|
|
|
+
|
|
|
+ return tweenAudio;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenAudio CreateTweenAudio(AudioSource audioSource, float origin, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenAudio tweenAudio;
|
|
|
+
|
|
|
+ if (TweenAudioDic.ContainsKey(audioSource))
|
|
|
+ {
|
|
|
+ tweenAudio = TweenAudioDic[audioSource];
|
|
|
+
|
|
|
+ tweenAudio.Pause();
|
|
|
+
|
|
|
+ TweenAudioDic[audioSource] = new TweenAudio(audioSource, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenAudioDic[audioSource];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenAudio = new TweenAudio(audioSource, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenAudioDic.Add(audioSource, tweenAudio);
|
|
|
+
|
|
|
+ return tweenAudio;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenAudio CreateTweenAudio(AudioSource audioSource, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenAudio tweenAudio;
|
|
|
+
|
|
|
+ if (TweenAudioDic.ContainsKey(audioSource))
|
|
|
+ {
|
|
|
+ tweenAudio = TweenAudioDic[audioSource];
|
|
|
+
|
|
|
+ tweenAudio.Pause();
|
|
|
+
|
|
|
+ TweenAudioDic[audioSource] = new TweenAudio(audioSource, audioSource.volume, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenAudioDic[audioSource];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenAudio = new TweenAudio(audioSource, audioSource.volume, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenAudioDic.Add(audioSource, tweenAudio);
|
|
|
+
|
|
|
+ return tweenAudio;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ 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;
|
|
|
+
|
|
|
+ Color origin = outline.effectColor;
|
|
|
+ Color destination = outline.effectColor;
|
|
|
+
|
|
|
+ origin.a = originAlpha;
|
|
|
+ destination.a = destAlpha;
|
|
|
+
|
|
|
+ if (TweenOutlineDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenOutline = TweenOutlineDic[target];
|
|
|
+
|
|
|
+ tweenOutline.Pause();
|
|
|
+
|
|
|
+ TweenOutlineDic[target] = new TweenOutline(outline, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenOutlineDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenOutline = new TweenOutline(outline, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenOutlineDic.Add(target, tweenOutline);
|
|
|
+
|
|
|
+ return tweenOutline;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 = destAlpha;
|
|
|
+
|
|
|
+ if (TweenOutlineDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenOutline = TweenOutlineDic[target];
|
|
|
+
|
|
|
+ tweenOutline.Pause();
|
|
|
+
|
|
|
+ TweenOutlineDic[target] = new TweenOutline(graphic, graphic.effectColor, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenOutlineDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenOutline = new TweenOutline(graphic, graphic.effectColor, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenOutlineDic.Add(target, tweenOutline);
|
|
|
+
|
|
|
+ return tweenOutline;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenOutline CreateTweenOutline(Transform target, Color origin, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ Outline outline = target.GetComponent<Outline>();
|
|
|
+ TweenOutline tweenOutline;
|
|
|
+
|
|
|
+ if (TweenOutlineDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenOutline = TweenOutlineDic[target];
|
|
|
+
|
|
|
+ tweenOutline.Pause();
|
|
|
+
|
|
|
+ TweenOutlineDic[target] = new TweenOutline(outline, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenOutlineDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenOutline = new TweenOutline(outline, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenOutlineDic.Add(target, tweenOutline);
|
|
|
+
|
|
|
+ return tweenOutline;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenOutline CreateTweenOutline(Transform target, Color destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ Outline graphic = target.GetComponent<Outline>();
|
|
|
+ TweenOutline tweenOutline;
|
|
|
+
|
|
|
+ if (TweenOutlineDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenOutline = TweenOutlineDic[target];
|
|
|
+
|
|
|
+ tweenOutline.Pause();
|
|
|
+
|
|
|
+ TweenOutlineDic[target] = new TweenOutline(graphic, graphic.effectColor, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenOutlineDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenOutline = new TweenOutline(graphic, graphic.effectColor, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenOutlineDic.Add(target, tweenOutline);
|
|
|
+
|
|
|
+ return tweenOutline;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static TweenNumber CreateTweenNumber(Transform target, int origin, int destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ Text text = target.GetComponent<Text>();
|
|
|
+ TweenNumber tweenNumber;
|
|
|
+
|
|
|
+ if (TweenNumberDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenNumber = TweenNumberDic[target];
|
|
|
+
|
|
|
+ tweenNumber.Pause();
|
|
|
+
|
|
|
+ TweenNumberDic[target] = new TweenNumber(text, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenNumberDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenNumber = new TweenNumber(text, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenNumberDic.Add(target, tweenNumber);
|
|
|
+
|
|
|
+ return tweenNumber;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenNumber CreateTweenNumber(Transform target, int destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ Text text = target.GetComponent<Text>();
|
|
|
+ TweenNumber tweenNumber;
|
|
|
+
|
|
|
+ if (TweenNumberDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenNumber = TweenNumberDic[target];
|
|
|
+
|
|
|
+ tweenNumber.Pause();
|
|
|
+
|
|
|
+ TweenNumberDic[target] = new TweenNumber(text, int.Parse(text.text), destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenNumberDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenNumber = new TweenNumber(text, int.Parse(text.text), destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenNumberDic.Add(target, tweenNumber);
|
|
|
+
|
|
|
+ return tweenNumber;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ 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;
|
|
|
+
|
|
|
+ if (TweenMatFloatDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenMatFloat = TweenMatFloatDic[target];
|
|
|
+
|
|
|
+ tweenMatFloat.Pause();
|
|
|
+
|
|
|
+ TweenMatFloatDic[target] = new TweenMatFloat(target, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenMatFloatDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenMatFloat = new TweenMatFloat(target, origin, destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenMatFloatDic.Add(target, tweenMatFloat);
|
|
|
+
|
|
|
+ return tweenMatFloat;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static TweenMatFloat CreateTweenMatFloat(MaterialUnit target, float destination, float duration, bool originActive, bool destActive, Curve curve, bool cg = false)
|
|
|
+ {
|
|
|
+ TweenMatFloat tweenMatFloat;
|
|
|
+
|
|
|
+ if (TweenMatFloatDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenMatFloat = TweenMatFloatDic[target];
|
|
|
+
|
|
|
+ tweenMatFloat.Pause();
|
|
|
+
|
|
|
+ TweenMatFloatDic[target] = new TweenMatFloat(target, target.GetFloat(), destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ return TweenMatFloatDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenMatFloat = new TweenMatFloat(target, target.GetFloat(), destination, duration, originActive, destActive, curve, cg);
|
|
|
+
|
|
|
+ TweenMatFloatDic.Add(target, tweenMatFloat);
|
|
|
+
|
|
|
+ return tweenMatFloat;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static TweenGrayMesh CreateTweenGrayMesh(MeshFilter target, float origin, float destination, float duration, bool originActive, bool destActive, Curve curve)
|
|
|
+ {
|
|
|
+ TweenGrayMesh tweenGrayMesh;
|
|
|
+
|
|
|
+ if (TweenGrayMeshDic.ContainsKey(target))
|
|
|
+ {
|
|
|
+ tweenGrayMesh = TweenGrayMeshDic[target];
|
|
|
+
|
|
|
+ tweenGrayMesh.Pause();
|
|
|
+
|
|
|
+ TweenGrayMeshDic[target] = new TweenGrayMesh(target, origin, destination, duration, originActive, destActive, curve);
|
|
|
+
|
|
|
+ return TweenGrayMeshDic[target];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ tweenGrayMesh = new TweenGrayMesh(target, origin, destination, duration, originActive, destActive, curve);
|
|
|
+
|
|
|
+ TweenGrayMeshDic.Add(target, tweenGrayMesh);
|
|
|
+
|
|
|
+ return tweenGrayMesh;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
}
|