Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (renderer.isVisible && !graphControler.isVisibleNode(transform.gameObject))
        {
            graphControler.registerVisibleNode(transform.gameObject);
        }

        if (!renderer.isVisible && graphControler.isVisibleNode(transform.gameObject))
        {
            graphControler.removeVisibleNode(transform.gameObject);
        }

        // Switching off particules if not playing audio
        if (!audio.isPlaying)
        {
            particleSystem.Stop();
        }
    }