Exemple #1
0
    void Start()
    {
        allMaterials = gameObject.GetComponent <materialDatabase> ();

        //Allocates udio data
        frames0 = new float[numSamples];
        frames1 = new float[numSamples];

        //Hide vuMeter base quad
        gameObject.GetComponent <Renderer>().enabled = false;
        setUpSegments();
    }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        allMaterials = gameObject.GetComponent <materialDatabase> ();

        //Instantiats the columns
        ledsColumns = new List <List <GameObject> > ();
        for (int i = 0; i < 12; i++)
        {
            List <GameObject> column = new List <GameObject>();
            ledsColumns.Add(column);
        }

        //Allocates audio data
        spectrum   = new float[numSamples];
        sampleRate = AudioSettings.outputSampleRate;

        //Hide vuMeter base quad
        gameObject.GetComponent <Renderer>().enabled = false;
        setUpSegments();
    }
Exemple #3
0
    void Start()
    {
        allMaterials = gameObject.GetComponent <materialDatabase> ();

        //Allocates udio data
        frames0 = new float[numSamples];
        frames1 = new float[numSamples];

        //Hide vuMeter base quad
        gameObject.GetComponent <Renderer>().enabled = false;
        setUpSegments();

        // get and assign AudioSource from parent-sibling gameObject

        foreach (Transform child in transform.parent.parent)
        {
            if (child.name != "VolumePanel" && child.name != "InstrumentPanel")
            {
                audioSource = child.GetComponent <AudioSource>();
            }
        }
    }