ArtTaskInfo.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using ShadowStudio.Model;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class ArtTaskInfo
  6. {
  7. /// <summary>
  8. /// 资源类型,后续扩展
  9. /// </summary>
  10. public enum TaskType
  11. {
  12. /// <summary>
  13. /// 机械1
  14. /// </summary>
  15. JIXIE_1 = 1,
  16. /// <summary>
  17. /// 机械1
  18. /// </summary>
  19. JIXIE_2 = 2,
  20. /// <summary>
  21. /// 机械1
  22. /// </summary>
  23. JIXIE_3 = 3,
  24. /// <summary>
  25. /// 机械
  26. /// </summary>
  27. JIXIE_4 = 4,
  28. }
  29. private static List<ArtTaskAction> artTaskList=new List<ArtTaskAction>();
  30. private static List<ArtTaskChild> artChildList = new List<ArtTaskChild>();
  31. public static void removeTask(ArtTaskAction at)
  32. {
  33. if (artTaskList.Contains(at))
  34. artTaskList.Remove(at);
  35. }
  36. public static void addTask(ArtTaskAction at)
  37. {
  38. artTaskList.Add(at);
  39. }
  40. public static List<ArtTaskAction> getTaskList(TaskType tt)
  41. {
  42. List<ArtTaskAction> ata = new List<ArtTaskAction>();
  43. for (int i = 0; i < artTaskList.Count; i++)
  44. {
  45. if (tt== artTaskList[i].ttype)
  46. {
  47. ata.Add(artTaskList[i]);
  48. }
  49. }
  50. return ata;
  51. }
  52. public static void removeChild(ArtTaskChild ac)
  53. {
  54. if(artChildList.Contains(ac))
  55. artChildList.Remove(ac);
  56. }
  57. public static void addChild(ArtTaskChild ac)
  58. {
  59. artChildList.Add(ac);
  60. }
  61. public static List<ArtTaskChild> getChildList(TaskType tt)
  62. {
  63. List<ArtTaskChild> atc = new List<ArtTaskChild>();
  64. for (int i = 0; i < artChildList.Count; i++)
  65. {
  66. if (tt == artChildList[i].ttype)
  67. {
  68. atc.Add(artChildList[i]);
  69. }
  70. }
  71. return atc;
  72. }
  73. public static List<ArtTaskAction> getTaskList()
  74. {
  75. return artTaskList;
  76. }
  77. }