コード例 #1
0
 public virtual void PrepareAction()
 {
     if (!AudioManager.getIsPlaying(musicToPlay.ToString()))
     {
         AudioManager.StopAllMusic();
         AudioManager.PlayMusic(musicToPlay.ToString(), Vector3.zero);
     }
 }
コード例 #2
0
 public void PlayTheMusic()
 {
     if (restartTheMusic || !AudioManager.getIsPlaying(musicToPlay.ToString()))
     {
         AudioManager.StopAllMusic();
         AudioManager.PlayMusic(musicToPlay.ToString(), transform.position);
     }
 }
コード例 #3
0
 void Update()
 {
     if (!AudioManager.getIsPlaying(nowPlaying.ToString()))
     {
         PlayTheMusic();
     }
 }
コード例 #4
0
    public void Load(MusicNames MusicName, Levels level)
    {
        NotesManager notesManager = (NotesManager)FindObjectOfType(typeof(NotesManager));
        MoveManager  moveManager  = (MoveManager)FindObjectOfType(typeof(MoveManager));
        JudgeScript  judgeScript  = (JudgeScript)FindObjectOfType(typeof(JudgeScript));

        string folderName = "Data/" + MusicName.ToString() + "/";

        TextAsset    musicData = Resources.Load <TextAsset>(folderName + tuneData);
        StringReader sr        = new StringReader(musicData.text);

        while (sr.Peek() != -1)
        {
            string        _str = sr.ReadLine();
            string[]      str  = _str.Split(',');
            TuneDataIndex tuneDataIndex;
            Enum.TryParse <TuneDataIndex>(str[0], out tuneDataIndex);
            switch (tuneDataIndex)
            {
            case TuneDataIndex.NAME:
                musicName = str[1];
                break;

            case TuneDataIndex.BPM:
                bpm = float.Parse(str[1]);
                break;

            case TuneDataIndex.OFFSET:
                offset = float.Parse(str[1]);
                break;
            }
        }
        notesManager.SetBPM(bpm);
        notesManager.SetOffset(offset);

        TextAsset notesData = Resources.Load <TextAsset>(folderName + level.ToString() + "NotesData");

        notesManager.Load(notesData);
        AudioClip clip = Resources.Load <AudioClip>(folderName + clipName);

        moveManager.Init();
        moveManager.SetClip(clip);
        judgeScript.Init();

        moveManager.MusicStart();
    }
コード例 #5
0
 public void PlayTheMusic()
 {
     AudioManager.StopAllMusic();
     nowPlaying = musicToPlay[Random.Range(0, musicToPlay.Length)];
     AudioManager.PlayMusic(nowPlaying.ToString(), transform.position);
 }
コード例 #6
0
 public void PlayTheMusic()
 {
     AudioManager.StopAllMusic();
     AudioManager.PlayMusic(musicToPlay.ToString(), transform.position);
 }