private bool RenderSpherePointPropertyGroup(ProfileGroupDefinition def)
        {
            EditorGUILayout.BeginHorizontal();
            bool valueChanged = false;

            SpherePointKeyframeGroup group = m_Profile.GetGroup <SpherePointKeyframeGroup>(def.propertyKey);

            if (m_Profile.IsManagedByTimeline(def.propertyKey))
            {
                EditorGUILayout.PrefixLabel(new GUIContent(def.groupName, def.tooltip));
                RenderManagedOnTimlineMessage();
            }
            else
            {
                SpherePointKeyframe frame = group.GetKeyframe(0);

                EditorGUILayout.BeginVertical();

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField(new GUIContent(group.name, def.tooltip));
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();

                EditorGUI.BeginChangeCheck();
                EditorGUI.indentLevel += 1;
                SpherePoint selectedPoint = SpherePointGUI.SpherePointField(
                    frame.spherePoint, true, frame.id);
                EditorGUI.indentLevel -= 1;
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RecordObject(m_Profile, "Changed sphere point");
                    frame.spherePoint = selectedPoint;
                }

                EditorGUILayout.EndVertical();
            }

            EditorGUILayout.EndHorizontal();
            return(valueChanged);
        }
Esempio n. 2
0
        private bool RenderSpherePointGUI()
        {
            bool didModify = false;

            SpherePointKeyframe spherePointKeyframe = keyframe as SpherePointKeyframe;

            if (spherePointKeyframe == null)
            {
                return(false);
            }

            EditorGUILayout.BeginHorizontal();
            EditorGUI.BeginChangeCheck();
            SpherePoint selectedSpherePoint = SpherePointGUI.SpherePointField(spherePointKeyframe.spherePoint, true, keyframe.id);

            if (EditorGUI.EndChangeCheck())
            {
                spherePointKeyframe.spherePoint = selectedSpherePoint;
                didModify = true;
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            EditorGUI.BeginChangeCheck();
            GUIStyle style = GUI.skin.button;

            EditorGUILayout.PrefixLabel(
                new GUIContent("Normalize Speed",
                               "Adjust all keyframes so that there is a constant speed of animation between them."));
            GUILayout.Button(new GUIContent("Reposition All Keyframes..."), style);
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(profile, "Normalize keyframe speeds");
                didModify = true;
                SpherePointTimelineRow.RepositionKeyframesForConstantSpeed(group as SpherePointKeyframeGroup);
            }
            EditorGUILayout.EndHorizontal();

            return(didModify);
        }
Esempio n. 3
0
 public static void OnSceneGUI(SceneView sceneView)
 {
     SpherePointGUI.RenderSpherePointSceneSelection();
 }