title: SimpleJSON Unity Exception: Error deserializing JSON. Unknown tag: 123
body: <p>I'm Getting this error when accessing data from a json file. </p>
  
  <p>I'm trying to follow the following tutorial: <a href="http://wiki.unity3d.com/index.php/SimpleJSON" rel="nofollow">http://wiki.unity3d.com/index.php/SimpleJSON</a></p>
  
  <p>and created a test.json file, that I want to extract data from containing:</p>
  
  <pre><code>{
      "version": "1.0",
      "data": {
          "sampleArray": [
              "string value",
              5,
              {
                  "name": "sub object"
              }
          ]
      }
  }
  </code></pre>
  
  <p>using the following code in Unity:</p>
  
  <pre><code>void LoadFiles()
  {
  
      FileInfo f = m_info[0]; //Array of Files in Folder
      // I had a foreach loop here, but wanted to specify the file for testing before I tried to parse through one of my own
  
      print("I Found : " + f);
      var N = JSONNode.LoadFromFile(f.FullName);
      var versionString = N["version"].Value;        // versionString will be a string containing "1.0"
      var versionNumber = N["version"].AsFloat;      // versionNumber will be a float containing 1.0
      var name = N["data"]["sampleArray"][2]["name"];// name will be a string containing "sub object"
      print("vs=" + versionString + " vn=" + versionNumber + " name=" + name);
  }
  </code></pre>
  
  <p>and all i get is Unknown tags, from what I gather from the source :</p>
  
  <pre><code>public static JSONNode Deserialize(System.IO.BinaryReader aReader)
      {
          JSONBinaryTag type = (JSONBinaryTag)aReader.ReadByte();
          switch(type)
          {
          case JSONBinaryTag.Array:
          {
              int count = aReader.ReadInt32();
              JSONArray tmp = new JSONArray();
              for(int i = 0; i &lt; count; i++)
                  tmp.Add(Deserialize(aReader));
              return tmp;
          }
          case JSONBinaryTag.Class:
          {
              int count = aReader.ReadInt32();                
              JSONClass tmp = new JSONClass();
              for(int i = 0; i &lt; count; i++)
              {
                  string key = aReader.ReadString();
                  var val = Deserialize(aReader);
                  tmp.Add(key, val);
              }
              return tmp;
          }
          case JSONBinaryTag.Value:
          {
              return new JSONData(aReader.ReadString());
          }
          case JSONBinaryTag.IntValue:
          {
              return new JSONData(aReader.ReadInt32());
          }
          case JSONBinaryTag.DoubleValue:
          {
              return new JSONData(aReader.ReadDouble());
          }
          case JSONBinaryTag.BoolValue:
          {
              return new JSONData(aReader.ReadBoolean());
          }
          case JSONBinaryTag.FloatValue:
          {
              return new JSONData(aReader.ReadSingle());
          }
  
          default:
          {
              throw new Exception("Error deserializing JSON. Unknown tag: " + type);
          }
          }
      }
  </code></pre>
  
  <p>I'm falling all the way through the Switch, but with .Value or .AsFloat I should hit those case statements. Any Idea what's going on, is this code to old for Unity 5.0 ?</p>