SurfaceInfo.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace HQFPSWeapons
  5. {
  6. [Serializable]
  7. [CreateAssetMenu(menuName = "HQ FPS Weapons Pack/Surface Info")]
  8. public class SurfaceInfo : ScriptableObject
  9. {
  10. #region Internal
  11. [Serializable]
  12. public class EffectPair
  13. {
  14. public SoundPlayer AudioEffect;
  15. public GameObject VisualEffect;
  16. }
  17. #endregion
  18. public Texture[] RegisteredTextures;
  19. [Space]
  20. [Group]
  21. public EffectPair SoftFootstepEffect;
  22. [Group]
  23. public EffectPair HardFootstepEffect;
  24. [Group]
  25. public EffectPair FallImpactEffect;
  26. [Space]
  27. [Group]
  28. public EffectPair BulletHitEffect;
  29. [Group]
  30. public EffectPair SlashEffect;
  31. [Group]
  32. public EffectPair StabEffect;
  33. private HashSet<Texture> m_CachedTextures = new HashSet<Texture>();
  34. public void CacheTextures()
  35. {
  36. m_CachedTextures = new HashSet<Texture>();
  37. foreach(Texture tex in RegisteredTextures)
  38. m_CachedTextures.Add(tex);
  39. }
  40. public bool HasTexture(Texture texture)
  41. {
  42. return m_CachedTextures.Contains(texture);
  43. }
  44. }
  45. }