ItemFileList.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using LitJson;
  5. using ShadowStudio.Model;
  6. using ShadowStudio.UI;
  7. using UnityEngine;
  8. using XRTool.Util;
  9. public class ItemFileList : UnitySingleton<ItemFileList>
  10. {
  11. private int goods_id;
  12. public GameObject Itemfile;
  13. public List<GameObject> Itemfilelist;
  14. protected override void Awake()
  15. {
  16. base.Awake();
  17. Itemfilelist = new List<GameObject>();
  18. }
  19. public void AddFileIcon(Texture2D texture2, ArtContainer artContainer)
  20. {
  21. GameObject obj = Instantiate(Itemfile, transform) as GameObject;
  22. Itemfilelist.Add(obj);
  23. obj.transform.GetComponent<ItemFileView>().Init(texture2, artContainer, ConsoleDlg.IsOne);
  24. if (ConsoleDlg.IsOne)
  25. {
  26. ConsoleDlg.IsOne = false;
  27. }
  28. }
  29. public void DeleteFileIcon(ArtContainer artContainer)
  30. {
  31. if (artContainer.CanEditor())
  32. {
  33. if (ArtEditorContainer.Instance)
  34. {
  35. ArtEditorContainer.Instance.gameObject.SetActive(false);
  36. }
  37. if (ArtMoreEditor.Instance)
  38. {
  39. ArtMoreEditor.Instance.DeleteRefesh();
  40. }
  41. GoodsInfo goodsInfo = artContainer.GetGoodsInfo();
  42. goods_id = goodsInfo.id;
  43. WSHandler.Room.DeleteGood(new int[] { goods_id });
  44. }
  45. }
  46. }