示例#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));