整体数据上传

This commit is contained in:
lq 2024-12-11 16:36:27 +08:00
parent 22f3b964c9
commit 8f1c7cc03c
7 changed files with 77 additions and 37 deletions

View File

@ -1604,6 +1604,10 @@ PrefabInstance:
propertyPath: dataText propertyPath: dataText
value: value:
objectReference: {fileID: 1423464739} objectReference: {fileID: 1423464739}
- target: {fileID: 7187413038405322106, guid: 26d5710936f5f7d468eb5eb9da96112e, type: 3}
propertyPath: isTemplate
value:
objectReference: {fileID: 981298357}
- target: {fileID: 7187413038405322106, guid: 26d5710936f5f7d468eb5eb9da96112e, type: 3} - target: {fileID: 7187413038405322106, guid: 26d5710936f5f7d468eb5eb9da96112e, type: 3}
propertyPath: submitText propertyPath: submitText
value: value:
@ -1620,6 +1624,10 @@ PrefabInstance:
propertyPath: preservationToggle propertyPath: preservationToggle
value: value:
objectReference: {fileID: 981298357} objectReference: {fileID: 981298357}
- target: {fileID: 7187413038405322106, guid: 26d5710936f5f7d468eb5eb9da96112e, type: 3}
propertyPath: createTemplateInterface
value:
objectReference: {fileID: 1201261373}
- target: {fileID: 8789802341354697854, guid: 26d5710936f5f7d468eb5eb9da96112e, type: 3} - target: {fileID: 8789802341354697854, guid: 26d5710936f5f7d468eb5eb9da96112e, type: 3}
propertyPath: m_AnchorMax.x propertyPath: m_AnchorMax.x
value: 1 value: 1
@ -2138,7 +2146,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!224 &618256459 --- !u!224 &618256459
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -6851,6 +6859,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 1201261372} - component: {fileID: 1201261372}
- component: {fileID: 1201261371} - component: {fileID: 1201261371}
- component: {fileID: 1201261373}
m_Layer: 0 m_Layer: 0
m_Name: UserInfo m_Name: UserInfo
m_TagString: Untagged m_TagString: Untagged
@ -6885,6 +6894,18 @@ Transform:
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 5 m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1201261373
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1201261370}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ec15685532562834f86746af6ec16907, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1234276884 --- !u!1 &1234276884
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -8266,6 +8287,7 @@ MonoBehaviour:
NPCJosnFile: {fileID: 4900000, guid: 41009f009f0718647a782c7e1aec97dd, type: 3} NPCJosnFile: {fileID: 4900000, guid: 41009f009f0718647a782c7e1aec97dd, type: 3}
LanguageJsonFile: {fileID: 4900000, guid: 62a41129c4663ee41a06274114d28feb, type: 3} LanguageJsonFile: {fileID: 4900000, guid: 62a41129c4663ee41a06274114d28feb, type: 3}
SelectJsonFile: {fileID: 4900000, guid: 3efd15f4195557144a45659d2baa1ba3, type: 3} SelectJsonFile: {fileID: 4900000, guid: 3efd15f4195557144a45659d2baa1ba3, type: 3}
TaskJsonFile: {fileID: 4900000, guid: 4dec25769ed4ed3469693b1c881248af, type: 3}
--- !u!4 &1417128758 --- !u!4 &1417128758
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -14719,9 +14741,9 @@ RectTransform:
m_Father: {fileID: 7468736063934366934} m_Father: {fileID: 7468736063934366934}
m_RootOrder: 1 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 334.1322, y: -55} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 187, y: 110} m_SizeDelta: {x: 187, y: 110}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &7468736064122132329 --- !u!1 &7468736064122132329
@ -15002,9 +15024,9 @@ RectTransform:
m_Father: {fileID: 7468736063934366934} m_Father: {fileID: 7468736063934366934}
m_RootOrder: 3 m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 753.3966, y: -55} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 187, y: 110} m_SizeDelta: {x: 187, y: 110}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &7468736064198941274 --- !u!1 &7468736064198941274
@ -15762,7 +15784,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 3.3229} m_AnchoredPosition: {x: 0, y: 3.3229}
m_SizeDelta: {x: 1834, y: 1070} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &7468736064579811972 --- !u!1 &7468736064579811972
GameObject: GameObject:
@ -15784,7 +15806,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 0 m_IsActive: 1
--- !u!114 &7468736064579811982 --- !u!114 &7468736064579811982
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -16242,9 +16264,9 @@ RectTransform:
m_Father: {fileID: 7468736063934366934} m_Father: {fileID: 7468736063934366934}
m_RootOrder: 2 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 543.7644, y: -55} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 187, y: 110} m_SizeDelta: {x: 187, y: 110}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &7468736064659112359 --- !u!1 &7468736064659112359
@ -16448,9 +16470,9 @@ RectTransform:
m_Father: {fileID: 7468736064579811971} m_Father: {fileID: 7468736064579811971}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 917, y: -53.335} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1834, y: 106.67} m_SizeDelta: {x: 1834, y: 106.67}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &7468736064728012045 --- !u!1 &7468736064728012045
@ -16610,9 +16632,9 @@ RectTransform:
m_Father: {fileID: 7468736063934366934} m_Father: {fileID: 7468736063934366934}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 124.5, y: -55} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 187, y: 110} m_SizeDelta: {x: 187, y: 110}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &7468736064820222392 --- !u!1 &7468736064820222392
@ -17023,9 +17045,9 @@ RectTransform:
m_Father: {fileID: 7468736064579811971} m_Father: {fileID: 7468736064579811971}
m_RootOrder: 4 m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 917, y: -588.33496} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1834, y: 498.685} m_SizeDelta: {x: 1834, y: 498.685}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &7468736064937661071 --- !u!1 &7468736064937661071

