示例#1
0
 void Awake()
 {
     if (current == null)
     {
         current = this;
     }
     _beatMapExists   = true;
     _audioClipExists = true;
     _audio           = GetComponent <AudioSource>();
     if (_audio.clip == null)
     {
         _audioClipExists = false;
         Debug.LogError("Maestro: No Audio Clip!");
     }
     else
     {
         if ("BeatMap_" + _audio.clip.name.Replace(".mp3", "") != beatmapFile.name)
         {
             Debug.LogWarning("Maestro: Audio Clip and Beatmap File name mismatch!");
         }
     }
     _beatIndex = 0;
     onBeat     = OnBeat;
     lateOnBeat = LateOnBeat;
     listeners  = new List <MusicBehaviour>();
     beatmap    = BeatMapSerializer.BeatMapReader.ReadBeatMap(beatmapFile);
 }
示例#2
0
 void Awake()
 {
     if (current == null) {
         current = this;
     }
     _beatMapExists = true;
     _audioClipExists = true;
     _audio = GetComponent<AudioSource>();
     if (_audio.clip == null) {
         _audioClipExists = false;
         Debug.LogError("Maestro: No Audio Clip!");
     }
     else {
         if ("BeatMap_" + _audio.clip.name.Replace(".mp3", "") != beatmapFile.name) {
             Debug.LogWarning("Maestro: Audio Clip and Beatmap File name mismatch!");
         }
     }
     _beatIndex = 0;
     onBeat = OnBeat;
     lateOnBeat = LateOnBeat;
     listeners = new List<MusicBehaviour>();
     beatmap = BeatMapSerializer.BeatMapReader.ReadBeatMap(beatmapFile);
 }