Useful utility function for ensuring assets are loaded before trying to use them.