void DrawTabbar(TranslucentImageSource tiSource)
        {
            EditorGUILayout.Space();

            using (var v = new EditorGUILayout.VerticalScope())
            {
                GUI.Box(v.rect, GUIContent.none);
                EditorGUILayout.LabelField("Blur settings", EditorStyles.centeredGreyMiniLabel);

                using (var h = new EditorGUILayout.HorizontalScope())
                {
                    GUILayout.FlexibleSpace();

                    tab = GUILayout.Toolbar(tab,
                                            new[] { "Simple", "Advanced" },
                                            GUILayout.MinWidth(0),
                                            GUILayout.MaxWidth(EditorGUIUtility.pixelsPerPoint * 192));
                    if (tab != previousTab)
                    {
                        SaveTab();
                        previousTab = tab;
                    }

                    advanced.target = tab > 0;

                    GUILayout.FlexibleSpace();
                }

                EditorGUILayout.Space();

                DrawTabsContent(tiSource);

                EditorGUILayout.Space();
            }
        }
        void DrawTabsContent(TranslucentImageSource tiSource)
        {
            //Simple tab
            if (EditorGUILayout.BeginFadeGroup(1 - advanced.faded))
            {
                tiSource.Strength = Mathf.Max(0, EditorGUILayout.FloatField("Strength", tiSource.Strength));
            }

            EditorGUILayout.EndFadeGroup();

            //Advanced tab
            if (EditorGUILayout.BeginFadeGroup(advanced.faded))
            {
                tiSource.Size = EditorGUILayout.FloatField(sizeLabel, tiSource.Size);

                tiSource.Iteration = EditorGUILayout.IntSlider(new GUIContent(iterLabel),
                                                               tiSource.Iteration,
                                                               Min,
                                                               MaxIteration);

                tiSource.Downsample = EditorGUILayout.IntSlider(new GUIContent(dsLabel),
                                                                tiSource.Downsample,
                                                                Min,
                                                                MaxDownsample);
            }

            EditorGUILayout.EndFadeGroup();
        }
 // Use this for initialization
 void Awake()
 {
     source = GetComponent <TranslucentImageSource>();
 }
 /// <summary>
 /// When adding new Translucent Image Source to existing Camera at run time, the new Source must be registered here
 /// </summary>
 /// <param name="source"></param>
 public void RegisterSource(TranslucentImageSource source)
 {
     tisCache.Add(source.GetComponent <Camera>(), source);
 }
 /// <summary>
 /// When adding new Translucent Image Source to existing Camera at run time, the new Source must be registered here
 /// </summary>
 /// <param name="source"></param>
 public void RegisterSource(TranslucentImageSource source)
 {
     tisCache[source.GetComponent <Camera>()] = source;
 }