DigitSettings.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace DamageNumbersPro
  5. {
  6. [System.Serializable]
  7. public struct DigitSettings
  8. {
  9. public DigitSettings(float customDefault)
  10. {
  11. decimals = 0;
  12. decimalChar = ".";
  13. hideZeros = false;
  14. dotSeparation = false;
  15. dotDistance = 3;
  16. dotChar = ".";
  17. suffixShorten = false;
  18. suffixes = new List<string>() { "K", "M", "B", "T" };
  19. suffixDigits = new List<int>() { 3, 3, 3, 3 };
  20. maxDigits = 3;
  21. suffixDecimals = 1;
  22. suffixDecimalChar = ".";
  23. suffixHideZeros = false;
  24. }
  25. [Header("Decimals:")]
  26. [Range(0,3)]
  27. [Tooltip("Amount of digits visible after the dot.")]
  28. public int decimals;
  29. [Tooltip("The character used for the dot.")]
  30. public string decimalChar;
  31. [Tooltip("If true zeros at the end of the number will be hidden.")]
  32. public bool hideZeros;
  33. [Header("Dots:")]
  34. [Tooltip("Separates the number with dots.")]
  35. public bool dotSeparation;
  36. [Tooltip("Amount of digits between each dot.")]
  37. public int dotDistance;
  38. [Tooltip("The character used for the dot.")]
  39. public string dotChar;
  40. [Header("Suffix Shorten:")]
  41. [Tooltip("Shortens a number like 10000 to 10K.")]
  42. public bool suffixShorten;
  43. [Tooltip("List of suffixes.")]
  44. public List<string> suffixes;
  45. [Tooltip("Corresponding list of how many digits a suffix shortens. Keep both lists at the same size.")]
  46. public List<int> suffixDigits;
  47. [Tooltip("Maximum of visible digits. If number has more digits than this it will be shortened.")]
  48. public int maxDigits;
  49. [Tooltip("Amount of decimals shown after shortening the number.")]
  50. [Range(0, 3)]
  51. public int suffixDecimals;
  52. [Tooltip("The character used for the dot.")]
  53. public string suffixDecimalChar;
  54. [Tooltip("If true decimal zeros will be hidden.")]
  55. public bool suffixHideZeros;
  56. }
  57. }