- API Changes: These static methods have been MOVED from Asset to Asset.File:
- GetMainType
- GetSubType
- GetGuid
- GetFileId
- GetGuidAndFileId
- Rationale: These methods hindered API discovery via auto-completion by cluttering the Asset namespace, and they truly belong to the File API since they query asset file attributes.
- Fixed: 2021.3 shows warning when copying (duplicate, save as new) an asset, complaining that filename must match asset object name. This is likely a bug in Unity.
- Fixed the same 2021.3 issue in workflow sample. Also required importing batched asset after copying them.
- Asset.File.Import takes IEnumerable as input (not just array)
- added Sample: Asset Workflow with GUI. Allows selecting between CodeSmile and Unity API. Unity API code is 33% more lines/characters, with folder creation hardcoded.
- added Asset.File.FindPaths overload accepting Path[]
- added Asset.Label.GetAll overload accepting Path
- added Asset.Label.Remove and Asset().RemoveLabel
- fixed invalid cast exception (Asset.Path[] to string[])
- removed add sub-asset check for ".asset" extension. Turns out you can also add subassets to a .mesh extension asset and there may be others.
- added asset lifetime sample script
- updated documentation
- Importer tests: disable some tests in 2021.3 because the method is not available
- Rename test: log warning in 2021.3 to mention that the following warning is expected
- updated README and API docs
- removed extra call to "ImportIfNotImported" in load asset method chain
- added AvailableImporters property
- added missing Asset.Importer, Asset.Path and Asset.File.Create tests
- renamed ForceReserializeAssets to UpgradeAssetSerializationVersion and
- renamed ForceReserializeAllAssets to UpgradeAllAssetSerializationVersions (*)
(*) To provide more rationale: I saw a user's script where the user helplessly threw in the usual candidates due to some issue, but this also included "ForceReserializeAssets". That's when I realized the name of the method only describes what it does internally but not its intent respectively what it should be used for: upgrading the version (format) of serialized assets when you change editor versions and you want version control not polluting these upgrades in individual future commits.
- rename package to de.codesmile.assetdabase (removed the 'editor' part)
- Asset.File.Delete avoids unnecessary warning message from Unity if path.Exists is false
- Import() throws if file does not exist
- added setter to ActiveImporter property
- removed SetActiveImporterToDefault and SetActiveImporter methods
- added [NotNull] attributes
- code cleanup
- changed namespace from CodeSmile.Editor.* to CodeSmileEditor.*
- new Asset(Path) now auto-imports assets that exist on disk but not in DB
- changed load methods to import assets that exist on disk but not in DB
- added create asset from string (ctor and Asset.Create)
- added create asset from byte[] (ctor and Asset.Create)
- added ImportAndLoad
- added Import(Path[]) to batch-import multiple assets
- added IsImported(Path)
- added setter to DirectoryMonitoring
- added Database.Contains back and redirected Status.IsImported (same)
- added paths to all important subfolders (eg Packages, Library, ..)
- split Create into Create and CreateAsNew
- split Copy into Copy and CopyAsNew
- renamed Copy instance method to SaveAs and SaveAsNew
- renamed FailedToDeletePaths to PathsNotDeleted
- renamed ToAssetPaths(Object[]) to Get(Object[])
- fixed compile errors in some Unity versions
- GetIcon returns Texture2D
- added static GetMainType(guid)
- added static GetSubType
- renamed Status IsForeignAsset to IsForeign
- renamed Status IsNativeAsset to IsNative
- renamed Database DirectoryMonitoringEnabled to DirectoryMonitoring
- renamed Dependency Set to Register
- renamed Dependency Remove to Unregister
- renamed Importer SaveSettings to ApplySettings
- renamed Path OpenFolder to OpenExternal
- renamed Path UniquifyFilename to UniquifyFileName (camel case)
- removed various ExcludeFromCodeCoverage attributes, added comment with reason to the remaining ones
- added several 'Object' getters to methods with only 'Path' parameters
- added static GetGuid method
- added static GetGuidAndFileId method
- Fixed all technical documentation issues.
- CreateFolders now internalized the assumption that the last part of a path, if it contains no extension, is also a folder.
- Removed FolderPathAssumptive
- FolderPath does not throw but returns null if called on a root folder path ie "Assets".
- Fixed compile error in Unity 2021.3.
- Tested in all minor Unity versions from 2021.3 through 2023.3.
- First release that's nearly complete. Redesign for 99% of all AssetDatabase methods.
- Major refactoring of API Design.
- Fixed a compile error in Unity 2021.3.
- Documentation added and updated.
- Mainly refactoring.
- First release