Esempio n. 1
0
        private void ShowAssets()
        {
            if (_assetPaths == null)
            {
                _assetPaths = Operator.GetAssetPaths();
                if (!string.IsNullOrEmpty(_searchText))
                {
                    _assetPaths = _assetPaths.Where(s => s.Contains(_searchText)).ToList();
                }
            }

            var count = _assetPaths.Count;

            for (int i = 0; i < count; i++)
            {
                EditorUIHelper.Space(0.1f);
                EditorUIHelper.BeginSelectdColor(_selectedObjIndex == i);
                {
                    EditorUIHelper.BeginHorizontal(EditorUIHelper.TextAreaStyle);
                    {
                        var path = _assetPaths[i];

                        var i1 = i;
                        EditorUIHelper.Button(path, () =>
                        {
                            EditorAssetHelper.SelectObject(AssetDatabase.LoadMainAssetAtPath(path));
                            _selectedObjIndex = i1;
                        }, EditorUIHelper.TextFieldStyle);
                    }
                    EditorUIHelper.EndHorizontal();
                }
                EditorUIHelper.EndSelectedColor();
            }

            if (_selectedObjIndex >= 0)
            {
                ShowSettingPanel(Operator.GetImporterSetting(_assetPaths[_selectedObjIndex]));
            }
        }