title: Unity Serializing object to Json
body: <p>I'm trying to simply serialize a object into json in Unity. I have found several articles on this topic but nothing seems to be working. It is not throwing a exception directly but it is not converting the object to a json string. I have researched the pretty heavily and tried various samples. I'm not sure if the issue is the class or the logic calling the convert to json. I can easily convert using .net but this is for Unity in MonoScript, so the process seems to be a little different. I assume when you convert the object to json string it should not list the base as "null". Its also passing in a empty json string after conversion.  </p>
  
  <p><a href="https://i.stack.imgur.com/aVJGQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aVJGQ.png" alt="enter image description here"></a></p>
  
  <p>User LogIn Class:</p>
  
  <pre><code>    using UnityEngine;
  using System.Collections;
  using System;
  
  [Serializable]
  public class UserLogIn : MonoBehaviour
  {
      public string Email;
      public string Password;
  }
  </code></pre>
  
  <p>Here is my code in unity script:</p>
  
  <pre><code>private UserLogIn _LogIn = new UserLogIn();
  
      public void SetText(string text)
      {
          //[SerializeField]
          //UserLogIn _LogIn = new UserLogIn();
      //WhiteBoxGamingTestRequest();  
      _LogIn.Email = "testemail@gmail.com";
          _LogIn.Password = "12345";
          string json = JsonUtility.ToJson(_LogIn);
          Debug.Log(json);
  
          //User_LogIn(_login);
  
          //text = _bolResponse.ToString();
          //Text txt = transform.Find("Text").GetComponent&lt;Text&gt;();
          //txt.text = text;       
      }
  </code></pre>
  
  <p>I've tried this:
  <a href="https://stackoverflow.com/questions/36239705/serialize-and-deserialize-json-and-json-array-in-unity">Serialize and Deserialize Json and Json Array in Unity</a></p>
  
  <p>seems to not work still. Looking for suggestions or corrections. </p>
  
  <p>After conversion json = {} it should be a string containing values. Is Unity's json converter broken? </p>
  
  <p>Conversion:
  <a href="https://i.stack.imgur.com/ueOeJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ueOeJ.png" alt="enter image description here"></a></p>