Skip to content

Commit f270857

Browse files
yaustarSteven Yau
andauthored
Asset unload event moved to public API (playcanvas#2885)
* asset unload event move to public API * Added example of use of the asset unload event Co-authored-by: Steven Yau <syau@snaphcat.com>
1 parent e7a9a72 commit f270857

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/asset/asset.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ class Asset extends EventHandler {
110110
* @param {Asset} asset - The asset that was loaded.
111111
*/
112112

113+
/**
114+
* @event
115+
* @name Asset#unload
116+
* @description Fired just before the asset unloads the resource. This allows for the opportunity to prepare for an asset that will be unloaded. E.g. Changing the texture of a model to a default before the one it was using is unloaded.
117+
* @param {Asset} asset - The asset that is due to be unloaded.
118+
*/
119+
113120
/**
114121
* @event
115122
* @name Asset#remove

0 commit comments

Comments
 (0)