/// <summary> /// Start the tweening operation. /// </summary> static public UTweenTransform Begin(GameObject go, float duration, Transform from, Transform to) { UTweenTransform comp = UTweener.Begin <UTweenTransform>(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 UTweenPosition Begin(GameObject go, float duration, Vector3 pos) { UTweenPosition comp = UTweener.Begin <UTweenPosition>(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 UTweenScale Begin(GameObject go, float duration, Vector3 scale) { UTweenScale comp = UTweener.Begin <UTweenScale>(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 UTweenRotation Begin(GameObject go, float duration, Quaternion rot) { UTweenRotation comp = UTweener.Begin <UTweenRotation>(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 UTweenColor Begin(GameObject go, float duration, Color color) { #if UNITY_EDITOR if (!Application.isPlaying) { return(null); } #endif UTweenColor comp = UTweener.Begin <UTweenColor>(go, duration); comp.from = comp.value; comp.to = color; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } return(comp); }