Beispiel #1
0
        void OnListElementGUI(Rect rect, int index, bool isactive, bool isfocused)
        {
            const float GAP = 5;

            AssetBundleFilter filter = _config.filters[index];

            rect.y++;

            Rect r = rect;

            r.width      = 16;
            r.height     = 18;
            filter.valid = EditorGUI.Toggle(r, filter.valid);

            r.xMin = r.xMax + GAP;
            r.xMax = r.xMax + GAP + 420;
            float assetBundleNameLength = r.width;

            filter.assetBundleName = EditorGUI.TextField(r, filter.assetBundleName);

            r.xMin = r.xMax + GAP;
            r.xMax = r.xMin + GAP + 80;
            filter.assetBundleVariant = EditorGUI.TextField(r, filter.assetBundleVariant);

            r.xMin = r.xMax + GAP;
            r.xMax = r.xMin + GAP + 80;
            filter.assetBundleGroup = EditorGUI.TextField(r, filter.assetBundleGroup);

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

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

            r.xMin        = r.xMax + GAP;
            r.xMax        = rect.xMax;
            filter.filter = EditorGUI.TextField(r, filter.filter);
        }