예제 #1
0
        void DestroyPages()
        {
            m_PointPage.Dispose();
            m_PointPage = null;

            m_BilinearPage.Dispose();
            m_BilinearPage = null;

            m_Database.Clear();
        }
예제 #2
0
        void InitPages()
        {
            // Sanitize the parameters
            int cleanMaxSubTextureSize = Mathf.Max(m_MaxSubTextureSize, 1);

            cleanMaxSubTextureSize = Mathf.NextPowerOfTwo(cleanMaxSubTextureSize);

            int cleanMaxAtlasSize = Mathf.Max(m_MaxAtlasSize, 1);

            cleanMaxAtlasSize = Mathf.NextPowerOfTwo(cleanMaxAtlasSize);
            cleanMaxAtlasSize = Mathf.Min(cleanMaxAtlasSize, SystemInfo.maxRenderTextureSize);

            int cleanMinAtlasSize = Mathf.Max(m_MinAtlasSize, 1);

            cleanMinAtlasSize = Mathf.NextPowerOfTwo(cleanMinAtlasSize);
            cleanMinAtlasSize = Mathf.Min(cleanMinAtlasSize, cleanMaxAtlasSize);

            var cleanMinSize = new Vector2Int(cleanMinAtlasSize, cleanMinAtlasSize);
            var cleanMaxSize = new Vector2Int(cleanMaxAtlasSize, cleanMaxAtlasSize);

            m_PointPage    = new DynamicAtlasPage(RenderTextureFormat.ARGB32, FilterMode.Point, cleanMinSize, cleanMaxSize);
            m_BilinearPage = new DynamicAtlasPage(RenderTextureFormat.ARGB32, FilterMode.Bilinear, cleanMinSize, cleanMaxSize);
        }