Ejemplo n.º 1
0
        private void _onListElementGUI(Rect rect, int index, bool isactive, bool isfocused)
        {
            const float GAP = 5;

            BuildRuleFilter filter = m_rule_config.Filters[index];

            rect.y++;

            Rect r = rect;

            r.height      = 18;
            r.xMin        = rect.xMin;
            r.width       = 20;
            filter.select = EditorGUI.Toggle(r, filter.select);

            r.xMin     = r.xMax + GAP;
            r.width    = 100;
            filter.des = EditorGUI.TextField(r, filter.des);

            r.xMin            = r.xMax + GAP;
            r.width           = 300;
            GUI.enabled       = false;
            filter.searchPath = EditorGUI.TextField(r, filter.searchPath);
            GUI.enabled       = true;

            r.xMin  = r.xMax + GAP;
            r.width = 50;
            if (GUI.Button(r, "Select"))
            {
                var path = _selectFolder();
                if (path != null)
                {
                    filter.searchPath = path;
                }
            }

            r.xMin  = r.xMax + GAP;
            r.width = 100;
            BuildAssetType type = (BuildAssetType)Enum.Parse(typeof(BuildAssetType), filter.searchPattern.Substring(2));

            type = (BuildAssetType)EditorGUI.EnumPopup(r, type);
            filter.searchPattern = "*." + type.ToString();

            r.xMin      = r.xMax + GAP;
            r.width     = 218;
            filter.type = (BuildRuleType)EditorGUI.EnumPopup(r, (Enum)filter.type);

            r.xMin            = r.xMax + GAP;
            r.width           = 100;
            GUI.enabled       = filter.type == BuildRuleType.BuildAssetsWithAssetBundleName;
            filter.bundleName = EditorGUI.TextField(r, filter.bundleName);
            GUI.enabled       = true;

            r.xMin = r.xMax + GAP;
            r.xMax = rect.xMax;
            filter.searchOption = (SearchOption)EditorGUI.EnumPopup(r, (Enum)filter.searchOption);
        }
Ejemplo n.º 2
0
        private void _addReorderableItem(ReorderableList _list)
        {
            string path = _selectFolder();

            if (!string.IsNullOrEmpty(path))
            {
                BuildRuleFilter config = new BuildRuleFilter();
                config.searchPath = path;
                m_rule_config.Filters.Add(config);
            }
        }