using System;
using System.Collections;
using JetBrains.Annotations;
using UnityEngine;
namespace PrimeTween {
public partial struct Tween : IEnumerator {
/// Use this method to wait for an animation in coroutines.
/// NOTE: stopping a coroutine early with StopCoroutine() (or destroying the parent MonoBehaviour) will prevent PrimeTween from reusing the returned IEnumerator and will leave it to GC to clean.
/// This means that stopping the coroutine while it's waiting for an animation will produce a small amount of GC garbage. Consider using `while (animation.isAlive) yield return null;` instead to prevent allocations in this case.
///
/// IEnumerator Coroutine() {
/// yield return Tween.Delay(1).ToYieldInstruction();
/// }
///
[NotNull]
public IEnumerator ToYieldInstruction() {
if (!isAlive || !TryManipulate()) {
return Array.Empty