title: Having both IEnumerator Start() and void Start() in a single script
body: <p>I have a sample program from Unity's documentation pages that contains an <code>IEnumerator Start()</code> as seen below, but I wonder how I can also have a normal <code>void Start()</code> in the same script?</p>
  
  <p>I tried adding the <code>void Start()</code> as well, but it threw an error. Then, I tried including my code (which is just writing to console the application's data path) in an <code>IEnumerator</code> function though executing it immediately by using <code>0f</code> for delay parameter, but it would not print out anything...</p>
  
  <p>What am I missing? What is the usual solution to such a situation where you have to have an <code>IEnumerator Start()</code> but you also need to execute starting code?</p>
  
  <pre><code>/// Saves screenshots as PNG files.
  public class PNGers : MonoBehaviour
  {
  
      // Take a shot immediately.
      IEnumerator Start()
      {
          yield return UploadPNG();
          yield return ConsoleMSG();
      }
  
      IEnumerator UploadPNG()
      {
          // We should only read the screen buffer after frame rendering is complete.
          yield return new WaitForEndOfFrame();
  
          // Create a texture the size of the screen, with RGB24 format.
          int width = Screen.width;
          int height = Screen.height;
          Texture2D tex = new Texture2D(width, height, TextureFormat.RGB24, false);
  
          // Read the screen contents into the texture.
          tex.ReadPixels( new Rect(0, 0, width, height), 0, 0 );
          tex.Apply();
  
          // Encode the texture into PNG format.
          byte[] bytes = tex.EncodeToPNG();
          Object.Destroy(tex);
  
          // For testing purposes, also write to a file in the project folder:
          File.WriteAllBytes(Application.dataPath + "/../SavedScreen.png", bytes);
  
      }
  
      IEnumerator ConsoleMSG()
      {
          yield return new WaitForSeconds(0f);
          Debug.Log(Application.dataPath);
      }
  }
  </code></pre>