public void OnGUI() { if (Event.current.type != EventType.Repaint) { return; } if (engine != null) { EmotionSpectrum spectrum = engine.GetSpectrum(timeline.CurrentIndicatorNormalized); currentSpectrum = EmotionSpectrum.Lerp(currentSpectrum, spectrum, .3f); rect.GetWorldCorners(shapeCorners); DrawEmotionShape(new Rect(shapeCorners[0], shapeCorners[2] - shapeCorners[0]), Color.magenta, currentSpectrum); } }