Search Unity

newbie question - Should one audio component contain all audio files?

Discussion in 'Audio & Video' started by Larpushka, Jun 29, 2015.

  1. Larpushka

    Larpushka

    Joined:
    Jan 6, 2015
    Posts:
    214
    So let's say I have a conversation script, and when a player clicks a line I want it to play a certain sound...so I do a simple

    Code (CSharp):
    1.         AudioSource audio = GetComponent<AudioSource>(); //plays an audio component
    2.         audio.Play();
    But what if I have more than one audio file that I want to play throughout the conversation, do I need to make a new "AudioSource" component for each audio file?
     
  2. Hikiko66

    Hikiko66

    Joined:
    May 5, 2013
    Posts:
    1,304
  3. Larpushka

    Larpushka

    Joined:
    Jan 6, 2015
    Posts:
    214
    Thanks for that information :) That answers my question