title: Asynchronous programming in Unity
body: <p>I'm doing the process of adding sequential images directories in a folder in a folder to the Dictionary list value as Texture2d.</p>
  
  <p>At this time, I need to show the loading window with the animator and lose the data after the data is loaded. But animator because the code runs fast, no action has taken place.</p>
  
  <p>Can you help me with this?</p>
  
  <p>The following is the code block.</p>
  
  <pre><code>public void DataActives(string defStrings)
  {
      atorLoadingPanel.SetBool("ActiveLoad", true);
      TaskAsyncCountDown(2,"Wait");
      this.gameObject.GetComponent&lt;PCManager&gt;().TypeString = defStrings;
      float CaseControl = TimePanelVariablesChanges();
      switch (CaseControl)
      {
          case 0:
              this.gameObject.GetComponent&lt;PCManager&gt;().Daily();
              //Debug.Log("Case 1");
              break;
          case 1:
              this.gameObject.GetComponent&lt;PCManager&gt;().Weekly();
              //Debug.Log("Case 2");
              break;
          case 2:
              this.gameObject.GetComponent&lt;PCManager&gt;().Monthly();
              //Debug.Log("Case 3");
              break;
          case 3:
              this.gameObject.GetComponent&lt;PCManager&gt;().Yearly();
              //Debug.Log("Case 4");
              break;
          default:
              //Debug.Log("Hata Fırlat");
              break;
      }
      this.gameObject.GetComponent&lt;PCManager&gt;().ShowData();
  }
  
  
  public async Task TaskAsyncCountDown(int count, string flag = "")
  {
      for (int i = count; i &gt;= 0; i--)
      {
          LogToTUnityConsole(i, flag);
          await Task.Delay(1000).ConfigureAwait(false);
      }
      atorLoadingPanel.SetBool("ActiveLoad", false);
  }
  </code></pre>