Skip to content

Glossary: Events

Aviril edited this page Nov 29, 2024 · 24 revisions

• Assetify:onLoad - shared

Fired after library gets loaded and assets are downloaded.
🚨This network is immediately destroyed after being fired. Please refer here if you want to schedule it for later use.

assetify.network:fetch("Assetify:onLoad", true):on(function()
   print("Assetify successfully loaded")
end)

• Assetify:onUnload - shared

Fired after library & assets is unloaded.

assetify.network:fetch("Assetify:onUnload", true):on(function()
   print("Assetify successfully unloaded")
end)

• Assetify:onModuleLoad - shared

Fired after library's modules are downloaded and loaded.
🚨This network is immediately destroyed after being fired. Please refer here if you want to schedule it for later use.

assetify.network:fetch("Assetify:onModuleLoad", true):on(function()
   print("Assetify's modules successfully loaded")
end)

• Assetify:onResourceLoad - shared

Fired after hooked resource is loaded.

assetify.network:fetch("Assetify:onResourceLoad", true):on(function(resourceName, resourceSource)
   print("Resource: "..resourceName.." successfully loaded")
end)

• Assetify:onResourceFlush - shared

Fired after hooked resource is flushed.

assetify.network:fetch("Assetify:onResourceFlush", true):on(function(resourceName, resourceSource)
   print("Resource: "..resourceName.." successfully flushed")
end)

• Assetify:onResourceUnload - shared

Fired after hooked resource is unloaded.

assetify.network:fetch("Assetify:onResourceUnload ", true):on(function(resourceName, resourceSource)
   print("Resource: "..resourceName.." successfully unloaded")
end)

• Assetify:onAssetLoad - client

Fired after asset is loaded.

assetify.network:fetch("Assetify:onAssetLoad", true):on(function(assetType, assetName)
   print("Asset Loaded: "..assetName.."("..assetType..")")
end)

• Assetify:onAssetUnload - client

Fired after asset is unloaded.

assetify.network:fetch("Assetify:onAssetUnload", true):on(function(assetType, assetName)
   print("Asset Unloaded: "..assetName.."("..assetType..")")
end)

• Assetify:onGlobalDataChange - shared

Fired when global data changes.

assetify.network:fetch("Assetify:onGlobalDataChange", true):on(function(data, oldValue, newValue)
   print("Global Data Changed: "..data.." : "..tostring(oldValue).." : "..tostring(newValue))
end)

• Assetify:onEntityDataChange - shared

Fired when entity data changes.

assetify.network:fetch("Assetify:onEntityDataChange", true):on(function(element, data, oldValue, newValue)
   print("Entity Data Changed: "..tostring(element).." : "..data.." : "..tostring(oldValue).." : "..tostring(newValue))
end)