Beispiel #1
0
 public void InitBundles()
 {
     if (!haveBundlesBeenInited)
     {
         RuntimeUtilities.CreateIfNull(ref m_BeforeTransparentBundles);
         RuntimeUtilities.CreateIfNull(ref m_BeforeStackBundles);
         RuntimeUtilities.CreateIfNull(ref m_AfterStackBundles);
         m_Bundles = new Dictionary <Type, PostProcessBundle>();
         foreach (Type key in PostProcessManager.instance.settingsTypes.Keys)
         {
             PostProcessEffectSettings settings = (PostProcessEffectSettings)ScriptableObject.CreateInstance(key);
             PostProcessBundle         value    = new PostProcessBundle(settings);
             m_Bundles.Add(key, value);
         }
         UpdateBundleSortList(m_BeforeTransparentBundles, PostProcessEvent.BeforeTransparent);
         UpdateBundleSortList(m_BeforeStackBundles, PostProcessEvent.BeforeStack);
         UpdateBundleSortList(m_AfterStackBundles, PostProcessEvent.AfterStack);
         sortedBundles = new Dictionary <PostProcessEvent, List <SerializedBundleRef> >(default(PostProcessEventComparer))
         {
             {
                 PostProcessEvent.BeforeTransparent,
                 m_BeforeTransparentBundles
             },
             {
                 PostProcessEvent.BeforeStack,
                 m_BeforeStackBundles
             },
             {
                 PostProcessEvent.AfterStack,
                 m_AfterStackBundles
             }
         };
         haveBundlesBeenInited = true;
     }
 }
Beispiel #2
0
        public void InitBundles()
        {
            // Create these lists only once, the serialization system will take over after that
            RuntimeUtilities.CreateIfNull(ref m_BeforeTransparentBundles);
            RuntimeUtilities.CreateIfNull(ref m_BeforeStackBundles);
            RuntimeUtilities.CreateIfNull(ref m_AfterStackBundles);

            // Create a bundle for each effect type
            m_Bundles = new Dictionary <Type, PostProcessBundle>();

            foreach (var type in PostProcessManager.instance.settingsTypes.Keys)
            {
                var settings = (PostProcessEffectSettings)ScriptableObject.CreateInstance(type);
                var bundle   = new PostProcessBundle(settings);
                m_Bundles.Add(type, bundle);
            }

            // Update sorted lists with newly added or removed effects in the assemblies
            UpdateBundleSortList(m_BeforeTransparentBundles, PostProcessEvent.BeforeTransparent);
            UpdateBundleSortList(m_BeforeStackBundles, PostProcessEvent.BeforeStack);
            UpdateBundleSortList(m_AfterStackBundles, PostProcessEvent.AfterStack);

            // Push all sorted lists in a dictionary for easier access
            sortedBundles = new Dictionary <PostProcessEvent, List <SerializedBundleRef> >(new PostProcessEventComparer())
            {
                { PostProcessEvent.BeforeTransparent, m_BeforeTransparentBundles },
                { PostProcessEvent.BeforeStack, m_BeforeStackBundles },
                { PostProcessEvent.AfterStack, m_AfterStackBundles }
            };

            // Done
            haveBundlesBeenInited = true;
        }
 internal void OnEnable()
 {
     RuntimeUtilities.CreateIfNull(ref lightMeter);
     RuntimeUtilities.CreateIfNull(ref histogram);
     RuntimeUtilities.CreateIfNull(ref waveform);
     RuntimeUtilities.CreateIfNull(ref vectorscope);
     RuntimeUtilities.CreateIfNull(ref overlaySettings);
     m_Monitors = new Dictionary <MonitorType, Monitor>
     {
         {
             MonitorType.LightMeter,
             lightMeter
         },
         {
             MonitorType.Histogram,
             histogram
         },
         {
             MonitorType.Waveform,
             waveform
         },
         {
             MonitorType.Vectorscope,
             vectorscope
         }
     };
     foreach (KeyValuePair <MonitorType, Monitor> monitor in m_Monitors)
     {
         monitor.Value.OnEnable();
     }
 }
Beispiel #4
0
 public void Init(PostProcessResources resources)
 {
     if (resources != null)
     {
         m_Resources = resources;
     }
     RuntimeUtilities.CreateIfNull(ref temporalAntialiasing);
     RuntimeUtilities.CreateIfNull(ref subpixelMorphologicalAntialiasing);
     RuntimeUtilities.CreateIfNull(ref fastApproximateAntialiasing);
     RuntimeUtilities.CreateIfNull(ref dithering);
     RuntimeUtilities.CreateIfNull(ref fog);
     RuntimeUtilities.CreateIfNull(ref debugLayer);
 }
Beispiel #5
0
        public void Init(PostProcessResources resources)
        {
#if UNITY_EDITOR
            m_Resources = PostProcessResourcesFactory.Stripped(m_Resources);
#endif
            if (resources != null)
            {
                m_Resources = resources;
            }

            RuntimeUtilities.CreateIfNull(ref temporalAntialiasing);
            RuntimeUtilities.CreateIfNull(ref subpixelMorphologicalAntialiasing);
            RuntimeUtilities.CreateIfNull(ref fastApproximateAntialiasing);
            RuntimeUtilities.CreateIfNull(ref dithering);
            RuntimeUtilities.CreateIfNull(ref fog);
            RuntimeUtilities.CreateIfNull(ref debugLayer);
        }