Exemplo n.º 1
0
    void Awake()
    {
        GameObject      go    = GameObject.Find("SoundManager");
        backgroundMusic other = (backgroundMusic)go.GetComponent(typeof(backgroundMusic));

        tone = other.getTone();
    }
Exemplo n.º 2
0
    public void Dead()
    {
        GameObject      go    = GameObject.Find("SoundManager");
        backgroundMusic other = (backgroundMusic)go.GetComponent(typeof(backgroundMusic));
        bool            tone  = other.getTone();

        if (tone == true)
        {
            source.PlayOneShot(die);
        }
    }