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))); }
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));
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)); }
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)); }
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)); }
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))); }
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));
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)); }
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)); }
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)); }
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)); }
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)); }
public static Coroutine To(this Vector2 from, Vector2 to, float duration, EaseType ease) => Greasy.To(from, to, duration, ease, setter: (x => from = x));
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)); }
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)); }
public static Coroutine To(this Color from, Color to, float duration, EaseMethod ease) => Greasy.To(from, to, duration, ease, setter: (x => from = x));
public static Coroutine To(this Vector3 from, Vector3 to, float duration, EaseMethod ease) => Greasy.To(from, to, duration, ease, setter:(x => from = x));
public static Coroutine To(this Quaternion from, Quaternion to, float duration, EaseMethod ease) => Greasy.To(from, to, duration, ease, setter: (x => from = x));