예제 #1
0
    public override void OnInspectorGUI()
    {
        GUILayout.BeginVertical();
        GUILayout.Box(_logo, GUIStyle.none);

        _material.objectReferenceValue = EditorGUILayout.ObjectField("Material", Target.tvMaterialTube, typeof(Material), false) as Material;

        // SCANLINE PROPERTIES
        _foldScanline = UEditor.BeginGroup(null, "Scanline", _foldScanline, Color.Lerp(Color.gray, Color.white, 0.4f));
        if (_foldScanline)
        {
            // Select the scanline texture pattern
            _scanlinePattern.objectReferenceValue = EditorGUILayout.ObjectField("Pattern", Target.scanlinePattern, typeof(Texture), false) as Texture;
            // Adjust the screen resolution for the scanline
            //GUILayout.BeginHorizontal();
            _scanlineCount.intValue      = EditorGUILayout.IntField("Line Count", Target.scanlineCount);
            _scanlineCountAuto.boolValue = EditorGUILayout.Toggle("Auto Line Count", Target.scanlineCountAuto);
            //GUILayout.EndHorizontal();
            if ((target as OLDTVTube).scanlineCountAuto)
            {
                UEditor.BeginBox("Using screen height as line counter.", Color.yellow); UEditor.EndBox();
            }

            // Adjust the scanline bright
            float tMin = Target.scanlineBrightMin;
            float tMax = Target.scanlineBrightMax;
            EditorGUILayout.MinMaxSlider(new GUIContent("Bright"), ref tMin, ref tMax, 0.0f, 1.0f);
            _scanlineBrightMin.floatValue = tMin;
            _scanlineBrightMax.floatValue = tMax;

            _scanlineBrightMin.floatValue = EditorGUILayout.Slider("Min Bright", Target.scanlineBrightMin, 0.0f, 1.0f);
            _scanlineBrightMax.floatValue = EditorGUILayout.Slider("Max Bright", Target.scanlineBrightMax, 0.0f, 1.0f);

            if (_scanlineBrightMin.floatValue > _scanlineBrightMax.floatValue)
            {
                _scanlineBrightMin.floatValue = _scanlineBrightMax.floatValue;
            }
        }
        UEditor.EndGroup();

        // TUBE PROPERTIES
        _foldTube = UEditor.BeginGroup(null, "Tube", _foldTube, Color.Lerp(Color.gray, Color.white, 0.4f));
        if (_foldTube)
        {
            _tubeMask.objectReferenceValue   = EditorGUILayout.ObjectField("Mask", Target.mask, typeof(Texture), false) as Texture;
            _tubeReflex.objectReferenceValue = EditorGUILayout.ObjectField("Reflex", Target.reflex, typeof(Texture), false) as Texture;

            _tubeReflexMagnetude.floatValue  = EditorGUILayout.Slider("Reflex Magnetude", Target.reflexMagnetude, 0.0f, 1.0f);
            _tubeRadialDistortion.floatValue = EditorGUILayout.Slider("Radial Distortion", Target.radialDistortion, -1.0f, 1.0f);

            //_scanlinePattern.objectReferenceValue = EditorGUILayout.ObjectField( "Reflex", _scanlinePattern.objectReferenceValue, typeof( Texture2D ), false ) as Texture2D;
        }
        UEditor.EndGroup();
        GUILayout.EndVertical();

        // Apply the values
        serializedObject.ApplyModifiedProperties();
        Repaint();
    }