質問編集履歴
1
リスト要素の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -55,11 +55,12 @@
|
|
55
55
|
|
56
56
|
public List<CharTemplete> chars = new List<CharTemplete>();
|
57
57
|
public List<CharTemplete> mydekki = new List<CharTemplete>();
|
58
|
+
public List<CharTemplate> mylist = new List<CharTemplate>();
|
58
59
|
|
59
60
|
public void firstDekkiInit(){
|
60
61
|
Addin(0);
|
61
62
|
foreach(var v in mydekki){
|
62
|
-
|
63
|
+
mylist.Add(v);
|
63
64
|
Debug.Log(v); //null
|
64
65
|
Debug.Log(v.GetType()); //CharTemplate
|
65
66
|
Debug.Log(v.name); //"歩"
|
@@ -119,7 +120,7 @@
|
|
119
120
|
prefab[preCnt].GetComponent<CharTemplete>().InitStatus(deck.mydekki[preCnt]);//ここでnull refelenceエラー
|
120
121
|
prefab[preCnt].transform.SetParent(ImageTransform);
|
121
122
|
prefab[preCnt].transform.localScale = Vector3.one;
|
122
|
-
prefab[preCnt].GetComponentInChildren<Text>().text = deck.
|
123
|
+
prefab[preCnt].GetComponentInChildren<Text>().text = deck.mylist[preCnt].name;
|
123
124
|
preCnt++;
|
124
125
|
|
125
126
|
}
|