Beispiel #1
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            Initialize(property);

            using (var check = new EditorGUI.ChangeCheckScope())
            {
                if (m_MaskedSourceNames == null)
                {
                    m_MaskedSourceNames = EnumHelper.MaskOutEnumNames <ImageSource>((int)m_SupportedSources);
                }
                var index = EnumHelper.GetMaskedIndexFromEnumValue <ImageSource>(m_Source.intValue, (int)m_SupportedSources);
                index = EditorGUILayout.Popup("Object(s) of interest", index, m_MaskedSourceNames);

                if (check.changed)
                {
                    m_Source.intValue = EnumHelper.GetEnumValueFromMaskedIndex <ImageSource>(index, (int)m_SupportedSources);
                }
            }

            var inputType = (ImageSource)m_Source.intValue;

            if ((ImageSource)m_Source.intValue == ImageSource.TaggedCamera)
            {
                ++EditorGUI.indentLevel;
                EditorGUILayout.PropertyField(m_CameraTag, new GUIContent("Tag"));
                --EditorGUI.indentLevel;
            }

            EditorGUILayout.PropertyField(m_AspectRatio, new GUIContent("Aspect Ratio"));
            EditorGUILayout.PropertyField(m_SuperSampling, new GUIContent("Super sampling"));

            var renderSize = m_RenderSize;

            m_RenderSize.intValue = ResolutionSelector.Popup("Rendering resolution", ImageHeight.x4320p_8K, m_RenderSize.intValue);

            if (m_FinalSize.intValue > renderSize.intValue)
            {
                m_FinalSize.intValue = renderSize.intValue;
            }

            m_FinalSize.intValue = ResolutionSelector.Popup("Output Resolution", target.maxSupportedSize, m_FinalSize.intValue);

            if (m_FinalSize.intValue == (int)ImageHeight.Window)
            {
                m_FinalSize.intValue = (int)ImageHeight.x720p_HD;
            }

            if (m_FinalSize.intValue > renderSize.intValue)
            {
                renderSize.intValue = m_FinalSize.intValue;
            }

            EditorGUILayout.PropertyField(m_FlipFinalOutput, new GUIContent("Flip Vertical"));

            if (Options.verboseMode)
            {
                EditorGUILayout.LabelField("Color Space", target.colorSpace.ToString());
            }
        }
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            Initialize(property);

            m_RenderSize.intValue = ResolutionSelector.Popup("Output Resolution", target.maxSupportedSize, m_RenderSize.intValue);

            if (m_RenderSize.intValue > (int)ImageHeight.Window)
            {
                EditorGUILayout.PropertyField(m_RenderAspect, new GUIContent("Aspect Ratio"));
            }
        }
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            Initialize(property);

            using (var check = new EditorGUI.ChangeCheckScope())
            {
                if (m_MaskedSourceNames == null)
                {
                    m_MaskedSourceNames = EnumHelper.MaskOutEnumNames <ImageSource>((int)m_SupportedSources);
                }

                var index = EnumHelper.GetMaskedIndexFromEnumValue <ImageSource>(m_Source.intValue, (int)m_SupportedSources);
                index = EditorGUILayout.Popup("Source", index, m_MaskedSourceNames);

                if (check.changed)
                {
                    m_Source.intValue = EnumHelper.GetEnumValueFromMaskedIndex <ImageSource>(index, (int)m_SupportedSources);
                }
            }

            var inputType = (ImageSource)m_Source.intValue;

            if ((ImageSource)m_Source.intValue == ImageSource.TaggedCamera)
            {
                ++EditorGUI.indentLevel;
                EditorGUILayout.PropertyField(m_CameraTag, new GUIContent("Tag"));
                --EditorGUI.indentLevel;
            }

            m_RenderSize.intValue = ResolutionSelector.Popup("Output Resolution", target.maxSupportedSize, m_RenderSize.intValue);

            if (m_RenderSize.intValue > (int)ImageHeight.Window)
            {
                EditorGUILayout.PropertyField(m_RenderAspect, new GUIContent("Aspect Ratio"));
            }

            if (inputType == ImageSource.ActiveCamera)
            {
                EditorGUILayout.PropertyField(m_IncludeUI, new GUIContent("Include UI"));
            }

            EditorGUILayout.PropertyField(m_FlipFinalOutput, new GUIContent("Flip Vertical"));
        }