UnityEditor.AnimationClipEditor.LoopQualityLampAndCurve C# (CSharp) Méthode

LoopQualityLampAndCurve() private méthode

private LoopQualityLampAndCurve ( Rect position, float value, int lightMeterHint, bool changedStart, bool changedStop, Vector2 curves ) : void
position UnityEngine.Rect
value float
lightMeterHint int
changedStart bool
changedStop bool
curves Vector2
Résultat void
        private void LoopQualityLampAndCurve(Rect position, float value, int lightMeterHint, bool changedStart, bool changedStop, Vector2[][] curves)
        {
            if (this.m_ClipInfo != null)
            {
                GUIStyle style = new GUIStyle(EditorStyles.miniLabel) {
                    alignment = TextAnchor.MiddleRight
                };
                Rect rect = position;
                rect.xMax -= 20f;
                rect.xMin += EditorGUIUtility.labelWidth;
                GUI.Label(rect, "loop match", style);
                Event current = Event.current;
                int controlID = GUIUtility.GetControlID(lightMeterHint, FocusType.Native, position);
                if (current.GetTypeForControl(controlID) == EventType.Repaint)
                {
                    Rect rect2 = position;
                    float num3 = (22f - rect2.height) / 2f;
                    rect2.y -= num3;
                    rect2.xMax += num3;
                    rect2.height = 22f;
                    rect2.xMin = rect2.xMax - 22f;
                    if (value < 0.33f)
                    {
                        GUI.DrawTexture(rect2, s_RedLightIcon.image);
                    }
                    else if (value < 0.66f)
                    {
                        GUI.DrawTexture(rect2, s_OrangeLightIcon.image);
                    }
                    else
                    {
                        GUI.DrawTexture(rect2, s_GreenLightIcon.image);
                    }
                    GUI.DrawTexture(rect2, s_LightRimIcon.image);
                }
                if (changedStart || changedStop)
                {
                    Rect rect3 = position;
                    rect3.y += rect3.height + 1f;
                    rect3.height = 18f;
                    GUI.color = new Color(0f, 0f, 0f, EditorGUIUtility.isProSkin ? 0.3f : 0.8f);
                    GUI.DrawTexture(rect3, EditorGUIUtility.whiteTexture);
                    rect3 = new RectOffset(-1, -1, -1, -1).Add(rect3);
                    if (!EditorGUIUtility.isProSkin)
                    {
                        GUI.color = new Color(0.3529412f, 0.3529412f, 0.3529412f, 1f);
                    }
                    else
                    {
                        GUI.color = new Color(0.254902f, 0.254902f, 0.254902f, 1f);
                    }
                    GUI.DrawTexture(rect3, EditorGUIUtility.whiteTexture);
                    GUI.color = Color.white;
                    GUI.BeginGroup(rect3);
                    Matrix4x4 drawingToViewMatrix = this.m_TimeArea.drawingToViewMatrix;
                    drawingToViewMatrix.m00 = rect3.width / this.m_TimeArea.shownArea.width;
                    drawingToViewMatrix.m11 = rect3.height - 1f;
                    drawingToViewMatrix.m03 = (-this.m_TimeArea.shownArea.x * rect3.width) / this.m_TimeArea.shownArea.width;
                    drawingToViewMatrix.m13 = 0f;
                    Vector2[] vectorArray = curves[!changedStart ? 1 : 0];
                    Vector3[] points = new Vector3[vectorArray.Length];
                    Color[] colors = new Color[vectorArray.Length];
                    Color color = new Color(1f, 0.3f, 0.3f);
                    Color color2 = new Color(1f, 0.8f, 0f);
                    Color color3 = new Color(0f, 1f, 0f);
                    for (int i = 0; i < points.Length; i++)
                    {
                        points[i] = (Vector3) vectorArray[i];
                        points[i] = drawingToViewMatrix.MultiplyPoint3x4(points[i]);
                        if ((1f - vectorArray[i].y) < 0.33f)
                        {
                            colors[i] = color;
                        }
                        else if ((1f - vectorArray[i].y) < 0.66f)
                        {
                            colors[i] = color2;
                        }
                        else
                        {
                            colors[i] = color3;
                        }
                    }
                    Handles.DrawAAPolyLine(colors, points);
                    GUI.color = new Color(0.3f, 0.6f, 1f);
                    GUI.DrawTexture(new Rect(drawingToViewMatrix.MultiplyPoint3x4(new Vector3((!changedStart ? this.m_StopFrame : this.m_StartFrame) / this.m_Clip.frameRate, 0f, 0f)).x, 0f, 1f, rect3.height), EditorGUIUtility.whiteTexture);
                    GUI.DrawTexture(new Rect(drawingToViewMatrix.MultiplyPoint3x4(new Vector3((!changedStart ? this.m_StartFrame : this.m_StopFrame) / this.m_Clip.frameRate, 0f, 0f)).x, 0f, 1f, rect3.height), EditorGUIUtility.whiteTexture);
                    GUI.color = Color.white;
                    GUI.EndGroup();
                }
            }
        }