Which files mention an asset, and rewriting them when it moves.
Project files refer to assets by path:
- scenes, atlases, animator graphs and the editor's other JSON files
(
.json, and.jspritesprite projects) as whole quoted strings —"assets/sprites/hero.png"; - the game's Dart code under
lib/as string literals —'assets/audio/jump.wav'; pubspec.yamlin itsflutter:section's lists —- assets/sprites/;- Tiled maps, tilesets and templates (
.tmx,.tsx,.tx) in theirsourceandtemplateattributes, relative to the file itself —source="../tilesets/grassland.png".
So "who uses this?" is a text search — exact: a file's path is matched as a whole string, not a fragment. A folder matches every path under it.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
find(
AssetIndex index, String path) → Future< List< String> > -
The files that mention
path: for a file, its whole path; for a folder, any path under it — the folder's own files included, which name each other by path too. -
rewrite(
AssetIndex index, String from, String to) → Future< List< String> > -
Points every mention of
fromatto, oncefromhas been renamedtoon disk: a file's path, or a folder's and so every path under it. Returns the files changed.
Constants
- backupFolder → const String
-
Where rewrite keeps each file as it was before it changed it, in a
folder per rewrite, under the project: never under
assets/, which ships with the game. - backupsKept → const int
- How many rewrites' backups are kept; older ones are deleted.
- codeFolder → const String
- Where the game's code is, under the project: what is read for paths in string literals.
-
jsonEndings
→ const List<
String> - The endings of the files under the index read as JSON.
- pubspec → const String
- The project's pubspec, which lists what the game ships.
-
tiledEndings
→ const List<
String> - The endings of the Tiled files read for their relative paths.