示例#1
0
    // Start is called before the first frame update
    void Start()
    {
        //inicializando o audioSource
        m_audio = GetComponent <AudioSource>();

        m_instance = this;
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        //inicializando o AudioSource
        audio = GetComponent <AudioSource> ();

        //referencia ao próprio script
        instance = this;
    }
示例#3
0
    public static void playSound(soundFX currentSount)
    {
        switch (currentSount)
        {
        case soundFX.JUMP:
            instance.Audio.PlayOneShot(instance.jump);
            break;



        case soundFX.OPEN:
            instance.Audio.PlayOneShot(instance.open);
            break;



        case soundFX.MOEDA:
            instance.Audio.PlayOneShot(instance.moeda);
            break;



        case soundFX.FIRE:
            instance.Audio.PlayOneShot(instance.fire);
            break;


        case soundFX.MORRI:
            instance.Audio.PlayOneShot(instance.morri);
            break;


        case soundFX.START:
            instance.Audio.PlayOneShot(instance.start);
            break;


        case soundFX.GO:
            instance.Audio.PlayOneShot(instance.go);
            break;


        case soundFX.BOOM:
            instance.Audio.PlayOneShot(instance.boom);
            break;


        case soundFX.MUSICA:
            instance.Audio.PlayOneShot(instance.musica);
            break;
        }
    }
示例#4
0
 public static void playSound(soundFX currentSound)
 {
     switch (currentSound)
     {
         case soundFX.JUMP:
             instance.Audio.PlayOneShot(instance.jump);
             break;
         case soundFX.OPEN:
             instance.Audio.PlayOneShot(instance.open);
             break;
         case soundFX.LAUGTH:
             instance.Audio.PlayOneShot(instance.laugth);
             break;
     }
 }