Ejemplo n.º 1
0
        private void OnRenderImage(RenderTexture src, RenderTexture dest)
        {
            try // Weird managed resource error when building or loading a scene
            {
                if (IsInitialized)
                {
                    #if UNITY_EDITOR
                    UpdateEditorTimeData();
                    #endif

                    CommonDataManager.UpdateData();

                    Shader.SetGlobalInt("_frameID", FrameId);

                    _frustum.ComputeData();

                    ++FrameId;
                    //}
                    //
                    //if (IsInitialized && applyAsPostProcess)
                    //{
                    Profiler.BeginSample("Aura 2 : Apply as post process");
                    Graphics.Blit(src, dest, _postProcessMaterial);
                    Profiler.EndSample();
                }
                else
                {
                    Graphics.CopyTexture(src, dest);
                }
            }
            catch
            {
                Graphics.CopyTexture(src, dest);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Uninitialize the Aura component and dispose its managed variables
        /// </summary>
        private void Uninitialize()
        {
            if (IsInitialized)
            {
                Shader.DisableKeyword("AURA");

                _frustum.Dispose();
                _frustum = null;

                CommonDataManager.Dispose();

                IsInitialized = false;
            }
        }