public IEnumerator HasCompletedObjective(ObjectiveScript script) { //reset the script's completed state script.Reset(); script.CheckIfCompleted(); //wait for the script to finish checking while (!script.FinishedChecking) { yield return(null); } //add completed state to objective's completed state //TryToComplete will automatically break if State.Completed returns false State.Completed &= script.HasCompleted; if (script.Status != MissionStatus.Dormant) { State.Status |= script.Status; } yield break; }