浏览代码

Sujith :) ->
1. Removed asset bank deprecated scripts from the project

Sujith:) 1 周之前
父节点
当前提交
33a28f8b90

+ 0 - 8
Assets/AssetBank/Editor/AssetBank.meta

@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: d59a57789822840519de9731279f79c8
-folderAsset: yes
-DefaultImporter:
-  externalObjects: {}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 9
Assets/AssetBank/Editor/AssetBankConfig.cs

@@ -1,9 +0,0 @@
-using UnityEditor;
-
-namespace AssetBank.Editor
-{
-    public class AssetBankConfig
-    {
-        
-    }
-}

+ 0 - 3
Assets/AssetBank/Editor/AssetBankConfig.cs.meta

@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 7f64670905be4967af246569fa25591d
-timeCreated: 1752831907

+ 0 - 266
Assets/AssetBank/Editor/AssetBankScanner.cs

@@ -1,266 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading;
-using LLM.Editor.Analysis;
-using LLM.Editor.Helper;
-using UnityEditor;
-using UnityEditorInternal;
-using UnityEngine;
-
-namespace AssetBank.Editor
-{
-    public class AssetBankScanner : EditorWindow
-    {
-        private List<string> folderToIgnore = new List<string>()
-        {
-            "AssetBank",
-            "Library"
-        };
-
-        private List<string> fileExtensionToIgnore = new List<string>()
-        {
-            ".meta",
-            ".dylib",
-            ".bytes",
-            ".dll"
-        };
-
-        private List<string> typesToIgnore = new List<string>()
-        {
-            typeof(DefaultAsset).ToString()
-        };
-        
-        private int currentTab = 0;
-        private string[] tabs = new[] { "General" , "Settings"};
-        
-        private readonly string folderstoignore = "AssetBankScanner_FolderToIgnore";
-        private readonly string extensiontoignore = "AssetBankScanner_FileExtensionToIgnore";
-        private readonly string typesToignore = "AssetBankScanner_TypesToIgnore";
-        private readonly string CACHE_FOLDER = "AssetBank";
-        private string cachePath;
-
-        private List<ReorderableList> prefLists = new();
-        
-        private StringBuilder projectReport = new StringBuilder();
-        
-        [MenuItem("Window/Asset Database Scanner")]
-        public static void ShowWindow()
-        {
-            var window = GetWindow<AssetBankScanner>();
-            window.titleContent = new GUIContent("Asset Database Scanner");
-            window.Show();
-        }
-
-        private void OnEnable()
-        {
-            cachePath = Path.Join("Library", CACHE_FOLDER);
-            LoadSettings();
-            SetupLists();
-        }
-
-        private void SetupLists()
-        {
-            prefLists.Add(CreateReorderableList("Folders to ignore", folderToIgnore));
-            prefLists.Add(CreateReorderableList("Files to ignore", fileExtensionToIgnore));
-            prefLists.Add(CreateReorderableList("Types to ignore", typesToIgnore));
-        }
-
-        private void LoadSettings()
-        {
-            if (!EditorPrefs.HasKey(folderstoignore))
-            {
-                EditorPrefs.SetString(folderstoignore, String.Join(";",folderToIgnore));
-            }
-
-            if (!EditorPrefs.HasKey(extensiontoignore))
-            {
-                EditorPrefs.SetString(extensiontoignore, String.Join(";", fileExtensionToIgnore));
-            }
-
-            if (!EditorPrefs.HasKey(typesToignore))
-            {
-                EditorPrefs.SetString(typesToignore, String.Join(";",typesToIgnore));
-            }
-
-            folderToIgnore = EditorPrefs.GetString(folderstoignore, "").Split(';')
-                .Where(x => !string.IsNullOrWhiteSpace(x)).ToList();
-            fileExtensionToIgnore = EditorPrefs.GetString(extensiontoignore, "").Split(';')
-                .Where(x => !string.IsNullOrWhiteSpace(x)).ToList();
-            typesToIgnore = EditorPrefs.GetString(typesToignore, "").Split(';').Where(x => !string.IsNullOrWhiteSpace(x)).ToList();
-        }
-
-        private void OnGUI()
-        {
-            EditorGUILayout.LabelField("Asset Bank Scanner", EditorStyles.boldLabel);
-            GUILayout.Space(10);
-            
-            currentTab = GUILayout.Toolbar(currentTab, tabs);
-            GUILayout.Space(10);
-            switch (currentTab)
-            {
-                case 0: DrawScanner(); break;
-                case 1: DrawSettings(); break;
-            }
-        }
-
-        private void DrawSettings()
-        {
-            GUILayout.Label("Settings", EditorStyles.boldLabel);
-            foreach (var prefList in prefLists)
-            {
-                prefList.DoLayoutList();
-                EditorGUILayout.Space();
-            }
-
-            if (GUILayout.Button("Clear cache"))
-            {
-                Directory.Delete(cachePath, true);
-            }
-            return;
-            # region "Clear options"
-            if (GUILayout.Button("Clear preferences", EditorStyles.miniButton))
-            {
-                prefLists.Clear();
-                EditorPrefs.DeleteKey(folderstoignore);
-                EditorPrefs.DeleteKey(extensiontoignore);
-                EditorPrefs.DeleteKey(typesToignore);
-            }
-            #endregion
-        }
-
-        private ReorderableList CreateReorderableList(string title, List<string> targetList)
-        {
-            var list = new ReorderableList(targetList, typeof(string), true, true, true, true)
-                {
-                    drawHeaderCallback = rect =>
-                    {
-                        EditorGUI.LabelField(rect, title);
-                    },
-                    drawElementCallback = (rect, index, isActive, isFocused) =>
-                    {
-                        targetList[index] = EditorGUI.TextField(
-                            new Rect(rect.x, rect.y + 2, rect.width, EditorGUIUtility.singleLineHeight),
-                            targetList[index]
-                        );
-                    },
-                    onAddCallback = l =>
-                    {
-                        targetList.Add("");
-                    },
-                    onRemoveCallback = l =>
-                    {
-                        targetList.RemoveAt(l.index);
-                    }
-                };
-
-            return list;
-        }
-
-
-        private void DrawScanner()
-        {
-            if (GUILayout.Button("Scan project", GUILayout.Height(25)))
-            {
-                ScanProject();
-            }
-        }
-
-        private void ScanProject()
-        {
-            CreateMeta();
-            SerializeProjectSettings();
-        }
-
-        private void SerializeProjectSettings()
-        {
-            // ProjectSettingsProvider _provider = new ProjectSettingsProvider();
-            // var q = _provider.GetContext(null, "QualitySettings");
-            //
-            
-        }
-
-        private void CreateMeta()
-        {
-            float index = 0;
-            var assetPaths = AssetDatabase.GetAllAssetPaths();
-            int assetCount = assetPaths.Length;
-
-            foreach (var assetPath in assetPaths)
-            {
-                var dataPath = Path.Join(cachePath, assetPath) + ".json";
-                var metaPath = Path.Join(cachePath, assetPath) + ".meta" + ".json";
-
-                var guid = AssetDatabase.AssetPathToGUID(assetPath);
-                
-                var progress = index / assetCount;
-                index++;
-                if (string.IsNullOrEmpty(guid))
-                {
-                    Debug.LogWarning("Asset is invalid: " + assetPath);
-                    continue;
-                }
-                var extension = Path.GetExtension(assetPath);
-
-                if (fileExtensionToIgnore.Contains(extension))
-                {
-                    Debug.LogWarning("Asset file is not supported: " + assetPath);
-                    continue;
-                }
-                FileInfo info = new FileInfo(metaPath);
-                if (info.Directory != null)
-                {
-                    if (folderToIgnore.Contains(info.Directory.FullName))
-                    {
-                        Debug.Log("Ignoring directory: " + assetPath);
-                        continue;
-                    }
-                    info.Directory.Create();
-                }
-                
-                AssetMetaData assetMetaData = new AssetMetaData
-                {
-                    path = assetPath,
-                    guid = guid,
-                    dependencies = AssetDatabase.GetDependencies(assetPath)
-                };
-
-                if (EditorUtility.DisplayCancelableProgressBar("Updating", "Updating meta for file" + assetPath,
-                        progress))
-                {
-                    return;
-                }
-                Thread.Sleep(1);
-                var metaData = assetMetaData.ToJson();
-                File.WriteAllText(metaPath, metaData);
-                SerializeFile(assetPath, dataPath);
-            }
-            EditorUtility.ClearProgressBar();
-        }
-
-        private void SerializeFile(string path, string dataPath)
-        {
-            Type type = AssetDatabase.GetMainAssetTypeAtPath(path);
-            
-            // Looking at supporting types only
-            if (type != typeof(GameObject) && type != typeof(Texture) && type != typeof(Material) &&
-                type != typeof(Shader) && type != typeof(Font) && type != typeof(PlayerSettings) &&
-                type != typeof(Animation) && type != typeof(Material) &&
-                type != typeof(PrefabAssetType) && type != typeof(TextAsset) && type != typeof(AudioClip) &&
-                type != typeof(SceneAsset) && type != typeof(MonoScript) &&
-                type != typeof(ScriptableObject))
-            {
-                return;
-            }
-            
-            AssetDatabase.LoadAssetAtPath(path, type);
-            AssetData assetData = new AssetData();
-
-            // TODO: Serialization for asset types
-            var jsonifiedAsset = assetData.ToJson();
-            File.WriteAllText(dataPath, jsonifiedAsset);
-        }
-    }
-}

