Exemplo n.º 1
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
            if (current == this)
            {
                current = null;
            }
            iRunnableObjects.Dispose();
            CustomDrawRequest.Dispose();
            if (m_afterFrameBuffer != null)
            {
                m_afterFrameBuffer.Dispose();
                m_afterFrameBuffer = null;
            }
            if (m_beforeFrameBuffer != null)
            {
                m_beforeFrameBuffer.Dispose();
                m_beforeFrameBuffer = null;
            }

            try
            {
                eventsGuideBook.Dispose();
                waitReleaseRT.Dispose();
            }
            catch { }
            SceneController.Dispose(resources);
            resources.loadingThread.Dispose();
            data.buffer.Dispose();
            var allEvents = resources.allEvents;

            for (int i = 0; i < resources.availiableEvents.Length; ++i)
            {
                resources.availiableEvents[i].DisposeEvent();
            }
            for (int i = 0; i < resources.availiableEvents.Length; ++i)
            {
                resources.availiableEvents[i].DisposeDependEventsList();
            }

            foreach (var camPtr in PipelineCamera.CameraSearchDict)
            {
                PipelineCamera cam = MUnsafeUtility.GetObject <PipelineCamera>((void *)camPtr.value);
                if (cam.allDatas.isCreated)
                {
                    foreach (var i in cam.allDatas)
                    {
                        IPerCameraData data = ((IPerCameraData)MUnsafeUtility.GetHookedObject(i.value));
                        data.DisposeProperty();
                        MUnsafeUtility.RemoveHookedObject(i.value);
                    }
                    cam.allDatas.Dispose();
                }
            }
            if (motionVectorMatricesBuffer != null)
            {
                motionVectorMatricesBuffer.Dispose();
            }
            MotionVectorDrawer.Dispose();
        }
Exemplo n.º 2
0
        public static void RemoveProperty <T>(PipelineCamera camera)
        {
            int            index = camera.allDatas[(ulong)MUnsafeUtility.GetManagedPtr(typeof(T))];
            IPerCameraData data  = MUnsafeUtility.GetHookedObject(index) as IPerCameraData;

            if (data != null)
            {
                data.DisposeProperty();
            }
            MUnsafeUtility.RemoveHookedObject(index);
        }
Exemplo n.º 3
0
        private void OnDestroy()
        {
            if (allDatas.isCreated)
            {
                foreach (var i in allDatas)
                {
                    IPerCameraData data = ((IPerCameraData)MUnsafeUtility.GetHookedObject(i.value));
                    data.DisposeProperty();
                    MUnsafeUtility.RemoveHookedObject(i.value);
                }
                allDatas.Dispose();
            }
            cam = null;

            /* foreach (var i in commandBuffers.Values)
             * {
             *   i.Dispose();
             * }
             * commandBuffers = null;
             */
        }