예제 #1
0
        public static Coroutine FloatTo(this AudioMixer audioMixer, string name, float to, float duration, EaseMethod ease)
        {
            if (!audioMixer.GetFloat(name, out float from))
            {
                throw new System.Exception($"Audio Mixer doesn't have a float called '{name} or is currently being edited.'");
            }

            return(Greasy.To(from, to, duration, ease, x => audioMixer.SetFloat(name, x)));
        }
예제 #2
0
 public static Coroutine PositionTo(this Transform transform, Vector3 to, float duration, EaseType ease)
 => Greasy.To(transform.position, to, duration, ease, setter: (x => transform.position = x));
예제 #3
0
 public static Coroutine ScaleTo(this Transform transform, Vector3 to, float duration, EaseMethod ease)
 {
     return(Greasy.To(transform.localScale, to, duration, ease, x => transform.localScale = x));
 }
예제 #4
0
 public static Coroutine LookTo(this Transform transform, Vector3 to, Vector3 up, float duration, EaseMethod ease)
 {
     return(Greasy.To(transform.rotation, Quaternion.LookRotation(to - transform.position, up), duration, ease, x => transform.localRotation = x));
 }
예제 #5
0
 public static Coroutine LocalRotationTo(this Transform transform, Quaternion to, float duration, EaseMethod ease)
 {
     return(Greasy.To(transform.localRotation, to, duration, ease, x => transform.localRotation = x));
 }
예제 #6
0
 public static Coroutine RotationTo(this Transform transform, Quaternion to, float duration, EaseType ease)
 {
     return(Greasy.To(transform.rotation, to, duration, ease, setter: (x => transform.rotation = x)));
 }
예제 #7
0
 public static Coroutine LocalPositionTo(this Transform transform, Vector3 to, float duration, EaseMethod ease)
 => Greasy.To(transform.localPosition, to, duration, ease, setter: (x => transform.localPosition = x));
예제 #8
0
 public static Coroutine IntensityTo(this Light light, float to, float duration, EaseMethod ease)
 {
     return(Greasy.To(light.intensity, to, duration, ease, x => light.intensity = x));
 }
예제 #9
0
 public static Coroutine BackgroundColorTo(this Camera camera, Color to, float duration, EaseType ease = EaseType.Linear)
 {
     return(Greasy.To(camera.backgroundColor, to, duration, ease, x => camera.backgroundColor = x));
 }
예제 #10
0
 public static Coroutine FieldOfViewTo(this Camera camera, float to, float duration, EaseMethod ease)
 {
     return(Greasy.To(camera.fieldOfView, to, duration, ease, x => camera.fieldOfView = x));
 }
예제 #11
0
 public static Coroutine VolumeTo(this AudioSource source, float to, float duration, EaseType ease)
 {
     return(Greasy.To(source.volume, to, duration, ease, x => source.volume = x));
 }
예제 #12
0
 public static Coroutine PitchTo(this AudioSource source, float to, float duration, EaseMethod ease)
 {
     return(Greasy.To(source.pitch, to, duration, ease, x => source.pitch = x));
 }
예제 #13
0
 public static Coroutine To(this Vector2 from, Vector2 to, float duration, EaseType ease)
 => Greasy.To(from, to, duration, ease, setter: (x => from = x));
예제 #14
0
 public static Coroutine ColorTo(this Light light, Color to, float duration, EaseType ease)
 {
     return(Greasy.To(light.color, to, duration, ease, x => light.color = x));
 }
예제 #15
0
 public static Coroutine ShadowStrengthTo(this Light light, float to, float duration, EaseMethod ease)
 {
     return(Greasy.To(light.shadowStrength, to, duration, ease, x => light.shadowStrength = x));
 }
예제 #16
0
 public static Coroutine To(this Color from, Color to, float duration, EaseMethod ease)
 => Greasy.To(from, to, duration, ease, setter: (x => from = x));
예제 #17
0
 public static Coroutine To(this Vector3 from, Vector3 to, float duration, EaseMethod ease)
     => Greasy.To(from, to, duration, ease, setter:(x => from = x));
예제 #18
0
 public static Coroutine To(this Quaternion from, Quaternion to, float duration, EaseMethod ease)
 => Greasy.To(from, to, duration, ease, setter: (x => from = x));