Beispiel #1
0
    void Start()
    {
        quarterNote       = 60 / bpm;         //gives you the length of the quarternote in seconds
        transitionInTime  = quarterNote * 8;
        transitionOutTime = quarterNote * 16; //?

        int i = Random.Range(0, wanderClips.Count);

        wanderSource.clip = wanderClips [i];

        poiSurce.clip = wanderClips [i];

        poiSurce.Play();
        wanderSource.Play();
    }
Beispiel #2
0
    public void PlayTransition()
    {
        int i = Random.Range(0, transitionSFX.Count);

        transitionSource.clip = transitionSFX [i];
        transitionSource.Play();
    }
Beispiel #3
0
 void StartDialogue()
 {
     isPlaying = true;
     if (hasVoice)
     {
         myAudio.Play();
     }
 }
Beispiel #4
0
    public void Start()
    {
        int i = Random.Range(0, bgAudioClips.Count);

        audioSource.clip = bgAudioClips [i];

        audioSource.Play();
    }
Beispiel #5
0
    void StartMovie()
    {
        myMovie.Stop();//make sure it's rewound
        myMovie.Play();
        myAudio.Play();
        isPlaying = true;

        Priorities.education = 100;
    }
Beispiel #6
0
    public void Play()
    {
        SFX_Info clipInfo;

        //pick a random sfx
        int randomIndex = Random.Range(0, sfx.Length);

        clipInfo = sfx [randomIndex];


        //randomize the info so it doesn't sound repetitve
        float randomPitch = Random.Range(clipInfo.lowPitchRange, clipInfo.highPitchRange);
        float randomVol   = Random.Range(clipInfo.volLowRange, clipInfo.volHighRange);

        //set the info
        sfxSource.clip   = clipInfo.clip;
        sfxSource.pitch  = randomPitch;
        sfxSource.volume = randomVol;

        //play the info
        sfxSource.Play();
    }