Ejemplo n.º 1
0
/*+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
 * STATE
 *+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=*/

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

        if (onGameStart != null)
        {
            onGameStart();
        }
    }
Ejemplo n.º 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();
    }
Ejemplo n.º 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();
    }
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 5
0
 public void Play()
 {
     songController.Play();
 }