private GetTexturesForAtlas ( string atlasName ) : UnityEngine.Texture2D[] | ||
atlasName | string | |
리턴 | UnityEngine.Texture2D[] |
private void RefreshState() { string[] atlasNames = Packer.atlasNames; if (!((IEnumerable <string>)atlasNames).SequenceEqual <string>((IEnumerable <string>) this.m_AtlasNames)) { if (atlasNames.Length == 0) { this.Reset(); return; } this.OnAtlasNameListChanged(); } if (this.m_AtlasNames.Length == 0) { this.SetNewTexture((Texture2D)null); } else { if (this.m_SelectedAtlas >= this.m_AtlasNames.Length) { this.m_SelectedAtlas = 0; } string atlasName = this.m_AtlasNames[this.m_SelectedAtlas]; Texture2D[] texturesForAtlas1 = Packer.GetTexturesForAtlas(atlasName); if (this.m_SelectedPage >= texturesForAtlas1.Length) { this.m_SelectedPage = 0; } this.SetNewTexture(texturesForAtlas1[this.m_SelectedPage]); Texture2D[] texturesForAtlas2 = Packer.GetAlphaTexturesForAtlas(atlasName); this.SetAlphaTextureOverride(this.m_SelectedPage >= texturesForAtlas2.Length ? (Texture2D)null : texturesForAtlas2[this.m_SelectedPage]); } }
private void RefreshState() { string[] atlasNames = Packer.atlasNames; if (!atlasNames.SequenceEqual(this.m_AtlasNames)) { if (atlasNames.Length == 0) { this.Reset(); return; } this.OnAtlasNameListChanged(); } if (this.m_AtlasNames.Length == 0) { base.SetNewTexture(null); return; } if (this.m_SelectedAtlas >= this.m_AtlasNames.Length) { this.m_SelectedAtlas = 0; } string atlasName = this.m_AtlasNames[this.m_SelectedAtlas]; Texture2D[] texturesForAtlas = Packer.GetTexturesForAtlas(atlasName); if (this.m_SelectedPage >= texturesForAtlas.Length) { this.m_SelectedPage = 0; } base.SetNewTexture(texturesForAtlas[this.m_SelectedPage]); }
private void OnSelectionChange() { if (Selection.activeObject == null) { return; } Sprite sprite = Selection.activeObject as Sprite; if (sprite != this.m_SelectedSprite) { if (sprite != null) { string selAtlasName; Texture2D selAtlasTexture; Packer.GetAtlasDataForSprite(sprite, out selAtlasName, out selAtlasTexture); int num = this.m_AtlasNames.ToList <string>().FindIndex((string s) => selAtlasName == s); if (num == -1) { return; } int num2 = Packer.GetTexturesForAtlas(selAtlasName).ToList <Texture2D>().FindIndex((Texture2D t) => selAtlasTexture == t); if (num2 == -1) { return; } this.m_SelectedAtlas = num; this.m_SelectedPage = num2; this.RefreshAtlasPageList(); } this.m_SelectedSprite = sprite; base.Repaint(); } }
private void RefreshState() { // Check if atlas name list changed string[] atlasNames = Packer.atlasNames; if (!atlasNames.SequenceEqual(m_AtlasNames)) { if (atlasNames.Length == 0) { Reset(); return; } else { OnAtlasNameListChanged(); } } if (m_AtlasNames.Length == 0) { SetNewTexture(null); return; } // Validate selections if (m_SelectedAtlas >= m_AtlasNames.Length) { m_SelectedAtlas = 0; } string curAtlasName = m_AtlasNames[m_SelectedAtlas]; Texture2D[] textures = Packer.GetTexturesForAtlas(curAtlasName); if (m_SelectedPage >= textures.Length) { m_SelectedPage = 0; } SetNewTexture(textures[m_SelectedPage]); // check if the atlas has alpha as an external texture (as in ETC1 atlases with alpha) Texture2D[] alphaTextures = Packer.GetAlphaTexturesForAtlas(curAtlasName); Texture2D selectedAlphaTexture = (m_SelectedPage < alphaTextures.Length) ? alphaTextures[m_SelectedPage] : null; SetAlphaTextureOverride(selectedAlphaTexture); }
private void RefreshAtlasPageList() { if (this.m_AtlasNames.Length > 0) { Texture2D[] texturesForAtlas = Packer.GetTexturesForAtlas(this.m_AtlasNames[this.m_SelectedAtlas]); this.m_PageNames = new string[texturesForAtlas.Length]; for (int index = 0; index < texturesForAtlas.Length; ++index) { this.m_PageNames[index] = string.Format("Page {0}", (object)(index + 1)); } } else { this.m_PageNames = PackerWindow.s_PageNamesEmpty; } if (this.m_SelectedPage < this.m_PageNames.Length) { return; } this.m_SelectedPage = 0; }
private void RefreshAtlasPageList() { if (this.m_AtlasNames.Length > 0) { string atlasName = this.m_AtlasNames[this.m_SelectedAtlas]; Texture2D[] texturesForAtlas = Packer.GetTexturesForAtlas(atlasName); this.m_PageNames = new string[texturesForAtlas.Length]; for (int i = 0; i < texturesForAtlas.Length; i++) { this.m_PageNames[i] = string.Format("Page {0}", i + 1); } } else { this.m_PageNames = PackerWindow.s_PageNamesEmpty; } if (this.m_SelectedPage >= this.m_PageNames.Length) { this.m_SelectedPage = 0; } }
private void OnSelectionChange() { if (Selection.activeObject == (UnityEngine.Object)null) { return; } Sprite activeObject = Selection.activeObject as Sprite; if (!((UnityEngine.Object)activeObject != (UnityEngine.Object) this.m_SelectedSprite)) { return; } if ((UnityEngine.Object)activeObject != (UnityEngine.Object)null) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type PackerWindow.\u003COnSelectionChange\u003Ec__AnonStoreyB5 changeCAnonStoreyB5 = new PackerWindow.\u003COnSelectionChange\u003Ec__AnonStoreyB5(); // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field Packer.GetAtlasDataForSprite(activeObject, out changeCAnonStoreyB5.selAtlasName, out changeCAnonStoreyB5.selAtlasTexture); // ISSUE: reference to a compiler-generated method int index1 = ((IEnumerable <string>) this.m_AtlasNames).ToList <string>().FindIndex(new Predicate <string>(changeCAnonStoreyB5.\u003C\u003Em__219)); if (index1 == -1) { return; } // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated method int index2 = ((IEnumerable <Texture2D>)Packer.GetTexturesForAtlas(changeCAnonStoreyB5.selAtlasName)).ToList <Texture2D>().FindIndex(new Predicate <Texture2D>(changeCAnonStoreyB5.\u003C\u003Em__21A)); if (index2 == -1) { return; } this.m_SelectedAtlas = index1; this.m_SelectedPage = index2; this.RefreshAtlasPageList(); } this.m_SelectedSprite = activeObject; this.Repaint(); }
void OnSelectionChange() { if (Selection.activeObject == null) { return; } Sprite selectedSprite = Selection.activeObject as Sprite; if (selectedSprite != m_SelectedSprite) { if (selectedSprite != null) { string selAtlasName; Texture2D selAtlasTexture; Packer.GetAtlasDataForSprite(selectedSprite, out selAtlasName, out selAtlasTexture); int selAtlasIndex = m_AtlasNames.ToList().FindIndex(delegate(string s) { return(selAtlasName == s); }); if (selAtlasIndex == -1) { return; } int selAtlasPage = Packer.GetTexturesForAtlas(selAtlasName).ToList().FindIndex(delegate(Texture2D t) { return(selAtlasTexture == t); }); if (selAtlasPage == -1) { return; } m_SelectedAtlas = selAtlasIndex; m_SelectedPage = selAtlasPage; RefreshAtlasPageList(); } m_SelectedSprite = selectedSprite; Repaint(); } }
private void RefreshAtlasPageList() { if (m_AtlasNames.Length > 0) { string atlas = m_AtlasNames[m_SelectedAtlas]; Texture2D[] textures = Packer.GetTexturesForAtlas(atlas); m_PageNames = new string[textures.Length]; for (int i = 0; i < textures.Length; ++i) { m_PageNames[i] = string.Format(PackerWindowStyle.pageContentLabel.text, i + 1); } } else { m_PageNames = s_PageNamesEmpty; } // Validate if (m_SelectedPage >= m_PageNames.Length) { m_SelectedPage = 0; } }