Exemple #1
0
    void _showAssetGroupABList()
    {
        var list = _resourceComponent.GetAssetGroupList(_groupTag);

        if (list == null)
        {
            return;
        }

        foreach (var s in list)
        {
            Log.Debug($"资源组:{_groupTag},资源包:{s}");
        }
    }
Exemple #2
0
        private void _showResourceGroup(ResourceComponent resourceComponent)
        {
            if (isEditorResourceMode)
            {
                return;
            }

            var groups = resourceComponent.GetAllGroupList();

            if (groups == null)
            {
                return;
            }

            foreach (var @group in groups)
            {
                if (!_showState.ContainsKey(@group))
                {
                    _showState.Add(@group, false);
                }
                _showState[@group] = EditorGUILayout.Foldout(_showState[@group],
                                                             $"资源组:{(string.IsNullOrEmpty(@group) ? "<none>" : @group)}", true);
                if (_showState[@group])
                {
                    EditorGUI.indentLevel += 1;
                    {
                        var abList = resourceComponent.GetAssetGroupList(@group);
                        if (abList == null)
                        {
                            return;
                        }
                        foreach (var ab in abList)
                        {
                            var key = $"{@group}{ab}";
                            if (!_showState.ContainsKey(key))
                            {
                                _showState.Add(key, false);
                            }
                            var assets     = resourceComponent.GetAssetsList(ab);
                            var assetCount = 0;

                            if (assets != null)
                            {
                                assetCount = assets.Count();
                            }

                            _showState[key] = EditorGUILayout.Foldout(_showState[key], $"资源包:{ab},资源个数:{assetCount}", true);

                            if (_showState[key])
                            {
                                if (assets == null)
                                {
                                    return;
                                }

                                foreach (var asset in assets)
                                {
                                    EditorGUI.indentLevel += 1;
                                    {
                                        EditorGUILayout.LabelField($"资源:{asset}");
                                    }
                                    EditorGUI.indentLevel -= 1;
                                }
                            }
                        }
                    }
                    EditorGUI.indentLevel -= 1;
                }
            }
        }