<commit_before>﻿using UnityEngine;
using System.Collections;
using System;
using UniRx;

namespace TweenRx
{

    public static class Tween
    {
        public enum EaseType
        {
            Linear,
            EaseInQuad,
            EaseOutQuad,
            EaseInOutQuad,
            EaseInCubic,
            EaseOutCubic,
            EaseInOutCubic,
            EaseInQuart,
            EaseOutQuart,
            EaseInOutQuart,
            EaseInQuint,
            EaseOutQuint,
            EaseInOutQuint,
            EaseInSine,
            EaseOutSine,
            EaseInOutSine,
            EaseInExpo,
            EaseOutExpo,
            EaseInOutExpo,
            EaseInCirc,
            EaseOutCirc,
            EaseInOutCirc
        }

        #if UNITY_5_5

        public static IObservable<Vector2> Play(Vector2 start, Vector2 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector2.Lerp(start, end, t));
        }

        public static IObservable<Vector3> Play(Vector3 start, Vector3 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector3.Lerp(start, end, t));
        }

        public static IObservable<Vector4> Play(Vector4 start, Vector4 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector4.Lerp(start, end, t));
        }

        #endif

        #region For Unity 5.4 or lower

        public static IObservable<Vector2> PlayV2(Vector2 start, Vector2 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector2.Lerp(start, end, t));
        }

        public static IObservable<Vector3> PlayV3(Vector3 start, Vector3 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector3.Lerp(start, end, t));
        }

        public static IObservable<Vector4> PlayV4(Vector4 start, Vector4 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector4.Lerp(start, end, t));
        }

        #endregion

        public static IObservable<float> Play(float start, float end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(start, end, duration, easeType, delayBefore, delayAfter);
        }

        public static IObservable<Color> Play(Color start, Color end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Color.Lerp(start, end, t));
        }

        public static IObservable<Quaternion> Play(Quaternion start, Quaternion end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Quaternion.Lerp(start, end, t));
        }

        public static IObservable<Vector2> TweenToV2(this Vector2 start, Vector2 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector2.Lerp(start, end, t));
        }

        public static IObservable<Vector3> TweenToV3(this Vector3 start, Vector3 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector3.Lerp(start, end, t));
        }

        public static IObservable<Vector4> TweenToV4(this Vector4 start, Vector4 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector4.Lerp(start, end, t));
        }

        public static IObservable<float> TweenTo(this float start, float end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(start, end, duration, easeType, delayBefore, delayAfter);
        }

        public static IObservable<Color> TweenTo(this Color start, Color end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Color.Lerp(start, end, t));
        }

        public static IObservable<Quaternion> TweenTo(this Quaternion start, Quaternion end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Quaternion.Lerp(start, end, t));
        }
<commit_msg>Fix method for Unity 5.5<commit_after>﻿using UnityEngine;
using System.Collections;
using System;
using UniRx;

namespace TweenRx
{

    public static class Tween
    {
        public enum EaseType
        {
            Linear,
            EaseInQuad,
            EaseOutQuad,
            EaseInOutQuad,
            EaseInCubic,
            EaseOutCubic,
            EaseInOutCubic,
            EaseInQuart,
            EaseOutQuart,
            EaseInOutQuart,
            EaseInQuint,
            EaseOutQuint,
            EaseInOutQuint,
            EaseInSine,
            EaseOutSine,
            EaseInOutSine,
            EaseInExpo,
            EaseOutExpo,
            EaseInOutExpo,
            EaseInCirc,
            EaseOutCirc,
            EaseInOutCirc
        }

        #if UNITY_5_5_OR_NEWER

        public static IObservable<Vector2> Play(Vector2 start, Vector2 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector2.Lerp(start, end, t));
        }

        public static IObservable<Vector3> Play(Vector3 start, Vector3 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector3.Lerp(start, end, t));
        }

        public static IObservable<Vector4> Play(Vector4 start, Vector4 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector4.Lerp(start, end, t));
        }

        #endif

        #if UNITY_5_5_OR_NEWER
        [System.Obsolete("Use Play()")]
        #endif
        public static IObservable<Vector2> PlayV2(Vector2 start, Vector2 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector2.Lerp(start, end, t));
        }

        #if UNITY_5_5_OR_NEWER
        [System.Obsolete("Use Play()")]
        #endif
        public static IObservable<Vector3> PlayV3(Vector3 start, Vector3 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector3.Lerp(start, end, t));
        }

        #if UNITY_5_5_OR_NEWER
        [System.Obsolete("Use Play()")]
        #endif
        public static IObservable<Vector4> PlayV4(Vector4 start, Vector4 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector4.Lerp(start, end, t));
        }

        public static IObservable<float> Play(float start, float end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(start, end, duration, easeType, delayBefore, delayAfter);
        }

        public static IObservable<Color> Play(Color start, Color end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Color.Lerp(start, end, t));
        }

        public static IObservable<Quaternion> Play(Quaternion start, Quaternion end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Quaternion.Lerp(start, end, t));
        }

        #if UNITY_5_5_OR_NEWER

        public static IObservable<Vector2> TweenTo(this Vector2 start, Vector2 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector2.Lerp(start, end, t));
        }

        public static IObservable<Vector3> TweenTo(this Vector3 start, Vector3 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector3.Lerp(start, end, t));
        }

        public static IObservable<Vector4> TweenTo(this Vector4 start, Vector4 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector4.Lerp(start, end, t));
        }

        #endif

        #if UNITY_5_5_OR_NEWER
        [System.Obsolete("Use TweenTo()")]
        #endif
        public static IObservable<Vector2> TweenToV2(this Vector2 start, Vector2 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector2.Lerp(start, end, t));
        }

        #if UNITY_5_5_OR_NEWER
        [System.Obsolete("Use TweenTo()")]
        #endif
        public static IObservable<Vector3> TweenToV3(this Vector3 start, Vector3 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector3.Lerp(start, end, t));
        }

        #if UNITY_5_5_OR_NEWER
        [System.Obsolete("Use TweenTo()")]
        #endif
        public static IObservable<Vector4> TweenToV4(this Vector4 start, Vector4 end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Vector4.Lerp(start, end, t));
        }

        public static IObservable<float> TweenTo(this float start, float end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(start, end, duration, easeType, delayBefore, delayAfter);
        }

        public static IObservable<Color> TweenTo(this Color start, Color end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Color.Lerp(start, end, t));
        }

        public static IObservable<Quaternion> TweenTo(this Quaternion start, Quaternion end, float duration = 1, EaseType easeType = EaseType.Linear, float delayBefore = 0, float delayAfter = 0)
        {
            return Execute(0, 1, duration, easeType, delayBefore, delayAfter).Select(t => Quaternion.Lerp(start, end, t));
        }

{'fraction_non_alphanumeric': 0.09587112918360964, 'fraction_numerical': 0.021504535502033156, 'mean_word_length': 2.6983805668016196, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 65, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3843480', 'n_tokens_mistral': 4016, 'n_tokens_neox': 3804, 'n_words': 1088}