public void OnEnable(Rect pos, EditorWindow parent)
        {
            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 List <string>();
            }

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


            RefreshBundles();
        }
Esempio n. 2
0
        private void LoadBundles()
        {
            if (m_Data.m_BundlePath == string.Empty)
            {
                return;
            }

            //find assets
            if (m_BundleList == null)
            {
                m_BundleList = new List <string>();
            }

            m_BundleList.Clear();
            if (Directory.Exists(m_Data.m_BundlePath))
            {
                AddFilePathToList(m_Data.m_BundlePath);
            }
            m_BundleTreeView.Reload();
        }