/// <summary> /// 激活页表 /// </summary> private TableNode ActivatePage(int x, int y, int mip) { if (mip > m_PageTable.MipLevel) { return(null); } // 找到当前可用的页表 var page = m_PageTable.GetAvailable(x, y, mip); if (page == null) { // 没有可用页表,加载根节点 LoadPage(x, y, m_PageTable); return(null); } else if (page.MipLevel > mip) { // 可用页表不是请求的mipmap等级,请求加载下一级 LoadPage(x, y, page.GetChild(x, y)); } // 激活对应的平铺贴图块 m_TileTexture.SetActive(page.Payload.TileIndex); page.Payload.ActiveFrame = Time.frameCount; return(page); }
private void UseOrCreatePagePointer(int x, int y, int mip, int frame) { if (mip > MaxMipLevel) { mip = MaxMipLevel; } var page = quadRoot.GetAvailable(x, y, mip); if (page == null) { CreatePagePointer(x, y, quadRoot); } else { page.Payload.ActiveFrame = frame; tileGenerator.SetActive(page.Payload.TileIndex); if (page.MipLevel > mip) { CreatePagePointer(x, y, page.GetChild(x, y)); } } }