/// <summary> /// Start the tweening operation. /// </summary> static public TweenAlpha Begin(GameObject go, float duration, float targetVolume) { TweenAlpha comp = ThunderTweener.Begin <TweenAlpha>(go, duration); comp.from = comp.value; comp.to = targetVolume; if (targetVolume > 0f) { var s = comp.image; s.enabled = true; } return(comp); }
/// <summary> /// Start the tweening operation. /// </summary> static public TweenTransform Begin(GameObject go, float duration, Transform from, Transform to) { TweenTransform comp = ThunderTweener.Begin <TweenTransform>(go, duration); comp.from = from; comp.to = to; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } return(comp); }
/// <summary> /// Start the tweening operation. /// </summary> static public TweenScale Begin(GameObject go, float duration, Vector3 scale) { TweenScale comp = ThunderTweener.Begin <TweenScale>(go, duration); comp.from = comp.value; comp.to = scale; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } return(comp); }
/// <summary> /// Start the tweening operation. /// </summary> static public TweenFOV Begin(GameObject go, float duration, float to) { TweenFOV comp = ThunderTweener.Begin <TweenFOV>(go, duration); comp.from = comp.value; comp.to = to; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } return(comp); }
/// <summary> /// Start the tweening operation. /// </summary> static public TweenPosition Begin(GameObject go, float duration, Vector3 pos) { TweenPosition comp = ThunderTweener.Begin <TweenPosition>(go, duration); comp.from = comp.value; comp.to = pos; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } return(comp); }
/// <summary> /// Start the tweening operation. /// </summary> static public TweenRotation Begin(GameObject go, float duration, Quaternion rot) { TweenRotation comp = ThunderTweener.Begin <TweenRotation>(go, duration); comp.from = comp.value.eulerAngles; comp.to = rot.eulerAngles; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } return(comp); }
/// <summary> /// Start the tweening operation. /// </summary> static public TweenVolume Begin(GameObject go, float duration, float targetVolume) { TweenVolume comp = ThunderTweener.Begin <TweenVolume>(go, duration); comp.from = comp.value; comp.to = targetVolume; if (targetVolume > 0f) { var s = comp.audioSource; s.enabled = true; s.Play(); } return(comp); }