using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using Newtonsoft.Json; public class StepItem : MonoBehaviour { public Text numText; public Text nameText; public Button btn1; public Button btn2; public Button btn3; private MyStep myStep; public void Init(int num,MyStep myStep) { this.myStep = myStep; numText.text = num.ToString(); nameText.text = myStep.name; btn1.onClick.AddListener(() => { //提交数据 // var tmpdata = new { appId = CallForTest.instance.Appid, userId = CallForTest.instance.user.userId, taskId = CallForTest.instance.taskId, contentId = CallForTest.instance.contentId , stepNo =myStep.code, stepScore =80, stepEvalute ="操作正确,但是操作速度过慢", stepStatus =1}; // string postData = JsonConvert.SerializeObject(tmpdata); // // StartCoroutine(CallForTest.instance.PostCall("http://119.45.94.212:28080/postback/insertStepInfo", postData, (a, data) => // { // if(a) // { // Debug.Log("步骤数据提交成功"); // } // })); }); } }