public PaintingEntity(PaintingEntity pe) { this.title = pe.Title; this.artist = pe.Artist; this.info = pe.Info; this.spriteName = pe.SpriteName; this.textureName = pe.TextureName; }
public PaintingEntity(PaintingEntity pe) { this.title = pe.Title; this.artist = pe.Artist; this.info = pe.Info; this.spriteName = pe.SpriteName; this.textureName = pe.TextureName; this.paintingObject = pe.paintingObject; this.isCaptured = pe.isCaptured; }
private void ShowText() { PaintingEntity tempP; try { tempP = new PaintingEntity(listPaintingsInJson.Find(x => x.TextureName.Equals(painting))); } catch { print("Couldn't find painting Check Json name!"); return; } text_Title.text = tempP.Title; text_Info.text = tempP.Info; }
public void ShowText(string paintingName) { PaintingEntity tempP; try { tempP = new PaintingEntity(paintings.Find(x => x.SpriteName.Equals(paintingName))); } catch { print("Couldn't find painting Check Json name!"); return; } text_Title.text = tempP.Title; text_Info.text = tempP.Info; text_Info.transform.parent.gameObject.SetActive(true); }
public List<PaintingEntity> ReadJson() { StreamReader sr = new StreamReader(Application.dataPath + "/" + fileName); data = sr.ReadToEnd(); sr.Close(); JSONNode json = JSON.Parse(data); // print (json.Count); for(int i = 0; i < json.Count; i++) { PaintingEntity tempPainting = new PaintingEntity(); tempPainting.Title = json[i]["Title"].Value; tempPainting.Artist = json[i]["Artist"].Value; tempPainting.Info = json[i]["Info"].Value; tempPainting.SpriteName = json[i]["Sprite"].Value; tempPainting.TextureName = json[i]["Texture"].Value; paintings.Add(tempPainting); } return paintings; }
public List <PaintingEntity> ReadJson() { // StreamReader sr = new StreamReader(Application.dataPath + "/Resources/" + fileName); // data = sr.ReadToEnd(); // sr.Close(); TextAsset data = Resources.Load(fileName) as TextAsset; JSONNode json = JSON.Parse(data.text); for (int i = 0; i < json.Count; i++) { PaintingEntity tempPainting = new PaintingEntity(); tempPainting.Title = json[i]["Title"].Value; tempPainting.Artist = json[i]["Artist"].Value; tempPainting.Info = json[i]["Info"].Value; tempPainting.SpriteName = json[i]["Sprite"].Value; tempPainting.TextureName = json[i]["Texture"].Value; paintings.Add(tempPainting); } return(paintings); }
public void ShowText() { PaintingEntity tempP; try { tempP = new PaintingEntity(paintings.Find(x => x.TextureName.Equals(painting))); } catch { print("Couldn't find painting Check Json name! : "+ painting); return; } text_Title.text = tempP.Title; text_Info.text = tempP.Info; }