// Use this for initialization void Start() { audioPeer = GameObject.FindObjectOfType <AudioPeer>(); noiseFlowField = GetComponent <NoiseFlowField>(); audioMaterial = new Material[8]; color1 = new Color[8]; color2 = new Color[8]; for (int i = 0; i < 8; i++) { color1[i] = gradient1.Evaluate((1f / 8f) * i); color2[i] = gradient2.Evaluate((1f / 8f) * i); audioMaterial[i] = new Material(material); } int countBand = 0; for (int i = 0; i < noiseFlowField.particles.Count; i++) { band = countBand % 8; noiseFlowField.particleMeshRenderer[i].material = audioMaterial[band]; noiseFlowField.particles[i].audioband = band; countBand++; } }
void Start() { NFF = GameObject.Find("NoiseFlowField").GetComponent <NoiseFlowField>(); audioPeer = GameObject.Find("AudioPeer").GetComponent <AudioPeer>(); AFF = NFF.GetComponent <AudioFlowField>(); this.gameObject.GetComponent <MeshRenderer>().material = AFF.audioMaterial[band]; audioband = band; this.transform.rotation = Random.rotation; }
// Use this for initialization void Start() { NFF = GameObject.Find("NoiseFlowField").GetComponent <NoiseFlowField>(); AFF = NFF.GetComponent <AudioFlowField>(); int band = Random.Range(0, 8); //for(int i = 0; i < NFF.bloomParticles.Count; i++) //{ // //int band = NFF.countBand % 8; // NFF.staticParticleMeshRenderer[i].material = AFF.audioMaterial[band]; // NFF.staticParticles[i].audioband = band; // NFF.countBand++; //} }
// Use this for initialization void Start() { _noiseFlowField = GetComponent <NoiseFlowField>(); _audioMaterial = new Material[64]; _color1 = new Color[64]; _color2 = new Color[64]; for (int i = 0; i < 64; i++) { _color1[i] = _gradient1.Evaluate((1f / 8f) * i); _color2[i] = _gradient2.Evaluate((1f / 8f) * i); _audioMaterial[i] = new Material(_material); } int countBand = 0; for (int i = 0; i < _noiseFlowField._amountOfParticles; i++) { int band = countBand % 64; _noiseFlowField._particleMeshRenderer[i].material = _audioMaterial[band]; _noiseFlowField._particles[i]._audioBand = band; countBand++; } }
void Start() { _audioMaterial = new Material[COLORS_NUMBER]; _color1 = new Color[COLORS_NUMBER]; _color2 = new Color[COLORS_NUMBER]; for (int i = 0; i < COLORS_NUMBER; i++) { _color1[i] = _gradient1.Evaluate(1f / COLORS_NUMBER * i); _color2[i] = _gradient2.Evaluate(1f / COLORS_NUMBER * i); _audioMaterial[i] = new Material(_material); } _noiseFlowfield = GetComponent <NoiseFlowField>(); int countBand = 0; for (int i = 0; i < _noiseFlowfield._amountOfParticles; i++) { int band = countBand % 8; _noiseFlowfield._particleMeshRender[i].material = _audioMaterial[band]; _noiseFlowfield._particles[i]._audioBand = band; countBand++; } }