コード例 #1
0
        public static void RenderColorGroupRow(Rect rect, SkyProfile profile, ColorKeyframeGroup colors)
        {
            bool sortGroup = false;

            RenderColorGroupRow(rect, colors);

            for (int i = 0; i < colors.keyframes.Count; i++)
            {
                ColorKeyframe currentKey = colors.GetKeyframe(i);

                // Track key marker mouse events and render.
                bool didSingleClick  = false;
                bool isDragging      = false;
                bool keyframeUpdated = false;
                SkyEditorUtility.DrawHorizontalKeyMarker(rect, currentKey, profile,
                                                         out didSingleClick, out isDragging, out keyframeUpdated);

                if (keyframeUpdated)
                {
                    sortGroup = true;
                }

                // Show the color keyframe property window.
                if (didSingleClick || isDragging)
                {
                    // Load info about this keyframe and show the editor window.
                    KeyframeInspectorWindow.SetKeyframeData(
                        currentKey, colors, KeyframeInspectorWindow.KeyType.Color, profile);

                    if (didSingleClick)
                    {
                        KeyframeInspectorWindow.ShowWindow();
                    }
                }
            }

            if (sortGroup)
            {
                colors.SortKeyframes();
            }
        }