View File

@ -6,14 +6,27 @@ using UnityEngine;
public class createTemplateInterface : MonoBehaviour public class createTemplateInterface : MonoBehaviour
{ {
// 创建请求头,使用最新的 token
public Dictionary<string, string> CreateHeaders()
{
Debug.Log("====5555=====" + GlobalData.ServerData.data.access_token);
return new Dictionary<string, string>
{
{ "Authorization","Bearer "+GlobalData.ServerData.data.access_token },
{"clientId", "e5cd7e4891bf95d1d19206ce24a7b32e" }
};
}
//新建模板 //新建模板
public async Task<newTemplateData> createTemplate() public async Task<newTemplateData> createTemplate()
{ {
auth_createTemplate CreateTemplateBody = new auth_createTemplate();
CreateTemplateBody.templateName="模板名称"; //=====================================================================================================================================================
string response = await web.SendRequest(web.URL + "/auth/login", "POST", JsonUtility.ToJson(CreateTemplateBody)); Debug.Log(JsonConvert.SerializeObject(createTemplateInfo.Instance.auth_CreateTemplate) + "=====================");
string response = await web.SendRequest(web.URL + "/game/gameTemplate/add", "POST", JsonConvert.SerializeObject(createTemplateInfo.Instance.auth_CreateTemplate), CreateHeaders());
//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 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("======="+body);
//string response = await web.SendRequest(web.URL + "/game/gameTemplate/add", "POST", body, CreateHeaders(serverData));
Debug.Log("新建模板列表" + response); Debug.Log("新建模板列表" + response);
// 解析服务器返回的数据 // 解析服务器返回的数据
newTemplateData newTemplateData = JsonConvert.DeserializeObject<newTemplateData>(response); newTemplateData newTemplateData = JsonConvert.DeserializeObject<newTemplateData>(response);
@ -43,8 +56,8 @@ public class PlayerList//
} }
public class NpcList//NPC列表 public class NpcList//NPC列表
{ {
public string userId;//NPC编号-------------------------------必须 public string npcId;//NPC编号-------------------------------必须
public string roleId;//区域编号------------------------------必须 public string areaId;//区域编号------------------------------必须
public int birthAreaId;//数量--------------------------------必须 public int birthAreaId;//数量--------------------------------必须
} }
public class MaterialList//设备器材列表 public class MaterialList//设备器材列表

View File

@ -15,12 +15,14 @@ public class DatePanel : MonoBehaviour
public Text SchoolText; //事故校区文本 public Text SchoolText; //事故校区文本
public Text PlaceText; //事故地点文本 public Text PlaceText; //事故地点文本
public Text NumberText; //参与人数文本 public Text NumberText; //参与人数文本
public Toggle isTemplate;
public InputField submitInputField; public InputField submitInputField;
public Text submitText; public Text submitText;
public Text inputText; public Text inputText;
public Text dataText; public Text dataText;
public int placeId; public int placeId;
public createTemplateInterface createTemplateInterface=new createTemplateInterface();
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
@ -60,6 +62,15 @@ public class DatePanel : MonoBehaviour
createTemplateInfo.Instance.auth_CreateTemplate.templateName = inputText.text; createTemplateInfo.Instance.auth_CreateTemplate.templateName = inputText.text;
} }
} }
if(isTemplate.isOn)
{
createTemplateInfo.Instance.auth_CreateTemplate.isTemplate = "0";
}
else
{
createTemplateInfo.Instance.auth_CreateTemplate.isTemplate = "1";
}
createTemplateInterface.createTemplate();
} }
//模板面板确定按钮 //模板面板确定按钮

