diff --git a/xiaofang/Assets/Script/UI/SelectScenePanel.cs b/xiaofang/Assets/Script/UI/SelectScenePanel.cs index de8b1530..de8a61bc 100644 --- a/xiaofang/Assets/Script/UI/SelectScenePanel.cs +++ b/xiaofang/Assets/Script/UI/SelectScenePanel.cs @@ -55,8 +55,8 @@ public class SelectScenePanel : MonoBehaviour this.schoolName = item.schoolName; } } - Debug.Log("###############1:"+ this.schoolId); - Debug.Log("###############2:" + this.schoolName); + //Debug.Log("###############1:"+ this.schoolId); + //Debug.Log("###############2:" + this.schoolName); } //事件及难度选择 public void SelectEvent() @@ -71,20 +71,22 @@ public class SelectScenePanel : MonoBehaviour this.eventName = item.eventName; } } - Debug.Log("%%%%%%%%%%%%%1:"+ this.eventId); - Debug.Log("%%%%%%%%%%%%%2:" + this.eventName); + //Debug.Log("%%%%%%%%%%%%%1:"+ this.eventId); + //Debug.Log("%%%%%%%%%%%%%2:" + this.eventName); } //游戏难度选择 public void SelsctDifficulty() { + auth_createTemplate auth_CreateTemplate = new auth_createTemplate(); foreach(Toggle item in difficultyList) { if (item.isOn) { this.difficulty = item.transform.parent.GetComponentInChildren().text; + auth_CreateTemplate.mode = this.difficulty;//给结构体“难度”赋值 } } - Debug.Log("%%%%%%%%%%%%%3:" + this.difficulty); + //Debug.Log("%%%%%%%%%%%%%3:" + this.difficulty); } //继续按钮,点击后上传数据 public void ContinueBtn() diff --git a/xiaofang/Assets/Script/login/login.cs b/xiaofang/Assets/Script/login/login.cs index 66398af9..6956685f 100644 --- a/xiaofang/Assets/Script/login/login.cs +++ b/xiaofang/Assets/Script/login/login.cs @@ -126,8 +126,10 @@ public class login : MonoBehaviour //新建模板 public async void createTemplate() { - string body = "{\"templateName\": \"11111\",\"sceneId\": \"11111\",\"subjectId\": \"111\",\"isTemplate\": \"111\",\"mode\": \"111\",\"playerList\": [{\"userId\": \"111\",\"roleId\": \"1111\",\"birthAreaId\": \"111\",\"chargeAreaId\": \"111\"}],\"npcList\": [{\"npcId\": \"111\",\"areaId\": \"111\",\"npcNum\": 0}],\"materialList\": [{\"materialId\": \"111\",\"num\": 0}]}"; - string response = await web.SendRequest(web.URL + "/game/gameTemplate/add", "POST", body, CreateHeaders()); + auth_createTemplate auth_CreateTemplate = new auth_createTemplate(); + string response = await web.SendRequest(web.URL + "/auth/login", "POST", JsonUtility.ToJson(auth_CreateTemplate)); + //string body = "{\"templateName\": \"11111\",\"sceneId\": \"11111\",\"subjectId\": \"111\",\"isTemplate\": \"111\",\"mode\": \"111\",\"playerList\": [{\"userId\": \"111\",\"roleId\": \"1111\",\"birthAreaId\": \"111\",\"chargeAreaId\": \"111\"}],\"npcList\": [{\"npcId\": \"111\",\"areaId\": \"111\",\"npcNum\": 0}],\"materialList\": [{\"materialId\": \"111\",\"num\": 0}]}"; + //string response = await web.SendRequest(web.URL + "/game/gameTemplate/add", "POST", body, CreateHeaders()); Debug.Log("新建模板列表" + response); // 解析服务器返回的数据 newTemplateData newTemplateData = JsonConvert.DeserializeObject(response);