void OnEnable()
    {
        string xmlPath = Application.dataPath + @"/Editor/AssetBundle/AssetBundleConfig.xml";

        m_DAL  = new AssetBundleDAL(xmlPath);
        m_List = m_DAL.GetList();
        m_Dic  = new Dictionary <string, bool>();

        if (m_List == null)
        {
            m_List = new List <AssetBundleEntity>();
        }

        for (int i = 0; i < m_List.Count; ++i)
        {
            if (m_List[i].Game.Equals(arrGame[gameIndex], StringComparison.CurrentCultureIgnoreCase) ||
                m_List[i].Game.Equals("common", StringComparison.CurrentCultureIgnoreCase))
            {
                m_Dic[m_List[i].Key] = true;
            }
            else
            {
                m_Dic[m_List[i].Key] = false;
            }
        }
    }
Example #2
0
    public void OnEnable()
    {
        string xmlPath = Application.dataPath + @"/Editor/AssetBundle/AssetBundleConfig.xml";

        dal    = new AssetBundleDAL(xmlPath);
        m_List = dal.GetList();
        m_Dic  = new Dictionary <string, bool>();
        for (int i = 0; i < m_List.Count; i++)
        {
            m_Dic[m_List[i].Key] = true;
        }
    }
Example #3
0
    public AssetBundleWindow()
    {
        string path = Application.dataPath + @"\Editor\AssetBundle\AssetBundleConfig.xml";

        dal  = new AssetBundleDAL(path);
        list = dal.GetList();

        dic = new Dictionary <string, bool>();
        foreach (var item in list)
        {
            dic[item.Key] = true;
        }
    }
Example #4
0
    public AssetBundleWindow()
    {
        string title = "AB资源打包窗体";

        this.titleContent = new GUIContent(title);
        string         xmlPath        = Application.dataPath + "/Editor/AssetBundle/AssetBundleConfig.xml";
        AssetBundleDAL assetBundleDAL = new AssetBundleDAL(xmlPath);

        entities = assetBundleDAL.GetList;
        for (int i = 0; i < entities.Count; i++)
        {
            dic.Add(entities[i].Key, true);
        }
    }
Example #5
0
    /// <summary>
    /// 构造函数
    /// </summary>
    public AssetBundleWindow()
    {
        string xmlPath = Application.dataPath + @"\Editor\AssetBundle\AssetBundleConfig.xml";

        dal    = new AssetBundleDAL(xmlPath);
        m_List = dal.GetList();

        //实例化字典,并添加数据
        m_Dic = new Dictionary <string, bool>();

        for (int i = 0; i < m_List.Count; i++)
        {
            m_Dic[m_List[i].Key] = true;//默认都选中
        }
    }
Example #6
0
    public void OnEnable()
    {
        XMLPath = Application.dataPath + @"\Editor\AssetBundle\AssetBundleConfig.xml";
        mDal    = new AssetBundleDAL(XMLPath);
        mList   = mDal.GetList();

        mDic = new Dictionary <string, bool>();
        foreach (var item in mList)
        {
            mDic[item.key] = false;
        }

        /*
         * for (int i = 0; i < list.Count; i++)
         * {
         *  Debug.Log(list[i].key);
         * }
         * */
    }
Example #7
0
    /// <summary>
    /// 绘制窗口
    /// </summary>
    public void OnGUI()
    {
        while (IsRun)
        {
            string path = Application.dataPath + "/Editor/AssetBundle/AssetBundleConfig.xml";
            dal   = new AssetBundleDAL(path);
            mList = dal.GetList();
            mDic  = new Dictionary <string, bool>();
            for (int i = 0; i < mList.Count; i++)
            {
                mDic[mList[i].Key] = true;
            }
            IsRun = false;
            break;
        }
        if (mList == null)
        {
            return;
        }
        #region  钮行
        EditorGUILayout.BeginHorizontal("box");
        //新建一个下拉列表
        tagIndex = EditorGUILayout.Popup(tagIndex, arrTag, GUILayout.Width(100));
        //创建一个按钮
        if (GUILayout.Button("选定Tag", GUILayout.Width(100)))
        {
            EditorApplication.delayCall = OnSelectTagCallBack;
        }
        //新建一个下拉列表
        buildTargetIndex = EditorGUILayout.Popup(buildTargetIndex, arrBuidTarget, GUILayout.Width(100));
        if (GUILayout.Button("选定Target", GUILayout.Width(100)))
        {
            EditorApplication.delayCall = OnSelectTargetCallBack;
        }
        if (GUILayout.Button("打AssetBundle包", GUILayout.Width(200)))
        {
            EditorApplication.delayCall = OnAssetBundleCallBack;
        }
        if (GUILayout.Button("清空AssetBundle包", GUILayout.Width(200)))
        {
            EditorApplication.delayCall = OnClearAssetBundleCallBack;
        }
        EditorGUILayout.Space();//用空白自动填充剩余的部分

        EditorGUILayout.EndHorizontal();
        #endregion
        #region 显示包内容
        GUILayout.BeginHorizontal("BOX");
        GUILayout.Label("包名");
        GUILayout.Label("标记", GUILayout.Width(100));
        GUILayout.Label("保存路径", GUILayout.Width(200));
        GUILayout.Label("版本", GUILayout.Width(100));
        GUILayout.Label("大小", GUILayout.Width(100));
        GUILayout.EndHorizontal();
        #endregion

        GUILayout.BeginVertical();

        pos = EditorGUILayout.BeginScrollView(pos);

        for (int i = 0; i < mList.Count; i++)
        {
            AssetBundleEntity entity = mList[i];
            GUILayout.BeginHorizontal("box");
            mDic[entity.Key] = GUILayout.Toggle(mDic[entity.Key], "", GUILayout.Width(20));
            GUILayout.Label(entity.Name);
            GUILayout.Label(entity.Tag, GUILayout.Width(100));
            GUILayout.Label(entity.ToPath, GUILayout.Width(200));
            GUILayout.Label(entity.Version.ToString(), GUILayout.Width(100));
            GUILayout.Label(entity.Size.ToString(), GUILayout.Width(100));
            GUILayout.EndHorizontal();
            foreach (string path in entity.PathList)
            {
                GUILayout.BeginHorizontal("box");
                GUILayout.Space(40);
                GUILayout.Label(path);
                GUILayout.EndHorizontal();
            }
        }

        EditorGUILayout.EndScrollView();

        GUILayout.EndVertical();
    }