Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        // Build the gameObject.
        mainPlayer      = gameObject.AddComponent <AudioSource> ();
        secondaryPlayer = gameObject.AddComponent <AudioSource> ();

        ambientMainPlayer      = gameObject.AddComponent <AudioSource> ();
        ambientSecondaryPlayer = gameObject.AddComponent <AudioSource> ();

        cardFlipper = gameObject.AddComponent <AudioSource> ();

        // Everything but card sounds loops
        mainPlayer.loop             = true;
        secondaryPlayer.loop        = true;
        ambientMainPlayer.loop      = true;
        ambientSecondaryPlayer.loop = true;

        // Initialize the mainPlayer
        mainPlayer.clip   = defaultSound; // In the beginning there should be somekind of default music
        mainPlayer.volume = masterVolume * mainVolume;
        mainPlayer.Play();                // Start playing this song.

        ambientInfo = ambientSoundInfo.Silence;

        InvokeRepeating("NextSong", 0f, 45f);
    }
Exemplo n.º 2
0
 public void ChangeAmbient(ambientSoundInfo ambientInfo)
 {
     changedEnvironments = true;
     this.ambientInfo    = ambientInfo;
 }