using System.Collections; using System.Collections.Generic; using LitJson; using UnityEngine; using UnityEngine.Networking; using UnityEngine.UI; public class CreateLevMain : MonoBehaviour { public Transform gamePos; // 存放萌宠的预制体 public GameObject[] petPrefabs; // 存放萌宠的按钮 public Button[] petBtns; // 当前选择的萌宠预制体 private GameObject nowChoosePet; // 当前点击生成的萌宠实例 private GameObject createPetGameObj; //上传关卡按钮 public Button btnUpload; // 第一个输入框,只输入数字 public InputField inputNum; public Text txtLev; public TipPanel tipPanel; // 设定输入框输入的最大值 private int maxValue = 99999; //宠物信息 private PetInfo pet; private LevData levData; private float x; private float y; private string levDataUploadUrl= "http://192.168.2.24:8080/uploadLevData"; // 服务器的URL // Start is called before the first frame update void Start() { tipPanel.gameObject.SetActive(false); // 绑定每个按钮的点击事件 for (int i = 0; i < petBtns.Length; i++) { int index = i; // 缓存索引 petBtns[i].GetComponent