private void OnEnable() { soukoList = GachaTes1.LoadList <string>("ListSaveKey2"); for (int i = 0; i < itemd.Length; i++) { itemd[i] = Resources.Load <ItemDeta>("Item/KyokaItem/" + (i + 1).ToString()); Debug.Log(itemd[i]); } for (int i = 0; i < soukoList.Count; i++) { for (int j = 0; j < itemd.Length; j++) { if (itemd[j].name == soukoList[i]) { if (itemd[j].name == "EXPsyo") { ka1++; } if (itemd[j].name == "EXPtyu") { ka2++; } if (itemd[j].name == "EXPdai") { ka3++; } if (itemd[j].name == "HPUP") { ka4++; } if (itemd[j].name == "PowerUP") { ka5++; } if (itemd[j].name == "SpeedUP") { ka6++; } count++; } } } textExpS.text = "x " + ka1; textExpT.text = "x " + ka2; textExpD.text = "x " + ka3; HpU.text = "x " + ka4; PoU.text = "x " + ka5; SpU.text = "x " + ka6; Debug.Log(count); }
// Use this for initialization void Start() { soukoList = GachaTes1.LoadList <string>("ListSaveKey2"); kurabe = GachaTes1.LoadList <string>("ListSaveKey1"); array2 = kurabe.ToArray(); array = loadList.ToArray(); //Debug.Log(array.Length); //Debug.Log(soukoList.Count); //for (int k = 0; k < soukoList.Count; k++){ Debug.Log(soukoList[k]); } if (array.Length == 0) { //Debug.Log("true2"); loadList = GachaTes1.LoadList <string>("ListSaveKey1"); } for (int i = 0; i < array.Length; i++) { if (array2[i] == array[i] && soukoList.Count != 0) { //Debug.Log("true"); } else { loadList = GachaTes1.LoadList <string>("ListSaveKey1"); //Debug.Log(loadList.Count); array = loadList.ToArray(); for (int j = 0; j < array.Length; j++) { soukoList.Add(array[j]); } GachaTes1.SaveList <string>("ListSaveKey2", soukoList); Debug.Log(soukoList.Count); //for (int k = 0; k < soukoList.Count; k++) { Debug.Log(soukoList[k]); } } } }
private void OnEnable() { soukoList = GachaTes1.LoadList <string>("ListSaveKey2"); for (int i = 0; i < 5; i++) { itemd[i] = Resources.Load <ItemDeta>("Item/" + (i + 1).ToString()); //Debug.Log(itemd[i]); } soukoItem = new GameObject[soukoList.Count]; Debug.Log(soukoItem.Length); for (int i = 0; i < soukoList.Count; i++) { for (int j = 0; j < itemd.Length; j++) { if (itemd[j].name == soukoList[i]) { soukoItem[i] = GameObject.Instantiate(soukoItemPre) as GameObject; soukoItem[i].name = "soukoItem" + i; soukoItem[i].transform.SetParent(transform, false); soukoItem[i].transform.GetChild(0).GetComponent <Image>().sprite = itemd[j].ItemGazo; } } } }