63 lines
2.6 KiB
C#
63 lines
2.6 KiB
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using Newtonsoft.Json;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
public class createTemplateInterface : MonoBehaviour
|
|||
|
{
|
|||
|
//<2F>½<EFBFBD>ģ<EFBFBD><C4A3>
|
|||
|
public async Task<newTemplateData> createTemplate()
|
|||
|
{
|
|||
|
auth_createTemplate CreateTemplateBody = new auth_createTemplate();
|
|||
|
CreateTemplateBody.templateName="ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|||
|
string response = await web.SendRequest(web.URL + "/auth/login", "POST", JsonUtility.ToJson(CreateTemplateBody));
|
|||
|
//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("<22>½<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>б<EFBFBD>" + response);
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
newTemplateData newTemplateData = JsonConvert.DeserializeObject<newTemplateData>(response);
|
|||
|
Debug.Log(newTemplateData.data);
|
|||
|
return newTemplateData;
|
|||
|
}
|
|||
|
}
|
|||
|
//====<3D>½<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>==========================
|
|||
|
public class auth_createTemplate
|
|||
|
{
|
|||
|
public string templateName;//ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
public string sceneId;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-----------------------------<2D><><EFBFBD>루û<EBA3A8>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>ѡ<EFBFBD><D1A1>
|
|||
|
public string subjectId;//<2F><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>---------------------------<2D><><EFBFBD><EFBFBD>
|
|||
|
public string isTemplate;//<2F>Ƿ<C7B7>Ϊģ<CEAA><C4A3>
|
|||
|
public string mode;//ģʽ
|
|||
|
public List<PlayerList> playerList;//<2F><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|||
|
public List<NpcList> npcList;//NPC<50>б<EFBFBD>
|
|||
|
public List<MaterialList> materialList;//<2F>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|||
|
}
|
|||
|
|
|||
|
public class PlayerList//<2F><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|||
|
{
|
|||
|
public string userId;//<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>------------------------------<2D><><EFBFBD><EFBFBD>
|
|||
|
public string roleId;//<2F><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>------------------------------<2D><><EFBFBD><EFBFBD>
|
|||
|
public string birthAreaId;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>---------------------<2D><><EFBFBD><EFBFBD>
|
|||
|
public string chargeAreaId;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>--------------------<2D><><EFBFBD><EFBFBD>
|
|||
|
}
|
|||
|
public class NpcList//NPC<50>б<EFBFBD>
|
|||
|
{
|
|||
|
public string userId;//NPC<50><43><EFBFBD><EFBFBD>-------------------------------<2D><><EFBFBD><EFBFBD>
|
|||
|
public string roleId;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>------------------------------<2D><><EFBFBD><EFBFBD>
|
|||
|
public int birthAreaId;//<2F><><EFBFBD><EFBFBD>--------------------------------<2D><><EFBFBD><EFBFBD>
|
|||
|
}
|
|||
|
public class MaterialList//<2F>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|||
|
{
|
|||
|
public string materialId;//<2F>豸<EFBFBD><E8B1B8><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>----------------------<2D><><EFBFBD><EFBFBD>
|
|||
|
public int num;//<2F><><EFBFBD><EFBFBD>
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
//===<3D><><EFBFBD><EFBFBD>ֵ======================================
|
|||
|
|
|||
|
public class newTemplateData : Response
|
|||
|
{
|
|||
|
public string data;//<2F><>
|
|||
|
}
|