예제 #1
0
        //This is for editor scripts.
        public IEnumerator UploadConfig(IConfigData data)
        {
            if (!IsUploadScene() || !Application.isEditor)
            {
                logger.LogError(Tag, "Uploading is only allowed from upload scene & in unity editor");
                yield break;
            }


            JsonData jsonData = JsonMapper.ToObject(JsonMapper.ToJson(data, true));

            jsonData       = PreSend(jsonData, data.GetId(), data.GetTableName(), IsBlobObject(data));
            jsonData["id"] = data.GetId();
            JsonData jd = new JsonData();

            jd.Add(jsonData);

//			Debug.Log(jd.ToJson());

            string tableName = data.GetTableName();

            tableName = AdjustTableToServerTableName(tableName, data);


            yield return(_coroutineFactory.StartCoroutine(() => _connectionHandler.SendRequest(ConnectionHandler.RequestType.UploadConfig, HandleUploadConfigRepsonse, jd.ToJson(), null, tableName)));
        }