GetHighestCardIndex.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using UnityEditor.SceneManagement;
  5. using UnityEditor;
  6. using UnityEngine;
  7. using UnityEngine.SceneManagement;
  8. using DCGO.CardEntities;
  9. namespace DCGO.Tools
  10. {
  11. public class GetHighestCardIndex : MonoBehaviour
  12. {
  13. [MenuItem("Window/DCGO/Get Index/Get Highest Card Index")]
  14. static void GetIndex()
  15. {
  16. List<CEntity_Base> Entities = GetAsset.LoadAll<CEntity_Base>("Assets/CardBaseEntity/");
  17. int cardIndex = 0;
  18. string name = "";
  19. foreach (CEntity_Base card in Entities)
  20. {
  21. if (card.CardID.Contains("P-"))
  22. continue;
  23. if (cardIndex == card.CardIndex)
  24. Debug.LogWarning($"DUPLICATE INDEX FOUND: {card.CardSpriteName} - {cardIndex}");
  25. if (card.CardIndex > cardIndex)
  26. {
  27. cardIndex = card.CardIndex;
  28. name = card.CardSpriteName;
  29. }
  30. }
  31. Debug.Log($"Highest Card Index: {cardIndex} - {name}");
  32. }
  33. }
  34. public class GetHighestPromoCardIndex : MonoBehaviour
  35. {
  36. [MenuItem("Window/DCGO/Get Index/Get Highest Promo Index")]
  37. static void GetIndex()
  38. {
  39. List<CEntity_Base> Entities = GetAsset.LoadAll<CEntity_Base>("Assets/CardBaseEntity/");
  40. int cardIndex = 0;
  41. string name = "";
  42. foreach (CEntity_Base card in Entities)
  43. {
  44. if (!card.CardID.Contains("P-"))
  45. continue;
  46. if (cardIndex == card.CardIndex)
  47. Debug.LogWarning($"DUPLICATE INDEX FOUND: {card.CardSpriteName} - {cardIndex}");
  48. if (card.CardIndex > cardIndex)
  49. {
  50. cardIndex = card.CardIndex;
  51. name = card.CardSpriteName;
  52. }
  53. }
  54. Debug.Log($"Highest Card Index: {cardIndex} - {name}");
  55. }
  56. }
  57. }