+ 0 - 11
Assets/AssetBank/Editor/AssetBankScanner.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 5e9f928f678334417b5ae6776de028c6
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 17
Assets/AssetBank/Editor/AssetMetaData.cs

@@ -1,17 +0,0 @@
-using System.Reflection;
-
-namespace AssetBank.Editor
-{
-    public class AssetMetaData
-    {
-        public string path;
-        public string guid;
-        public string[] dependencies;
-    }
-
-    public class AssetData
-    {
-        public string type;
-        public PropertyInfo[] properties;
-    }
-}

+ 0 - 3
Assets/AssetBank/Editor/AssetMetaData.cs.meta

@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 0ce6485c9794419ebd69009eede17c28
-timeCreated: 1752822068

+ 0 - 20
Assets/AssetBank/Editor/Texture2DSerializer.cs

@@ -1,20 +0,0 @@
-using LLM.Editor.Helper;
-using UnityEngine;
-
-namespace AssetBank.Editor
-{
-    public class Texture2DSerializer : UnityAssetSerializer<Texture2D>
-    {
-        public string Serialize(Texture2D asset)
-        {
-            var textureData = new TextureData();
-            return textureData.ToJson();
-        }
-    }
-
-
-    public class TextureData
-    {
-        
-    }
-}

+ 0 - 3
Assets/AssetBank/Editor/Texture2DSerializer.cs.meta

@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 7d0605f1b681438f80e971ccf8fa9e27
-timeCreated: 1752845905

+ 0 - 7
Assets/AssetBank/Editor/UnityAssetSerializer.cs

@@ -1,7 +0,0 @@
-namespace AssetBank.Editor
-{
-    public interface UnityAssetSerializer<T> where T : UnityEngine.Object
-    {
-        string Serialize(T asset);
-    }
-}

+ 0 - 3
Assets/AssetBank/Editor/UnityAssetSerializer.cs.meta

@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 60350600c9fb4016a0969e0357411623
-timeCreated: 1752840889