12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- using System;
- using System.Collections.Generic;
- namespace DatabaseModel
- {
- public class AudioClipData
- {
- public int id { get; set; }
- public AudioClipData.AudioClipDataType type { get; set; }
- public string name { get; set; }
- public string path { get; set; }
- public string desc { get; set; }
- public float pitchMin { get; set; }
- public float pitchMax { get; set; }
- public float volumeMin { get; set; }
- public float volumeMax { get; set; }
- public static AudioClipData FindById(int id)
- {
- AudioClipData result;
- try
- {
- result = DB.AudioClipData[id];
- }
- catch (KeyNotFoundException)
- {
- Log.Error("AudioClipDataID: " + id + " 不存在");
- throw;
- }
- return result;
- }
- public static AudioClipData SetValue(string[] strings)
- {
- return new AudioClipData
- {
- id = int.Parse(strings[0]),
- type = (AudioClipData.AudioClipDataType)int.Parse(strings[1]),
- name = strings[2],
- path = strings[3],
- desc = strings[4],
- pitchMin = float.Parse(strings[5]),
- pitchMax = float.Parse(strings[6]),
- volumeMin = float.Parse(strings[7]),
- volumeMax = float.Parse(strings[8])
- };
- }
- public enum AudioClipDataType
- {
- BGM = 1,
- EnemyBoss,
- EnemyElite,
- EnemyNormal,
- PlayerMove,
- PlayerAtk,
- PlayerMaterial,
- UI,
- Group,
- Scene,
- Special,
- Video
- }
- }
- }
|