Beispiel #1
0
            private static bool Prefix(PostProcessingBehaviour __instance)
            {
                if (!ModEntryPoint.autoFPSBoost.Value)
                {
                    return(true);
                }

                PostProcessingBehaviour[] behaviours = Resources.FindObjectsOfTypeAll <PostProcessingBehaviour>();
                for (int i = 0; i < behaviours.Length; i++)
                {
                    PostProcessingBehaviour behaviour = behaviours[i];
                    if (!behaviour.Equals(__instance))
                    {
                        behaviour.enabled = false;
                        Object.Destroy(behaviour);
                    }
                }

                GraphicsUtils.Dispose();
                return(false);
            }
Beispiel #2
0
        void OnDisable()
        {
            // Clear command buffers
            foreach (var cb in m_CommandBuffers.Values)
            {
                m_Camera.RemoveCommandBuffer(cb.Key, cb.Value);
                cb.Value.Dispose();
            }

            m_CommandBuffers.Clear();

            // Clear components
            if (profile != null)
            {
                DisableComponents();
            }

            m_Components.Clear();

            // Factories
            m_MaterialFactory.Dispose();
            m_RenderTextureFactory.Dispose();
            GraphicsUtils.Dispose();
        }