View File

@ -88,8 +88,8 @@ public class EvacuationPanel : MonoBehaviour
{ {
Debug.Log(createTemplateInfo.Instance.auth_CreateTemplate + "==============="); Debug.Log(createTemplateInfo.Instance.auth_CreateTemplate + "===============");
NpcList nPC = new NpcList(); NpcList nPC = new NpcList();
nPC.userId = npcType; nPC.npcId = npcType;
nPC.roleId = roleid; nPC.areaId = roleid;
createTemplateInfo.Instance.auth_CreateTemplate.npcList = new List<NpcList>(); createTemplateInfo.Instance.auth_CreateTemplate.npcList = new List<NpcList>();
createTemplateInfo.Instance.auth_CreateTemplate.npcList.Add(nPC); createTemplateInfo.Instance.auth_CreateTemplate.npcList.Add(nPC);
panel.panelToggle[3].interactable = true; // ĆôÓĂľÚśţ¸öToggle panel.panelToggle[3].interactable = true; // ĆôÓĂľÚśţ¸öToggle

View File

@ -407,7 +407,6 @@ public class SelectScenePanel : MonoBehaviour
//ÓÎÏ·ÄѶÈÑ¡Ôñ //ÓÎÏ·ÄѶÈÑ¡Ôñ
public void SelsctDifficulty() public void SelsctDifficulty()
{ {
auth_createTemplate auth_CreateTemplate = new auth_createTemplate();
foreach (Toggle item in difficultyList) foreach (Toggle item in difficultyList)
{ {
if (item.isOn) if (item.isOn)
@ -415,7 +414,8 @@ public class SelectScenePanel : MonoBehaviour
DifficultyInfo difficultyInfo = item.GetComponent<DifficultyInfo>(); DifficultyInfo difficultyInfo = item.GetComponent<DifficultyInfo>();
this.difficultyId = difficultyInfo.difficulty; this.difficultyId = difficultyInfo.difficulty;
this.difficulty = item.transform.parent.GetComponentInChildren<Text>().text; this.difficulty = item.transform.parent.GetComponentInChildren<Text>().text;
auth_CreateTemplate.mode = this.difficulty;//给结构体“难度”赋值 Debug.Log("------------++++++++++++" + this.difficulty);
createTemplateInfo.Instance.auth_CreateTemplate.mode = this.difficulty;
} }
} }
} }

View File

@ -5,13 +5,7 @@ using UnityEngine.UI;
public class TemplateInfo : MonoBehaviour public class TemplateInfo : MonoBehaviour
{ {
<<<<<<< HEAD:xiaofang/Assets/Script/hylScripts/Free01/NetPings.cs
=======
public Text templateText; public Text templateText;
>>>>>>> e0ef89a8cfb64341378541f16f1e9f5cffbc01eb:xiaofang/Assets/Script/UI/TemplateInfo.cs
// Start is called before the first frame update
void Start() void Start()
{ {