public IClientCmd decodeBSON(BSONObject obj) { //Debug.Log("Try to decode !"); if (obj.ContainsKey("meta")) { string meta = obj ["meta"]; //Debug.Log ("Meta:" + meta); Type t = Type.GetType("UnityBSONClient." + meta); if (t == null) { //Debug.Log ("Meta:" + meta + " not found"); return(null); } IClientCmd cmd = (IClientCmd)Activator.CreateInstance(t); cmd.decode(obj); return(cmd); } return(null); }