Inheritance: UnityEngine.MonoBehaviour
Ejemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            if (!serializedObject.isEditingMultipleObjects)
            {
                EditorGUILayout.Space();
                Bloom b = (Bloom)target;
                _graph.Prepare(b);
                _graph.DrawGraph();
                EditorGUILayout.Space();

                base.OnInspectorGUI();

                int d = EditorGUILayout.Popup("开发模式:", b.debugMode, options);
                if (d != b.debugMode)
                {
                    b.debugMode = d;
                    EditorUtility.SetDirty(target);
                }
            }
            else
            {
                base.OnInspectorGUI();
            }



            serializedObject.ApplyModifiedProperties();
        }
Ejemplo n.º 2
0
        public override void OnInspectorGUI()
        {
            Bloom bloom = (Bloom)target;

            serializedObject.Update();

            if (!serializedObject.isEditingMultipleObjects)
            {
                EditorGUILayout.Space();
                _graph.Prepare(bloom);
                _graph.DrawGraph();
                EditorGUILayout.Space();
            }

            EditorGUILayout.PropertyField(_Lock, _textLock);
            if (!bloom.lockParameters)
            {
                EditorGUILayout.PropertyField(_threshold, _textThreshold);
                EditorGUILayout.PropertyField(_softKnee, _textSoftKnee);
                EditorGUILayout.PropertyField(_intensity, _textIntensity);
                EditorGUILayout.PropertyField(_radius, _textRadius);
                //EditorGUILayout.PropertyField(_highQuality);
                EditorGUILayout.PropertyField(_antiFlicker, _textAntiFlicker);

                EditorGUILayout.PropertyField(ex, _textEX, null);
                EditorGUILayout.PropertyField(ex2, _textEX2, null);
                EditorGUILayout.PropertyField(_SoftFocus, _textSoftFocus, null);
            }
            serializedObject.ApplyModifiedProperties();
        }
Ejemplo n.º 3
0
        // Update internal state with a given bloom instance.
        public void Prepare(Bloom bloom)
        {
            if (bloom.GetComponent <Camera>().allowHDR)
            {
                _rangeX = 6;
                _rangeY = 1.5f;
            }
            else
            {
                _rangeX = 1;
                _rangeY = 1;
            }

            _threshold = bloom.thresholdLinear;
            _knee      = bloom.softKnee * _threshold + 1e-5f;

            // Intensity is capped to prevent sampling errors.
            _intensity = Mathf.Min(bloom.intensity, 10);
        }
Ejemplo n.º 4
0
    private static void AddBloom()
    {
        var sobj = Selection.activeGameObject;

        if (sobj == null)
        {
            return;
        }
        Kino.Bloom b = sobj.GetComponent <Kino.Bloom>();
        if (b == null)
        {
            b = sobj.AddComponent <Kino.Bloom>();
            b.thresholdGamma = 0.5f;
            b.softKnee       = 0.5f;
            b.intensity      = 0.06f;
            b.radius         = 2.5f;
//			b.highQuality = false;
            b.antiFlicker = true;
        }
    }
Ejemplo n.º 5
0
        // Update internal state with a given bloom instance.
        public void Prepare(Bloom bloom)
        {
            #if UNITY_5_6_OR_NEWER
            if (bloom.GetComponent <Camera>().allowHDR)
            #else
            if (bloom.GetComponent <Camera>().hdr)
            #endif
            {
                _rangeX = 6;
                _rangeY = 1.5f;
            }
            else
            {
                _rangeX = 1;
                _rangeY = 1;
            }

            _threshold = bloom.ThresholdLinear;
            _knee      = bloom.SoftKnee * _threshold + 1e-5f;

            // Intensity is capped to prevent sampling errors.
            _intensity = Mathf.Min(bloom.Intensity, 10);
        }
Ejemplo n.º 6
0
        // Update internal state with a given bloom instance.
        public void Prepare(Bloom bloom)
        {
            if (bloom.GetComponent<Camera>().hdr)
            {
                _rangeX = 6;
                _rangeY = 1.5f;
            }
            else
            {
                _rangeX = 1;
                _rangeY = 1;
            }

            _threshold = bloom.thresholdLinear;
            _knee = bloom.softKnee * _threshold + 1e-5f;

            // Intensity is capped to prevent sampling errors.
            _intensity = Mathf.Min(bloom.intensity, 10);
        }