void UpdateData(JSONNode data) { var col = data.GetCollection("category"); _list = new List <BrushCategory>(); foreach (var node in col) { BrushCategory cat = new BrushCategory(); cat.Update(node); _list.Add(cat); } }
public void SetData(BrushCategory data) { _listBrush = new List <BrushView>(); header.sprite = Resources.Load <Sprite>(LevelEditorInfo.Instance.WhichGame + "/Sprites/" + data.spriteId); foreach (var brushData in data.brushes) { BrushView brushView = Instantiate(prefabBrushView); brushView.transform.SetParent(transform); brushView.transform.localScale = new Vector3(1, 1, 1); brushView.SetData(brushData); _listBrush.Add(brushView); } _expand = false; OnExpand(_expand); }