title: SetActive() can only be called from the main thread
body: <p>I am stuck with this problem for 3 days, I did a lot of research, but couldn't find any answer, Here is a brief explanation of what is happening, trying to work with Firebase Database and Authentication with Unity3D, Here are the steps:</p>
  
  <p>First user signs in and if it's successful, it will fetch user's data from Database and then Authentication panel should be deactivated and User's panel activated. </p>
  
  <p>It Gives me this error when trying to SetActive panel. </p>
  
  <p><strong>SetActive can only be called from the main thread.
  Constructors and field initializers will be executed from the loading thread when loading a scene.
  Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
  UnityEngine.GameObject:SetActive(Boolean)</strong></p>
  
  <pre><code>public void SignInWithEmail()
  {
      auth.SignInWithEmailAndPasswordAsync(email, password).ContinueWith(task =&gt; {
        DatabaseReference.GetValueAsync().ContinueWith(task =&gt; {
  
          //here after successful signing in, it gets the data from the Database
          //and after that it should activate the user panel
          //and deactivate the authentication panel
  
          //HERE IS THE PROBLEM 
          userPanel.SetActive(true);
          authPanel.SetActive(false);
      }
    }
  }
  </code></pre>
  
  <p>I'm not trying to load another scene or anything else.</p>
  
  <h2>If needed I can provide more information</h2>