Beispiel #1
0
        public override void OnInspectorGUI()
        {
            GifRecorder recorder = (GifRecorder)target;

            EditorGUILayout.HelpBox("This inspector is only used to tweak default values for the component. To change values at runtime, use the Setup() method.", MessageType.Info);

            // Don't let the user tweak settings while playing as it may break everything
            if (Application.isEditor && Application.isPlaying)
            {
                GUI.enabled = false;
            }

            serializedObject.Update();

            // Hooray for propertie drawers !
            EditorGUILayout.PropertyField(m_AutoAspect, new GUIContent("Automatic Height", "Automatically compute height from the current aspect ratio."));
            EditorGUILayout.PropertyField(m_Width, new GUIContent("Width", "Output gif width in pixels."));

            if (!m_AutoAspect.boolValue)
            {
                EditorGUILayout.PropertyField(m_Height, new GUIContent("Height", "Output gif height in pixels."));
            }
            else
            {
                EditorGUILayout.LabelField(new GUIContent("Height", "Output gif height in pixels."), new GUIContent(m_Height.intValue.ToString()));
            }

            EditorGUILayout.PropertyField(m_Quality, new GUIContent("Compression Quality", "Lower values mean better quality but slightly longer processing time. 15 is generally a good middleground value."));
            EditorGUILayout.PropertyField(m_Repeat, new GUIContent("Repeat", "-1 to disable, 0 to loop indefinitely, >0 to loop a set number of time."));
            EditorGUILayout.PropertyField(m_FramePerSecond, new GUIContent("Frames Per Second", "The number of frames per second the gif will run at."));
            EditorGUILayout.PropertyField(m_BufferSize, new GUIContent("Record Time", "The amount of time (in seconds) to record to memory."));

            serializedObject.ApplyModifiedProperties();

            GUI.enabled = true;

            recorder.ComputeHeight();
            EditorGUILayout.LabelField("Estimated VRam Usage", recorder.EstimatedMemoryUse.ToString("F3") + " MB");
        }
 public IDisposable StartRecording(FrameworkElement container, FrameworkElement root, string fileName, int fps)
 {
     System.Diagnostics.Debug.Assert(_activeRecorder == null);
     return _activeRecorder = new GifRecorder(container, root, fileName, fps);
 }
 public IDisposable StartRecording(FrameworkElement container, FrameworkElement root, string fileName, int fps)
 {
     System.Diagnostics.Debug.Assert(_activeRecorder == null);
     return(_activeRecorder = new GifRecorder(container, root, fileName, fps));
 }