/// <summary>Checks predicate every frame until predicate resolves to true and then calls action.</summary>
 /// <param name="mb">The Monobehaviour to run this from.</param>
 /// <param name="actionToCall">The action to call when predicate fulfilled.</param>
 /// <param name="predicate">The predicate to check for every frame.</param>
 public static Coroutine ActionWhenPredicate(this MonoBehaviour mb, Action actionToCall, Func <bool> predicate)
 {
     return(mb.ActiveInHierarchy() ? mb.StartCoroutine(mb.ActionWhenPredicateCoroutine(actionToCall, predicate)) : null);
 }