Esempio n. 1
0
        public void Release()
        {
            m_data.ValidateNotNull();
            var header = m_data.Header;

#if ENABLE_UNITY_COLLECTIONS_CHECKS
            if (header->Allocator == Allocator.None)
            {
                throw new InvalidOperationException("It's not possible to release a blob asset reference that was deserialized. It will be automatically released when the scene is unloaded ");
            }
            m_data.Header->Invalidate();
#endif

            UnsafeUtility.Free(header, header->Allocator);
            m_data.m_Ptr = null;
        }