CombinationSettings.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace DamageNumbersPro
  5. {
  6. [System.Serializable]
  7. public struct CombinationSettings
  8. {
  9. public CombinationSettings(float customDefault)
  10. {
  11. method = CombinationMethod.ABSORB_NEW;
  12. maxDistance = 10f;
  13. bonusLifetime = 1f;
  14. spawnDelay = 0.2f;
  15. absorbDuration = 0.4f;
  16. scaleCurve = new AnimationCurve(new Keyframe(0, 1), new Keyframe(0.7f, 1), new Keyframe(1f, 0f));
  17. alphaCurve = new AnimationCurve(new Keyframe(0, 1), new Keyframe(0.5f, 1), new Keyframe(1f, 0));
  18. moveToAbsorber = true;
  19. teleportToAbsorber = false;
  20. instantGain = false;
  21. absorberScaleFactor = 1.5f;
  22. absorberScaleFade = 15;
  23. }
  24. [Header("Main:")]
  25. [Tooltip("ABSORB_NEW: Oldest damage number absorbs newer damage numbers.\n\nREPLACE_OLD: New damage numbers absorb all existing damage numbers.\n\nIS_ALWAYS_ABSORBER: Will absorb all IS_ALWAYS_VICTIM damage numbers.\n\nIS_ALWAYS_VICTIM: Will be absorbed by the closest IS_ALWAYS_ABSORBER damage number.")]
  26. public CombinationMethod method;
  27. [Tooltip("The maximum distance at which numbers will combine.")]
  28. public float maxDistance;
  29. [Tooltip("The absorbtion delay after spawning.")]
  30. public float spawnDelay;
  31. [Header("Animation:")]
  32. [Tooltip("The length of the absorb animation.")]
  33. public float absorbDuration;
  34. [Tooltip("The scale over the absorb duration.")]
  35. public AnimationCurve scaleCurve;
  36. [Tooltip("The alpha over the absorb duration.")]
  37. public AnimationCurve alphaCurve;
  38. [Tooltip("If enabled the damage number will move towards it's absorber.")]
  39. public bool moveToAbsorber;
  40. [Tooltip("If enabled the damage number will teleport (spawn) inside it's absorber.")]
  41. public bool teleportToAbsorber;
  42. [Tooltip("How much the absorber is scaled up when it absorbs a damage number.")]
  43. public float absorberScaleFactor;
  44. [Tooltip("How quickly the absorber scales back to it's original size after being scaled up.")]
  45. public float absorberScaleFade;
  46. [Header("Other:")]
  47. [Tooltip("If true, the absorber will instantly gain the numbers of the target. Should be used when combination is very fast.")]
  48. public bool instantGain;
  49. [Tooltip("The lifetime of the absorber is reset but also increased by this bonus lifetime.")]
  50. public float bonusLifetime;
  51. }
  52. [System.Serializable]
  53. public enum CombinationMethod
  54. {
  55. ABSORB_NEW
  56. ,
  57. REPLACE_OLD
  58. ,
  59. IS_ALWAYS_ABSORBER
  60. ,
  61. IS_ALWAYS_VICTIM
  62. }
  63. }