示例#1
0
 public void SetItemChoice()
 {
     itemChoice.ClearOptions();
     itemsParams.Clear();
     foreach (string bul in dataFiles.itemDatas)
     {
         string filePath = Path.Combine(Application.persistentDataPath, "Items", bul);
         if (!File.Exists(filePath))
         {
             string    dataAsJson = File.ReadAllText(filePath + ".json");
             SetOfItem tmp        = new SetOfItem();
             JsonUtility.FromJsonOverwrite(dataAsJson, tmp);
             itemsParams.Add(tmp);
         }
     }
     itemChoice.AddOptions(dataFiles.itemDatas);
     if (defaultSetItem.Count > 0)
     {
         selectedItem = defaultSetItem[0];
     }
 }
示例#2
0
 public void SetDropDownItem(int n)
 {
     selectedItem = itemsParams[n];
 }