Beispiel #1
0
        public static void ScaleTo(GameObject tweenObject, Vector2 from, Vector2 to, TweenParam tweenParam)
        {
            Tweener tweener   = new Scale2D(tweenObject, from, to);
            float   deltaMove = GetDeltaMove(from, to, tweenParam._DurationOrSpeed, true);

            SetTweenParam(tweener, deltaMove, tweenParam);
        }
Beispiel #2
0
        private static void Color(GameObject tweenObject, Color from, Color to, TweenParam tweenParam, bool isTimeDependent)
        {
            Tweener tweener = null;

            if (tweenObject.GetComponent <Renderer>() != null)
            {
                tweener = new Colour(tweenObject, tweenObject.GetComponent <Renderer>(), from, to);
            }
            else if (tweenObject.GetComponent <TextMesh>() != null)
            {
                tweener = new TextMeshColor(tweenObject, tweenObject.GetComponent <TextMesh>(), from, to);
            }
            else if (tweenObject.GetComponent <Graphic>() != null)
            {
                tweener = new GraphicColor(tweenObject, tweenObject.GetComponent <Graphic>(), from, to);
            }
            else
            {
                Debug.Log("================  Color Component Not Available ================= " + tweenObject.name);
                return;
            }

            float deltaMove = GetDeltaMove(from, to, tweenParam._DurationOrSpeed, isTimeDependent);

            SetTweenParam(tweener, deltaMove, tweenParam);
        }
Beispiel #3
0
        public static void ScaleBy(GameObject tweenObject, Vector3 from, Vector3 to, TweenParam tweenParam)
        {
            Tweener tweener   = new Scale(tweenObject, from, to);
            float   deltaMove = GetDeltaMove(from, to, tweenParam._DurationOrSpeed, false);

            SetTweenParam(tweener, deltaMove, tweenParam);
        }
Beispiel #4
0
        private static void Alpha(GameObject tweenObject, float from, float to, TweenParam tweenParam, bool isTimeDependent)
        {
            Renderer rend = tweenObject.GetComponent <Renderer>();

            if (rend == null)
            {
                Debug.Log("================  Renderer Component Not Available ================= " + tweenObject.name);
                return;
            }

            Tweener tweener   = new Alpha(tweenObject, rend, from, to);
            float   deltaMove = GetDeltaMove(from, to, tweenParam._DurationOrSpeed, isTimeDependent);

            SetTweenParam(tweener, deltaMove, tweenParam);
        }
Beispiel #5
0
 private static void SetTweenParam(Tweener tweener, float deltaMove, TweenParam tweenParam)
 {
     tweener.SetData(deltaMove, tweenParam._Delay, tweenParam._LoopCount, tweenParam._PingPong, tweenParam._UseAnimationCurve, tweenParam._AnimationCurve, tweenParam.pCustomAnimationCurve, tweenParam.pOnTweenCompleteCallback);
     TweenUpdater.pTweeners.Add(tweener);
 }
Beispiel #6
0
        private static void TextCounter(GameObject tweenObject, float from, float to, TweenParam tweenParam, bool isTimeDependent)
        {
            Tweener tweener = null;

            if (tweenObject.GetComponent <Text>() != null)
            {
                tweener = new Count(tweenObject, tweenObject.GetComponent <Text>(), from, to);
            }
            else if (tweenObject.GetComponent <TextMesh>() != null)
            {
                tweener = new Count(tweenObject, tweenObject.GetComponent <TextMesh>(), from, to);
            }
            else
            {
                Debug.Log("================  Text Component Not Available ================= " + tweenObject.name);
                return;
            }

            float deltaMove = GetDeltaMove(from, to, tweenParam._DurationOrSpeed, isTimeDependent);

            SetTweenParam(tweener, deltaMove, tweenParam);
        }
Beispiel #7
0
 public static void TextCounterBy(GameObject tweenObject, float from, float to, TweenParam tweenParam)
 {
     TextCounter(tweenObject, from, to, tweenParam, false);
 }
Beispiel #8
0
 public static void AlphaBy(GameObject tweenObject, float from, float to, TweenParam tweenParam)
 {
     Alpha(tweenObject, from, to, tweenParam, false);
 }
Beispiel #9
0
 public static void ColorBy(GameObject tweenObject, Color from, Color to, TweenParam tweenParam)
 {
     Color(tweenObject, from, to, tweenParam, false);
 }
Beispiel #10
0
        public static void RotateLocalTo(GameObject tweenObject, Vector3 from, Vector3 to, TweenParam tweenParam)
        {
            Tweener tweener   = new RotateLocal(tweenObject, from, to);
            float   deltaMove = GetDeltaMove(from, to, tweenParam._DurationOrSpeed, true);

            SetTweenParam(tweener, deltaMove, tweenParam);
        }