diff --git a/Docs~/Doxyfile b/Docs~/Doxyfile index 5c8c5334..ea83a992 100644 --- a/Docs~/Doxyfile +++ b/Docs~/Doxyfile @@ -1991,7 +1991,7 @@ EXTRA_SEARCH_MAPPINGS = # If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. # The default value is: YES. -GENERATE_LATEX = NO +GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of @@ -2039,7 +2039,7 @@ LATEX_MAKEINDEX_CMD = makeindex # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. -COMPACT_LATEX = NO +COMPACT_LATEX = YES # The PAPER_TYPE tag can be used to set the paper type that is used by the # printer. @@ -2142,7 +2142,7 @@ USE_PDFLATEX = YES # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_BATCHMODE = NO +LATEX_BATCHMODE = NON_STOP # If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the # index chapters (such as File Index, Compound Index, etc.) in the output. diff --git a/Docs~/html/doxygen_crawl.html b/Docs~/html/doxygen_crawl.html index c9f470a8..55f575ba 100644 --- a/Docs~/html/doxygen_crawl.html +++ b/Docs~/html/doxygen_crawl.html @@ -8,26 +8,27 @@ - - + + + - - - + + + + - - - - - + + + + diff --git a/Docs~/html/index.html b/Docs~/html/index.html index b7b90b88..ac677dd2 100644 --- a/Docs~/html/index.html +++ b/Docs~/html/index.html @@ -110,27 +110,14 @@

For every task there is a single call and you are DONE!

The structure and naming is intended to be EXTREMELY simple to find your way around and then to call the appropriate method with fewer parameters, with names that speak for themselves.

No longer do you need to wonder what a 'valid folder' might be. Or ponder what it means to 'force reserialize all assets'.

-

Let alone the ubiquitous 'SaveAllAssets' followed by 'Refresh' - are you calling that in your scripts? 99% chance you just put it there out of habit. You never gave it any thought. You have no idea what it really does. Not even that it can cripple editor performance. Or when calling it is NOT needed. (Hint: almost every time.)

+

Let alone the ubiquitous 'SaveAllAssets' followed by 'Refresh' - are you calling that in your scripts? 99% chance you just put it there out of habit. You never gave it any thought. You have no idea what it really does. Not even that it can cripple editor performance. Or when calling it is indeed required. (Hint: almost never!)

Or just being confused, once again, about whether you need to use AssetDatabase.GetTextMetaFilePathFromAssetPath or AssetDatabase.GetAssetPathFromTextMetaFilePath. Or the unholy trinity: AssetPath.AssetPathToGUID~AssetPath.GUIDFromAssetPath~AssetPath.GUIDToAssetPath.

-

-I don't trust this ..

-

The implementation is utmost CORRECT - there are no unnecessary, performance-degrading calls such as 'Refresh' and 'SaveAllAssets' littered throughout like you'll find in most editor scripts - unfortunately even in popular assets/libraries!

-

It is also extensively unit TESTED to be correct.

-

And I happen to love correct, clean code. Most developers move on when their code works. I cannot move on until I understand why my code works.

-

-What about support?

-

The documentation is more complete with more details and caveats mentioned than Unity's.

-

And if there's anything out of the ordinary, open an issue or contact me. I also have a Discord channel.

Example Code Snippets

Asset data = "Assets/Folder/Data.asset"; // Load an asset from its path

data.ForceSave(); // mark asset as dirty and save it

data.AddSubAsset(subData); // Add a sub-asset (implicitly saved)

data.ActiveImporter = typeof(MyDataImporter); // Change asset's importer

-

data.ExportPackage("I:/leveldata.unitypackage"); // Export as .unitypackage

-

var dataObject = data.MainObject; // Get asset's UnityEngine.Object instance

-

var levelData = data.GetAs<LevelData>(); // Get it as specific type (may be null)

-

var levelData = (LevelData)data; // Cast to a type (may throw)

var obj = Asset.File.Create(str, "Assets/Folder/Data.asset"); // Create (overwrite) asset from string

var obj = Asset.File.CreateAsNew(bytes, "Assets/Folder/Data.asset"); // Create new asset from byte[]

var asset = new Asset(bytes, "Assets/Folder/Data.asset"); // Same as above using Asset ctor

@@ -143,12 +130,34 @@

  • Load the new asset file
  • var actualPath = asset.AssetPath; // Filename might have changed, eg "Data (3).asset"

    +

    asset.ExportPackage("I:/leveldata.unitypackage"); // Export as .unitypackage

    +

    var obj = asset.MainObject; // Get asset's UnityEngine.Object instance

    +

    var levelData = asset.GetAs<LevelData>(); // Get it as specific type (may be null)

    +

    var levelData = (LevelData)asset; // Cast to a type (may throw)

    var subAssets = asset.SubAssets; // Do I need to keep explaining these calls?

    var assetDupe = asset.Duplicate(); // Because you need a duplicate ..

    assetDupe.Delete(); // .. but then decided you don't.

    var newAsset = asset.SaveAsNew("Assets/Elsewhere/Daydah.asset"); // Now you want a copy?

    newAsset.Trash(); // Okay. Either you're bored or excited to work with the AssetDatabase for the first time EVER. :)

    +

    Asset.File.BatchEditing(() => { /* mass file IO */ }); // Speed up calling many Asset.File.* methods (loop)

    +

    Asset.File.Import(paths); // Mass import of paths, batched internally

    var msg = Asset.GetLastErrorMessage(); // A file operation failed? Show this!

    +

    +I don't trust this ..

    +

    The implementation is utmost CORRECT - there are no unnecessary, performance-degrading calls such as 'Refresh' and 'SaveAllAssets' littered throughout like you'll find in most editor scripts - unfortunately even in popular assets/libraries!

    +

    It is also extensively unit TESTED to be correct.

    +

    And I happen to love correct, clean code. Most developers move on when their code works. I cannot move on until I understand why my code works.

    +

    +What about support?

    +

    The documentation is more complete with more details and caveats mentioned than Unity's.

    +

    And if there's anything out of the ordinary, open an issue or contact me. I also have a Discord channel.

    +

    +Where's Refresh?

    +

    I did mention you don't need it, right? ;)

    +

    But if you do, here's Waldo: Asset.Database.ImportAll();

    +

    Caution: This is an expensive (!) database operation in that it scans the ENTIRE "Assets" tree and tests ALL (!) files for changes made EXTERNALLY (eg System.IO methods, bash scripts).

    +

    Refresh also unloads all unused (cached) resources, forcing them to be reloaded from disk on the next use. You can imagine how this has a negative impact on editor performance.

    +

    Since Refresh() has been excessively overused I decided to name it closer to what it actually does.

    Documentation