コード例 #1
0
ファイル: vp_RigidbodyFX.cs プロジェクト: Quint1212/AURORA
    /// <summary>
    /// plays 'sound' on the auto-created, second audio source
    /// </summary>
    void DoPlaySound(AudioClip sound)
    {
        if (sound == null)
        {
            return;
        }

        Audio2.pitch = vp_TimeUtility.AdjustedTimeScale;
        Audio2.clip  = sound;
        Audio2.Stop();
        Audio2.Play();
    }
コード例 #2
0
    // EatingSFX 0-2 drinking sfx 3-5 eating sfx
    // 1 - 10 = gurgles, 11 - 14 = sloshes, 15 - 19 = burps :)
    public void GetSFX(int SFXChance, int GurgleChance)
    {
        if (CurrentItem.isdrink == false)
        {
            Audio2.PlayOneShot(EatingSFX[Random.Range(3, 5)]);
        }
        else if (CurrentItem.isdrink == true)
        {
            Audio2.PlayOneShot(EatingSFX[Random.Range(0, 2)]);
        }
        //Audio2.PlayOneShot(EatingSFX[Random.Range(15, 19)]);

        if (feedingScript.GetFullness() > 15)
        {
            if (!Audio.isPlaying)
            {
                SFXChance    = Random.Range(1, 5);
                GurgleChance = Random.Range(1, 5);
                //Debug.Log("GurgleChance = " + GurgleChance + "BurpChance =" + SFXChance);
                if (SFXChance == 1)
                {
                    Audio2.PlayOneShot(SFX[Random.Range(15, 19)]);
                }
                if (GurgleChance == 1)
                {
                    Audio2.PlayOneShot(SFX[Random.Range(0, 10)]);
                }
            }
        }
        if (plate.GetSelectedItem().isdrink == true)
        {
            Audio2.clip = (SFX[Random.Range(11, 14)]);
            Audio2.Play();
            Audio2.loop = false;
        }
    }
コード例 #3
0
 public void setBossMusic()
 {
     Audio1.Stop();
     Audio2.Play();
 }