public TextureViewer(EditorWindow hostWindow)
        {
            // m_hostWindow = hostWindow;

            // create the table with a specified object type
            m_dataTable = new TableView(hostWindow, typeof(TextureImportData));

            // setup the description for content
            m_dataTable.AddColumn("RootPath", "PackageRootPath", 0.26f, TextAnchor.MiddleLeft);
            m_dataTable.AddColumn("FileNameMatch", "Name", 0.05f);
            m_dataTable.AddColumn("Index", "Priority", 0.04f);
            m_dataTable.AddColumn("TotalCount", "Count", 0.04f);
            m_dataTable.AddColumn("TotalMemuse", "Memory", 0.04f, TextAnchor.MiddleCenter, "<fmt_bytes>");
            m_dataTable.AddColumn("TexType", "TextureType", 0.08f);
            m_dataTable.AddColumn("ShapeType", "Shape", 0.04f);
            m_dataTable.AddColumn("AlphaMode", "AlphaMode", 0.05f);
            m_dataTable.AddColumn("AndroidFormat", "AndroidFormat", 0.08f);
            m_dataTable.AddColumn("IosFormat", "IosFormat", 0.08f);
            m_dataTable.AddColumn("MaxSize", "MaxSize", 0.04f);
            m_dataTable.AddColumn("ReadWriteEnable", "R/W", 0.04f);
            m_dataTable.AddColumn("MipmapEnable", "Mipmap", 0.04f);
            m_dataTable.AddColumn("PreBuild", "PreBuild", 0.04f);
            m_dataTable.AddColumn("ForceSet", "Force", 0.04f);
            m_dataTable.AddColumn("AlwaysMatch", "Always", 0.04f);

            // sorting
            m_dataTable.SetSortParams(2, false);

            m_showTable = new TableView(hostWindow, typeof(TextureInfo));

            m_showTable.AddColumn("Path", "Path", 0.45f, TextAnchor.MiddleLeft);
            m_showTable.AddColumn("MemSize", "Memory", 0.05f, TextAnchor.MiddleCenter, "<fmt_bytes>");
            m_showTable.AddColumn("ReadWriteEnable", "R/W", 0.05f);
            m_showTable.AddColumn("MipmapEnable", "Mipmap", 0.05f);
            m_showTable.AddColumn("AndroidFormat", "AndroidFormat", 0.1f);
            m_showTable.AddColumn("IosFormat", "IosFormat", 0.1f);
            m_showTable.AddColumn("ImportType", "ImportType", 0.1f);
            m_showTable.AddColumn("ImportShape", "ImportShape", 0.1f);

            m_showTable.SetSortParams(1, true);

            m_control = new TextureDataControl(m_dataTable, m_showTable);

            // register the event-handling function
            m_dataTable.OnSelected += m_control.OnDataSelected;
            m_showTable.OnSelected += m_control.OnInfoSelected;
        }
Exemple #2
0
        public TextureViewer(EditorWindow hostWindow)
        {
            m_dataTable = new TableView(hostWindow, typeof(TextureImportData));

            m_dataTable.AddColumn("RootPath", "PackageRootPath", 0.26f, TextAnchor.MiddleLeft);
            m_dataTable.AddColumn("FileNameMatch", "Name", 0.05f);
            m_dataTable.AddColumn("Index", "Priority", 0.04f);
            m_dataTable.AddColumn("TotalCount", "Count", 0.04f);
            m_dataTable.AddColumn("TotalMemuse", "Memory", 0.04f, TextAnchor.MiddleCenter, "<fmt_bytes>");
            m_dataTable.AddColumn("TexType", "TextureType", 0.08f);
            m_dataTable.AddColumn("ShapeType", "Shape", 0.04f);
            m_dataTable.AddColumn("AlphaMode", "AlphaMode", 0.05f);
            m_dataTable.AddColumn("AndroidFormat", "AndroidFormat", 0.08f);
            m_dataTable.AddColumn("IosFormat", "IosFormat", 0.08f);
            m_dataTable.AddColumn("MaxSize", "MaxSize", 0.04f);
            m_dataTable.AddColumn("ReadWriteEnable", "R/W", 0.04f);
            m_dataTable.AddColumn("MipmapEnable", "Mipmap", 0.04f);
            m_dataTable.AddColumn("PreBuild", "PreBuild", 0.04f);
            m_dataTable.AddColumn("ForceSet", "Force", 0.04f);
            m_dataTable.AddColumn("AlwaysMatch", "Always", 0.04f);

            m_dataTable.SetSortParams(2, false);

            m_showTable = new TableView(hostWindow, typeof(TextureInfo));

            m_showTable.AddColumn("Path", "Path", 0.45f, TextAnchor.MiddleLeft);
            m_showTable.AddColumn("MemSize", "Memory", 0.05f, TextAnchor.MiddleCenter, "<fmt_bytes>");
            m_showTable.AddColumn("ReadWriteEnable", "R/W", 0.05f);
            m_showTable.AddColumn("MipmapEnable", "Mipmap", 0.05f);
            m_showTable.AddColumn("AndroidFormat", "AndroidFormat", 0.1f);
            m_showTable.AddColumn("IosFormat", "IosFormat", 0.1f);
            m_showTable.AddColumn("ImportType", "ImportType", 0.1f);
            m_showTable.AddColumn("ImportShape", "ImportShape", 0.1f);

            m_showTable.SetSortParams(1, true);

            m_control = new TextureDataControl(m_dataTable, m_showTable);

            m_dataTable.OnSelected += m_control.OnDataSelected;
            m_showTable.OnSelected += m_control.OnInfoSelected;
        }