Пример #1
0
/*+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
 * STATE
 *+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=*/

    public void StartGame()
    {
        songController.Play(waitTimeBeats);

        if (onGameStart != null)
        {
            onGameStart();
        }
    }
Пример #2
0
    public void PlayGame()
    {
        // load Prefab
        string     currentSong = PlayerPrefs.GetString("Song");
        GameObject loadedSong  = Resources.Load("Games/" + currentSong) as GameObject;

        this.song = Instantiate(loadedSong) as GameObject;

        //start game
        songController = song.GetComponent <SongController>();
        songController.Play();
    }
Пример #3
0
    public void PlayGame()
    {
        string    music      = PlayerPrefs.GetString("Music");
        AudioClip loadedSong = Resources.Load("Music/" + music) as AudioClip;

        AudioSource audioSource = songPrefab.GetComponent <AudioSource>();

        audioSource.clip = loadedSong;

        //start game
        songController = songPrefab.GetComponent <SongController>();
        songController.Play();
    }
Пример #4
0
 void CheckMouseHover()
 {
     if (song.isPlaying && song.hasStarted && !isMouseOverGame()) //fullWindow.Contains(Event.current.mousePosition)
     {
         song.Pause();
         Time.timeScale = 0.0f;
     }
     if (!song.isPlaying && song.hasStarted && isMouseOverGame()) //!fullWindow.Contains(Event.current.mousePosition)
     {
         song.Play();
         Time.timeScale = gameSpeed;
     }
 }
Пример #5
0
 public void Play()
 {
     songController.Play();
 }