void Start()
    {
        // Get audio spectrum manager, audio container object, and start the FFT analysis
        audioSpectrumMgrComp = (AudioSpectrumManager)gameObject.GetComponent("AudioSpectrumManager");
        AudioSource newSource = PlayAtIndex(currentSongIndex);

        audioSpectrumMgrComp.StartSpectrum(newSource.gameObject.transform);

        fileMgrComp = (FileManager)fileMgrObj.GetComponent("FileManager");
    }
Example #2
0
    private void Start()
    {
        audioObj = GameObject.Find("Main Camera");
        pulse    = audioObj.GetComponent("AudioSpectrumManager") as AudioSpectrumManager;
        mat      = gameObject.renderer.material;

        //different textures use different properties for the main color
        if (mat.HasProperty("_Color"))
        {
            colorType = "_Color";
        }
        else if (mat.HasProperty("_TintColor"))
        {
            colorType = "_TintColor";
        }

        origColor = mat.GetColor(colorType);
    }