\begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}] \PYG{k}{private}\PYG{+w}{ }\PYG{k}{void}\PYG{+w}{ }\PYG{n+nf}{Start}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} \PYG{+w}{ }\PYG{n}{Debug}\PYG{p}{.}\PYG{n}{Log}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}Start method\PYGZdq{}}\PYG{p}{);} \PYG{+w}{ }\PYG{n}{StartCoroutine}\PYG{p}{(}\PYG{n}{TestCoroutine}\PYG{p}{());} \PYG{+w}{ }\PYG{n}{Debug}\PYG{p}{.}\PYG{n}{Log}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}Start method ends\PYGZdq{}}\PYG{p}{);} \PYG{p}{\PYGZcb{}} \PYG{c+c1}{// this coroutine has a loop that runs as along as the calling object is active} \PYG{k}{private}\PYG{+w}{ }\PYG{n}{IEnumerator}\PYG{+w}{ }\PYG{n+nf}{TestCoroutine}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} \PYG{+w}{ }\PYG{n}{Debug}\PYG{p}{.}\PYG{n}{Log}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}TestCoroutine\PYGZdq{}}\PYG{p}{);} \PYG{+w}{ }\PYG{k}{while}\PYG{p}{(}\PYG{k}{true}\PYG{p}{)} \PYG{+w}{ }\PYG{p}{\PYGZob{}} \PYG{+w}{ }\PYG{n}{Debug}\PYG{p}{.}\PYG{n}{Log}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}Here\PYGZdq{}}\PYG{p}{);} \PYG{+w}{ }\PYG{k}{yield}\PYG{+w}{ }\PYG{k}{return}\PYG{+w}{ }\PYG{k}{null}\PYG{p}{;} \PYG{+w}{ }\PYG{n}{Debug}\PYG{p}{.}\PYG{n}{Log}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}There\PYGZdq{}}\PYG{p}{);} \PYG{+w}{ }\PYG{p}{\PYGZcb{}} \PYG{p}{\PYGZcb{}} \PYG{k}{private}\PYG{+w}{ }\PYG{k}{void}\PYG{+w}{ }\PYG{n+nf}{Update}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}} \PYG{+w}{ }\PYG{n}{Debug}\PYG{p}{.}\PYG{n}{Log}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}Update\PYGZdq{}}\PYG{p}{);} \PYG{p}{\PYGZcb{}} \PYG{c+c1}{// Output should be:} \PYG{c+cm}{/*} \PYG{c+cm}{Start method} \PYG{c+cm}{TestCoroutine} \PYG{c+cm}{Here} \PYG{c+cm}{Start method ends} \PYG{c+cm}{Update} \PYG{c+cm}{There} \PYG{c+cm}{Here} \PYG{c+cm}{Update} \PYG{c+cm}{There} \PYG{c+cm}{Here} \PYG{c+cm}{*/} \end{Verbatim}