AudioClipData.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using System;
  2. using System.Collections.Generic;
  3. namespace DatabaseModel
  4. {
  5. public class AudioClipData
  6. {
  7. public int id { get; set; }
  8. public AudioClipData.AudioClipDataType type { get; set; }
  9. public string name { get; set; }
  10. public string path { get; set; }
  11. public string desc { get; set; }
  12. public float pitchMin { get; set; }
  13. public float pitchMax { get; set; }
  14. public float volumeMin { get; set; }
  15. public float volumeMax { get; set; }
  16. public static AudioClipData FindById(int id)
  17. {
  18. AudioClipData result;
  19. try
  20. {
  21. result = DB.AudioClipData[id];
  22. }
  23. catch (KeyNotFoundException)
  24. {
  25. Log.Error("AudioClipDataID: " + id + " 不存在");
  26. throw;
  27. }
  28. return result;
  29. }
  30. public static AudioClipData SetValue(string[] strings)
  31. {
  32. return new AudioClipData
  33. {
  34. id = int.Parse(strings[0]),
  35. type = (AudioClipData.AudioClipDataType)int.Parse(strings[1]),
  36. name = strings[2],
  37. path = strings[3],
  38. desc = strings[4],
  39. pitchMin = float.Parse(strings[5]),
  40. pitchMax = float.Parse(strings[6]),
  41. volumeMin = float.Parse(strings[7]),
  42. volumeMax = float.Parse(strings[8])
  43. };
  44. }
  45. public enum AudioClipDataType
  46. {
  47. BGM = 1,
  48. EnemyBoss,
  49. EnemyElite,
  50. EnemyNormal,
  51. PlayerMove,
  52. PlayerAtk,
  53. PlayerMaterial,
  54. UI,
  55. Group,
  56. Scene,
  57. Special,
  58. Video
  59. }
  60. }
  61. }