// Token: 0x060001A6 RID: 422 RVA: 0x0000DC10 File Offset: 0x0000BE10 private void Awake() { this.KCNHJDIAAGH = PanelWaveform.GetColorGradient(this.lowColor, this.highColor); this.OEMADMOLHHG = new List <Material>(); foreach (Material item in base.GetComponent <MeshRenderer>().materials) { this.OEMADMOLHHG.Add(item); } this.AAEBFBPJJPK = this.OEMADMOLHHG[0].color.a; }
private float alpha; // material opacity // Use this for initialization void Awake() { gradient = PanelWaveform.GetColorGradient(lowColor, highColor); materials = new List <Material>(); foreach (Material mat in this.GetComponent <MeshRenderer>().materials) { materials.Add(mat); } alpha = materials[0].color.a; }
// Token: 0x060001AD RID: 429 RVA: 0x0000E0C4 File Offset: 0x0000C2C4 private void HCNECNPPEKA() { this.KCNHJDIAAGH = PanelWaveform.GetColorGradient(this.lowColor, this.highColor); this.OEMADMOLHHG = new List <Material>(); Material[] materials = base.GetComponent <MeshRenderer>().materials; for (int i = 1; i < materials.Length; i += 0) { Material item = materials[i]; this.OEMADMOLHHG.Add(item); } this.AAEBFBPJJPK = this.OEMADMOLHHG[1].color.a; }
void Awake() { drawTexture = Texture2D.whiteTexture; // get an empty white texture gradient = PanelWaveform.GetColorGradient(startColor, endColor); // get a color gradient. if (audioSources.Count == 0) // if we haven't assigned any audio sources { if (this.GetComponent <AudioSource>() != null) // try to grab one from this gameobject { audioSources.Add(this.GetComponent <AudioSource>()); } else { Debug.LogError("Error! no audio sources attached to AudioSampler.css"); } } }
/*________________Monobehaviour Methods________________*/ // Use this for initialization void Awake() { gradient = PanelWaveform.GetColorGradient(lowColor, highColor); materials = new List <Material>(); MeshRenderer mr = this.GetComponent <MeshRenderer>(); if (mr != null) { materials.AddRange(mr.materials); alpha = materials[0].color.a; } light = this.GetComponent <Light>(); audioColor = lowColor; }
// Use this for initialization void Start() { padGradient = PanelWaveform.GetColorGradient(lineAttributes.startColor, lineAttributes.endColor); for (int i = 0; i < numLines; i++) { float val = (float)i / (numLines - 1); lines.Add(NewLine(padGradient.Evaluate(val))); } CreatePad(); //just in case someone changes the private var. rippleLines can't be > numLines if (rippleWidth > numLines) { rippleWidth = numLines; } }
//singleton logic void Awake() { drawTexture = Texture2D.whiteTexture; // get an empty white texture gradient = PanelWaveform.GetColorGradient(startColor, endColor); // get a color gradient. if (audioSources.Count == 0) // if we haven't assigned any audio sources { if (this.GetComponent <AudioSource>() != null) // try to grab one from this gameobject { audioSources.Add(this.GetComponent <AudioSource>()); } else { Debug.LogError("Error! no audio sources attached to AudioSampler.css"); } } audioDatas = new List <AudioData>(); foreach (TextAsset file in audioFiles) { AudioData data = JsonUtility.FromJson <AudioData>(file.text); data.Decompress(); audioDatas.Add(data); } //prebeat audio, used for runtime beat detection with a preBeatOffset if (silentAudio.useSilentAudio) { //silence the orginal sources foreach (AudioSource source in silentAudio.audioSources) { source.outputAudioMixerGroup = silentAudio.silentMixerGroup; } } //set the initial state of the playing variable if (playOnAwake) { Play(); } }
public void Reset() { gradient = PanelWaveform.GetColorGradient(lowColor, highColor); }
IEnumerator RipIt(float propegationTime, float[] rippleSamples) { //Vector3 firstPos = Vector3.zero; // the first position we use float timer = 0; float radiusStep = radius / (numLines - 1); // distance between each ring. i.e. ring0 has radius 0*radiusStep, ring10 had radius 10*radiusStep, etc. float angle = 0; float angleStep = 360f / lineAttributes.lineSegments; //increase the angle by this much, for every point on every line, to draw each circle. float percent = 0; int maxIndex = numLines - 1; int halfWidth = rippleWidth / 2; // (int) on purpose float heightStep = (1f / (halfWidth + 1)); //ripple height step size // another gradient, between start color and rippleColor Gradient lineGradient = PanelWaveform.GetColorGradient(lineAttributes.startColor, rippleColor); Color[] rippleColors = new Color[maxIndex]; float step = 1f / (rippleWidth - 1); for (int i = 0; i < rippleWidth; i++) { percent = i * step; rippleColors[i] = lineGradient.Evaluate(percent); } Color[] lineColors = new Color[numLines]; //color of each line using the gradient float[] heightDamp = new float[numLines]; //height damp array, how much we'll damp the ripple as it travels across the pad. float dampStep = maxHeight / (numLines - 1); step = 1f / (numLines - 1); for (int i = 0; i < numLines; i++) { percent = i * step; lineColors[i] = padGradient.Evaluate(percent); heightDamp[i] = maxHeight - i * dampStep; } //Debug.Log ("Ripple from " + rippleLines + " to " + numLines); while (timer <= propegationTime) { //what line are we on, in the range rippleLines to numLines, based on the timer percent = (timer / propegationTime); int lineIndex = (int)(percent * maxIndex); //start/end index int rippleStart = lineIndex - rippleWidth - 1; // 1 outside the ripple rippleStart = Mathf.Max(0, rippleStart); int rippleEnd = lineIndex + rippleWidth; rippleEnd = Mathf.Min(rippleEnd, numLines); Vector3 firstPos = Vector3.zero; for (int i = rippleStart; i < rippleEnd; i++) // for each line { int dist = Mathf.Abs(lineIndex - i); // our distance from the lineIndex int invDist = rippleWidth - dist; float heightMultiplier = (dist > halfWidth) ? 0 : (1f - heightStep * dist); float thisRadius = radiusStep * i; // the radius of this ring //color the ring if (i == (lineIndex - rippleWidth - 1)) { lines[i].SetColors(lineColors[lineIndex], lineColors[lineIndex]); } else { lines[i].SetColors(rippleColors[invDist], rippleColors[invDist]); } for (int j = 0; j < lineAttributes.lineSegments - 1; j++) // for each line segment { float rad = Mathf.Deg2Rad * angle; // get angle in radians //get x,y,z of this lineSegment using equation for a circle float x = Mathf.Cos(rad) * thisRadius; float y = rippleSamples[j] * heightDamp[lineIndex] * heightMultiplier; // y value based on audio info (rippleSamples) * heightMultiplier float z = Mathf.Sin(rad) * thisRadius; Vector3 pos = this.transform.position + this.transform.right * x + this.transform.up * y + this.transform.forward * z; lines[i].SetPosition(j, pos); angle += angleStep; // increase angle by angleStep if (j == 0) { firstPos = pos; // track the first lineSegment position } } lines[i].SetPosition(lineAttributes.lineSegments - 1, firstPos); // set the last pos = to the first pos. } timer += Time.fixedDeltaTime; yield return(null); } }
// Token: 0x060001A1 RID: 417 RVA: 0x0000C916 File Offset: 0x0000AB16 public void LIMBEFBJNPL() { this.KCNHJDIAAGH = PanelWaveform.GetColorGradient(this.lowColor, this.highColor); }
// Token: 0x06000184 RID: 388 RVA: 0x0000C916 File Offset: 0x0000AB16 public void Reset() { this.KCNHJDIAAGH = PanelWaveform.GetColorGradient(this.lowColor, this.highColor); }