void ISpriteEditorDataProvider.InitSpriteEditorDataProvider()
        {
            var so            = new SerializedObject(m_TextureImporter);
            var spriteSheetSO = so.FindProperty("m_SpriteSheet.m_Sprites");

            m_SpritesMultiple = new List <SpriteDataExt>();
            m_SpriteSingle    = new SpriteDataExt(so);

            for (int i = 0; i < spriteSheetSO.arraySize; ++i)
            {
                var sp   = spriteSheetSO.GetArrayElementAtIndex(i);
                var data = new SpriteDataExt(sp);
                m_SpritesMultiple.Add(data);
            }
            m_SecondaryTextureDataTransfer = SpriteSecondaryTextureDataTransfer.Load(so);
        }
Ejemplo n.º 2
0
        void ISpriteEditorDataProvider.InitSpriteEditorDataProvider()
        {
            var so = GetSerializedObject();

            var spriteSheetSo = so.FindProperty("m_SpriteSheet.m_Sprites");

            m_SpritesMultiple = new List <SpriteDataExt>();
            m_SpriteSingle    = new SpriteDataExt(so);

            if (spriteSheetSo.arraySize > 0)
            {
                var sp = spriteSheetSo.GetArrayElementAtIndex(0);
                for (int i = 0; i < spriteSheetSo.arraySize; ++i)
                {
                    var data = new SpriteDataExt(sp);
                    m_SpritesMultiple.Add(data);
                    sp.Next(false);
                }
            }
            m_SecondaryTextureDataTransfer = SpriteSecondaryTextureDataTransfer.Load(so);

            m_NameFileIdPairs = GetSerializedNameFileIdTable(so);
        }