public static void Init(Main_DataFileManager DatafileManager, Main_ItemViewer Viewer, Assets_ItemList Asset) { Main_ItemManager.DatafileManager = DatafileManager; Main_ItemManager.ItemList = Asset; Main_ItemManager.ItemViewer = Viewer; UpdateFromJson(); //セーブデータを補完する { foreach (var node in Asset.ItemList) { bool isExist = false; for (int i = 0, size = ItemSaveData.Data.Count; i < size; ++i) { if (ItemSaveData.Data[i].CloseID == node.CloseID) { isExist = true; break; } } //無かったら追加 if (!isExist) { var data = new Json_Item_ListNode(); data.CloseID = node.CloseID; ItemSaveData.Data.Add(data); } } } }
public void Init(Main_ItemViewer parent, Json_Item_ListNode mySaveData, ItemData myData) { if (mySaveData.isActive) { _Image.sprite = myData.sprite; _ParentComponent = parent; _mySaveData = mySaveData; _myData = myData; UpdateView(); } else { gameObject.SetActive(false); } }