void OnGUI()
        {
            if (GUI.Button(new Rect(10, 10, 150, 100), "Play"))
            {
                var output = new SineToneOutput {
                    Frequency = Frequency
                };

                if (m_Handle.Valid)
                {
                    m_Handle.Dispose();
                }
                m_Handle = output.AttachToDefaultOutput();
                StartCoroutine(TimeoutSine(Duration));
            }
        }
    void OnDisable()
    {
        // Command blocks can also be completed via the C# 'using' construct for convenience
        using (var block = m_Graph.CreateCommandBlock())
        {
            block.Disconnect(m_Connection);
            block.ReleaseDSPNode(m_Node);
        }

        m_Graph.RemoveNodeEventHandler(m_HandlerID);

        m_Output.Dispose();
    }
Exemplo n.º 3
0
 void OnDestroy()
 {
     _outputHandle.Dispose();
 }