diff --git a/src/Editor/MonoScriptsAssetProcessor.cs b/src/Editor/MonoScriptsAssetProcessor.cs index 5d9d094..3d0778b 100644 --- a/src/Editor/MonoScriptsAssetProcessor.cs +++ b/src/Editor/MonoScriptsAssetProcessor.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using UnityEditor; -using UnityEngine; namespace DCFApixels.DragonECS.Unity.Editors { @@ -17,35 +16,28 @@ namespace DCFApixels.DragonECS.Unity.Editors foreach (string str in importedAssets) { - Debug.Log("Reimported Asset: " + str); + //Debug.Log("Reimported Asset: " + str); ProcessAssetPath(str); } foreach (string str in deletedAssets) { - Debug.Log("Deleted Asset: " + str); + //Debug.Log("Deleted Asset: " + str); RemoveAssetPath(str); } for (int i = 0; i < movedAssets.Length; i++) { - Debug.Log("Moved Asset: " + movedAssets[i] + " from: " + movedFromAssetPaths[i]); + //Debug.Log("Moved Asset: " + movedAssets[i] + " from: " + movedFromAssetPaths[i]); RemoveAssetPath(movedFromAssetPaths[i]); ProcessAssetPath(movedAssets[i]); } - if (didDomainReload) - { - Debug.Log("Domain has been reloaded"); - } + //if (didDomainReload) + //{ + // Debug.Log("Domain has been reloaded"); + //} + - foreach (var item in _removedScriptGuids) - { - Debug.Log(item); - } - foreach (var item in _newScriptIDs) - { - Debug.Log(item); - } _version = DateTime.Now.Ticks; } @@ -64,14 +56,14 @@ namespace DCFApixels.DragonECS.Unity.Editors private static void RemoveAssetPath(string filePath) { if (IsScript(filePath) == false) { return; } - Debug.Log("RemoveAssetPath: " + filePath); + //Debug.Log("RemoveAssetPath: " + filePath); _removedScriptGuids.Add(filePath); } private static void ProcessAssetPath(string filePath) { if (IsScript(filePath) == false) { return; } - Debug.Log("ProcessAssetPath: " + filePath); + //Debug.Log("ProcessAssetPath: " + filePath); var script = AssetDatabase.LoadAssetAtPath(filePath).text; _newScriptIDs.Add(filePath); diff --git a/src/Internal/Editor/UnityEditorUtility.cs b/src/Internal/Editor/UnityEditorUtility.cs index 5f7a031..e78df8a 100644 --- a/src/Internal/Editor/UnityEditorUtility.cs +++ b/src/Internal/Editor/UnityEditorUtility.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reflection; using System.Runtime.InteropServices; using System.Text; using UnityEngine; @@ -118,7 +117,7 @@ namespace DCFApixels.DragonECS.Unity.Editors var targetTypes = assembly.GetTypes().Where(type => (type.IsGenericType || type.IsAbstract || type.IsInterface) == false && type.IsSubclassOf(typeof(UnityObject)) == false && - type.GetCustomAttribute() != null); + /*type.GetCustomAttribute() != null*/ true); serializableTypes.AddRange(targetTypes); } diff --git a/src/RefRepairer/MetaIDRegistry.cs b/src/RefRepairer/Editor/MetaIDRegistry.cs similarity index 100% rename from src/RefRepairer/MetaIDRegistry.cs rename to src/RefRepairer/Editor/MetaIDRegistry.cs diff --git a/src/RefRepairer/MetaIDRegistry.cs.meta b/src/RefRepairer/Editor/MetaIDRegistry.cs.meta similarity index 100% rename from src/RefRepairer/MetaIDRegistry.cs.meta rename to src/RefRepairer/Editor/MetaIDRegistry.cs.meta diff --git a/src/RefRepairer/MissingRefContainer.cs b/src/RefRepairer/Utils/MissingRefContainer.cs similarity index 100% rename from src/RefRepairer/MissingRefContainer.cs rename to src/RefRepairer/Utils/MissingRefContainer.cs diff --git a/src/RefRepairer/MissingRefContainer.cs.meta b/src/RefRepairer/Utils/MissingRefContainer.cs.meta similarity index 100% rename from src/RefRepairer/MissingRefContainer.cs.meta rename to src/RefRepairer/Utils/MissingRefContainer.cs.meta diff --git a/src/RefRepairer/RepairerFile.cs b/src/RefRepairer/Utils/RepaireFileUtility.cs similarity index 66% rename from src/RefRepairer/RepairerFile.cs rename to src/RefRepairer/Utils/RepaireFileUtility.cs index b46bb77..eb65bee 100644 --- a/src/RefRepairer/RepairerFile.cs +++ b/src/RefRepairer/Utils/RepaireFileUtility.cs @@ -98,66 +98,5 @@ namespace DCFApixels.DragonECS.Unity.RefRepairer.Editors } } } - - - //internal class RepairerFile - //{ - // private readonly Type _type; - // private readonly string[] _fileLines; - // - // private string _currentLine; - // private string _nextLine; - // - // private int _currentIndex; - // - // private readonly string _path; - // private readonly string _localAssetPath; - // - // public RepairerFile(Type type, string localAssetPath) - // { - // _type = type; - // _localAssetPath = localAssetPath; - // - // _path = $"{Application.dataPath.Replace("/Assets", "")}/{localAssetPath}"; - // _fileLines = File.ReadAllLines(_path); - // } - // - // public delegate bool GetterMissingTypeData(out MissingTypeData missingType); - // - // public void Repair(Func callbackForNextLine) - // { - // for (int i = 0; i < _fileLines.Length - 1; ++i) - // { - // _currentIndex = i; - // - // _currentLine = _fileLines[i]; - // _nextLine = _fileLines[i + 1]; - // - // if (callbackForNextLine.Invoke()) - // break; - // } - // - // File.WriteAllLines(_path, _fileLines); - // - // AssetDatabase.ImportAsset(_localAssetPath, ImportAssetOptions.ForceUpdate); - // AssetDatabase.Refresh(); - // } - // - // public bool CheckNeedLineAndReplacedIt(ManagedReferenceMissingType missingType) - // { - // string rid = $"rid: {missingType.referenceId}"; - // string oldTypeData = $"type: {{class: {missingType.className}, ns: {missingType.namespaceName}, asm: {missingType.assemblyName}}}"; - // - // if (_currentLine.Contains(rid) && _nextLine.Contains(oldTypeData)) - // { - // string newTypeData = $"type: {{class: {_type.Name}, ns: {_type.Namespace}, asm: {_type.Assembly.GetName().Name}}}"; - // _fileLines[_currentIndex + 1] = _nextLine.Replace(oldTypeData, newTypeData); - // - // return true; - // } - // - // return false; - // } - //} } #endif \ No newline at end of file diff --git a/src/RefRepairer/RepairerFile.cs.meta b/src/RefRepairer/Utils/RepaireFileUtility.cs.meta similarity index 100% rename from src/RefRepairer/RepairerFile.cs.meta rename to src/RefRepairer/Utils/RepaireFileUtility.cs.meta