Exemplo n.º 1
0
        internal void OnEnable(Rect pos)
        {
            m_Position = pos;
            if (m_Data == null)
            {
                m_Data = new InspectTabData();
            }

            //LoadData...
            var dataPath = System.IO.Path.GetFullPath(".");

            dataPath  = dataPath.Replace("\\", "/");
            dataPath += "/Library/AssetBundleBrowserInspect.dat";

            if (File.Exists(dataPath))
            {
                BinaryFormatter bf   = new BinaryFormatter();
                FileStream      file = File.Open(dataPath, FileMode.Open);
                var             data = bf.Deserialize(file) as InspectTabData;
                if (data != null)
                {
                    m_Data = data;
                }
                file.Close();
            }


            if (m_BundleList == null)
            {
                m_BundleList = new Dictionary <string, List <string> >();
            }

            if (m_BundleTreeState == null)
            {
                m_BundleTreeState = new TreeViewState();
            }
            m_BundleTreeView = new InspectBundleTree(m_BundleTreeState, this);

            foreach (var dir in ParseFolder())
            {
                BrowseForFolder(dir);
            }

            RefreshBundles();
        }