Example #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)));
        }
Example #2
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));
 }
Example #3
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)));
 }
Example #4
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));
 public static Coroutine To(this Vector3Int from, Vector3Int to, float duration, EaseType ease)
 => Greasy.To(from, to, duration, ease, setter: (x => from = x));
Example #6
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));
 }
Example #7
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));
 }
Example #8
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));
Example #9
0
        public static Coroutine FloatTo(this Material material, string name, float to, float duration, EaseType ease)
        {
            float from = material.GetFloat(name);

            return(Greasy.To(from, to, duration, ease, setter: (x => from = x)));
        }
Example #10
0
 public static Coroutine To(this Color from, Color to, float duration, EaseType ease)
 => Greasy.To(from, to, duration, ease, setter: (x => from = x));
Example #11
0
 public static Coroutine PivotTo(this RectTransform transform, Vector2 to, float duration, EaseMethod ease)
 {
     return(Greasy.To(transform.pivot, to, duration, ease, x => transform.pivot = 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));
 }
Example #14
0
 public static Coroutine To(this Quaternion from, Quaternion to, float duration, EaseType ease)
 => Greasy.To(from, to, duration, ease, setter: (x => from = x));
Example #15
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));
 }
Example #16
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));
 }
Example #17
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));
 }
Example #18
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));
 }
Example #19
0
 public static Coroutine To(this int from, int to, float duration, EaseMethod ease)
 => Greasy.To(from, to, duration, ease, setter: (x => from = x));
Example #20
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));
 }