public DynamicAtlas(DynamicAtlasGroup group, bool topFirst) { mTopFirst = topFirst; _DynamicAtlasGroup = group; int length = (int)group; tmpColor = new Color32[length * length]; for (int k = 0; k < tmpColor.Length; ++k) { tmpColor[k] = Color.clear; } if (AtlasConfig.kUsingCopyTexture == false) { mMaterial = new Material(Shader.Find("DynamicAtlas/GraphicBlit")); mBlitParamId = Shader.PropertyToID("_DrawRect"); } mWidth = length; mHeight = length; mPadding = padding; mUVXDiv = 1f / mWidth; mUVYDiv = 1f / mHeight; CreateNewAtlas(); }
public void SetGroup(DynamicAtlasGroup group) { if (m_Atlas != null) { return; } m_Group = group; m_Atlas = DynamicAtlasManager.Instance.GetDynamicAtlas(group); }
public static void ShowWindow(DynamicAtlasGroup mGroup) { if (_DynamicAtlasWindow == null) { _DynamicAtlasWindow = GetWindow <DynamicAtlasWindow>(); } _DynamicAtlasWindow.Show(); _DynamicAtlasWindow.Init(mGroup); _DynamicAtlasWindow.titleContent.text = "PackingAtlas"; }
private void SetGroup(DynamicAtlasGroup group) { if (m_Atlas != null) { return; } m_Group = group; m_Atlas = DynamicAtlasMgr.S.GetDynamicAtlas(group); }
public DynamicAtlas(DynamicAtlasGroup group) { int length = (int)group; m_TempColor = new Color32[length * length]; for (int i = 0; i < m_TempColor.Length; i++) { m_TempColor[i] = Color.clear; } m_Width = length; m_Height = length; CreateNewPage(); }
public DynamicAtlas GetDynamicAtlas(DynamicAtlasGroup group, bool topFirst = true) { DynamicAtlas data; if (m_DynamicAtlas.ContainsKey(group)) { data = m_DynamicAtlas[group]; } else { data = new DynamicAtlas(group, topFirst); m_DynamicAtlas[group] = data; } return(data); }
//-------------------------------- public PackingAtlas GetPackingAtlas(DynamicAtlasGroup group) { PackingAtlas data; if (m_PackingAtlas.ContainsKey(group)) { data = m_PackingAtlas[group]; } else { data = new PackingAtlas(group); m_PackingAtlas[group] = data; } return(data); }
public DynamicAtlas GetDynamicAtlas(DynamicAtlasGroup group) { DynamicAtlas atlas; if (m_DynamicAtlasMap.ContainsKey(group)) { atlas = m_DynamicAtlasMap[group]; } else { atlas = new DynamicAtlas(group); m_DynamicAtlasMap[group] = atlas; } return(atlas); }
public PackingAtlas(DynamicAtlasGroup group) { int length = (int)group; mWidth = length; mHeight = length; tmpColor = new Color32[length * length]; for (int k = 0; k < tmpColor.Length; ++k) { tmpColor[k] = Color.clear; } mUVXDiv = 1f / mWidth; mUVYDiv = 1f / mHeight; mOutsideRectangle = new IntegerRectangle(mWidth + 1, mWidth + 1, 0, 0); if (AtlasConfig.kUsingCopyTexture == false) { mMaterial = new Material(Shader.Find("DynamicAtlas/GraphicBlit")); mBlitParamId = Shader.PropertyToID("_DrawRect"); } CreateNewAtlas(); }
public void Init(DynamicAtlasGroup mGroup) { _mGroup = mGroup; }